DataGrid Edit problem after sort

  • Thread starter Thread starter keys4worship
  • Start date Start date
K

keys4worship

One of my users called yesterday and asked me to look into a problem on
a datagrid. Everytime she clicked on a row to edit, another row would
appear in it's place. After a little analysis it appeared that this
only happened after the datagrid was sorted. I placed the row in edit
mode. Almost everytime that I clicked the Cancel button on that row I
experienced a random shuffling of rows.

I am using ViewState and DataView Sort to hold the sort value . I used
Response.Write to display the value while debugging. The value seems to
be correct.

I did a quick search on Google. It seems that this is a common problem.
Some of these posts were a couple of years old. Has a solution for this
been discovered?
 
(Almost) without doubt this is a bug in your code not .NET. You need to
review your code carefully.
 
Thanks for your reply. I discovered the problem. It was in the SQL
database table. I had a field PK that also had a separate index on it.
Once I removed the index from that field everything was fine.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top