User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 402,911 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,080 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 409 | Replies: 5
Reply
Join Date: Feb 2008
Posts: 35
Reputation: brightline is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
brightline brightline is offline Offline
Light Poster

GirdView Problem

  #1  
Jun 29th, 2008
I have a gridview that contains an 'edit' command button.
The problem is that when I click the this 'edit' command button it does not work from the first time,I must click it 2 times to enable edit mode.
I want help to make it enable edit mode from the first time.
I am using VS.NET 2005.

this is the code that I am using to enable editing mode:

protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
}

Thanks in advace.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 50
Reputation: dskumar_85 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
dskumar_85 dskumar_85 is offline Offline
Junior Poster in Training

Re: GirdView Problem

  #2  
Jun 30th, 2008
I THINK it's better to give poskback to the grid .... try this
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 125
Reputation: bala24 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 11
bala24's Avatar
bala24 bala24 is offline Offline
Junior Poster

Re: GirdView Problem

  #3  
Jul 1st, 2008
I think you are binding the gridview inside a IF not ISPOSTBACK ----END IF code in Page Load.

Paste it outside this on Page Load.

This should do the trick.
Michelangelo

"The best place to find a helping hand is at the end of your own arm"
Reply With Quote  
Join Date: Jan 2008
Location: istanbul
Posts: 265
Reputation: serkansendur is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 23
serkansendur's Avatar
serkansendur serkansendur is offline Offline
Posting Whiz in Training

Re: GirdView Problem

  #4  
Jul 1st, 2008
Call the GridView1.DataBind() method after setting the edit index inside the GridView1.RowEditing event handler
Last edited by serkansendur : Jul 1st, 2008 at 2:27 pm.
Serkan Şendur
MCAD.NET
Reply With Quote  
Join Date: Feb 2008
Posts: 35
Reputation: brightline is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
brightline brightline is offline Offline
Light Poster

Re: GirdView Problem

  #5  
Jul 2nd, 2008
Can u tell me how 2 do this (postback).
thnx in advance.
Reply With Quote  
Join Date: Jul 2008
Posts: 3
Reputation: aspking is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
aspking aspking is offline Offline
Newbie Poster

Re: GirdView Problem

  #6  
Jul 3rd, 2008
I found this over at aspnettutorials.com. I think should help ya.

http://www.aspnettutorials.com/tutor...te-csharp.aspx
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 3:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC