nagham ghandour

nagham ghandour

  • NA
  • 9
  • 1.4k

DataGridView Sorting Prob

Oct 26 2011 2:36 AM

Hello there, am using 2008 version, C#.net, how ever a normal DataGridView  is used to dispaly, add and edit data, this dgv has a datatable as datasourse: dgv.DataSource= dt;

this dgv is disabled until the user select a row and click the edit button, the selected row become enabled ready to be editted.

My prob is: if user resorted any of the columns by clicking the header (the normal resort) rows will be resorted, if user clicked a row and click button edit, this row will be enabled ready to be edited, how ever if user entered a value when he leaves the current row, this row will be resorted, stuff that is annoying me in many ways, and I found that event sorting of dgv is not fired, so it seems the there is a synchronisation between dt and dgv, the resorting is on dt, and I need that the datasource of the dgv stay a datatable not an instance of a class or anything else


So how can I fix this problem


Answers (2)