Hi All,
I am using .net framework 1.1 and c#. I have one problem regarding dataview.
I have one dataview to which sorting may be applied or may not be applied. I have one UI component where I am displaying the dataview. All rows in dataview are displayed in the sequence as they appear in dataview. i.e. there is direct mapping between dataview rows and UI rows.
I have subscribed ColumnChanged event of the datatable on which dataview is created. In column changed event I want to update the single column value on UI that has been changed. In Columnchanged event I want to find out the corrosponding row in UI ie. in dataview (dataview and UI rows are directly mapped.)
There are Dataview.find & dataview.findrows methods. but these method need Sort property to be set, it work on columns on which sorting is applied. I do not want this as in my case it is not necessary to be have some sorting on dataview.
currently i am doing looping through dataview and comparing the column values to find out the perticular index of row in dataview and then update the UI.
I have tried dataview ListChanged event also. But in listevent we can get whether itemadded, itemchanged, itemdeleted, itemmoved and the newIndex and OldIndex. but in itemchanged type we can not get any idea about which column is changed. Hence i am using Columnchanged event of underlying datatable to get know which column is changed.
But it is time consuming. If dataview is with 500, 600 rows, then this comparision takes too much time. I want some efficient method to find out the rowindex in dataview depending upon some column value (may be primary key)
Any help regaring this will be appriciated.
Pravin