EDN Admin
Well-known member
I have a Data Bound DataGridView with several columns. I want to programmatically sort the rows based on the values in one of the columns, but not automatically sort every time data binding occurs. I set the sort columns SortMode to Programmatic and the rest of the columns to NotSortable. I then programmatically invoke the DGVs Sort method to sort on the Programmatic column immediately after the initial data binding (i.e. after setting the DGVs DataSource to a DataTable) . So far so good. However, when the user clicks off the DGV, the DGV automatically re-sorts during (or as a result of) a Data Binding triggered at the time of the Leave event. Curiously (to me), the automatic sort does not occur when I remove the programmatic invoke of Sort, implying that invoking Sort once implicitly sets some DGV property that subsequently triggers automatic sorting on the same column. Why is this happening and is there any way to stop it? I only want the sorting done when I programmatically invoke the DGVs Sort method.
Thx. Steve
View the full article
Thx. Steve
View the full article