PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Datagrid Problems
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Datagrid Problems
![]() |
Datagrid Problems |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I created a datagrid with an edit button which redirects to another
page for editing. This seemed to work fine. Then, I added a way to search which just modified the SQL by adding a WHERE clause (I know, it's going to be put into a stored proc, just trying to get it to work for now). This also seemed to work... Until I clicked on the edit button. It brings up the wrong record. I tried mygrid.DataKeys[e.Item.ItemIndex].ToString() and then I put the primary key into a column, and tried e.Item.Cells[0].Text which also brings up the wrong primary key. The really wierd thing is that the correct primary key is displayed in the column. Can anyone help me? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Is it ASP.NET you are talking about (your redirection statement seems to
indicate that)? If it is, what event are you using the e.Item.ItemIndex in (i.e. what is the type of the parameter e)? "Calson33" <Calson33@gmail.com> wrote in message news:1158562352.940975.119100@i3g2000cwc.googlegroups.com... >I created a datagrid with an edit button which redirects to another > page for editing. This seemed to work fine. Then, I added a way to > search which just modified the SQL by adding a WHERE clause (I know, > it's going to be put into a stored proc, just trying to get it to work > for now). > This also seemed to work... Until I clicked on the edit button. It > brings up the wrong record. > I tried > mygrid.DataKeys[e.Item.ItemIndex].ToString() > and then I put the primary key into a column, and tried > e.Item.Cells[0].Text > which also brings up the wrong primary key. The really wierd thing is > that the correct primary key is displayed in the column. > > Can anyone help me? > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

