Hello
Suppose that one has a band with 3 columns where one of them is the "Primary Key". How can I check if a certain key exists within the data? How can I retrieve a row given the key?
Thanks a lot
Hi,
There's no better way. UltraDataSource doesn't have any built-in search capability - and even if it did, it would have to loop through the rows internally, anyway.
I have the same problem. I have an UltraDataSource binded to the UltraWinGrid. Now after the initial loading I need to update a row. so now I am assuming that i need to change the row in the UltraDataSource, what's the best way to find the Row I need to update.
I can loop through all the rows in the UltraDataSource and then find the row, but that shounds not so efficient. I mean there is not Find, Search or Contains method in the UltraDataSource. I mean if I have to loop through 10000 reconds to update one row then it's I better not use UltraDataSource.
thanks
D
If your DataSource is a DataTable, then it is probably more efficient to search the data source than the search the grid. DataTable has methods for finding rows built-in.
You need to loop through the rows.
var column = grid.DisplayLayout.Bands[0].Columns[columnName];
foreach (UltraGridRow row in grid.Rows)
if (row.GetCellValue(column) == myValue)
....