Hi,
Am working on a real time application and am having the following problem,
We are having a wrapper for the ulragrid with an ultradatasource instance in it. This acts as the data source to the grid. When the data is received from the backend the data is passed to a method in the wrapper which forms the received data into a ultradatasource's row. This makes addition of data simpler. But when it comes to updation or deletion of data I have no other choice to loop through the entire source to find the source. Is there any simpler way to do it?
Is there a concept of having something like making a column in the ultradatasource as primary key which would make search, update and delete easier?
Please help. Thanks in Advance.
Hi Mike,
I had a need where updating the 'HappyManager' cell meant I needed to update all the rows (and the underlying SQL DB) where the 'HappyID' was a certain value.
I think something like this might have worked for your customer:
Dim rows As UltraDataRow()
rows = (From p As UltraDataRow In UltraDataSource1.Rows Where p.Item("HappyID") = paramHappyID.Value).ToArray
He could then use an Array.ForEach to update all rows efficiently...
Lack of built in load functionality is the real drag of the UltraDataSource.
No, there is no search functionality built-in to UltraDataSource or UltraWinGrid. But if the user is somehow deleting or modifying a row in the grid, then you know what row is being acted upon, so there is no reason to search.
We could add search functionality to the controls, but the reality is that our could would not be any better or more efficient than yours, and in fact it might even be less so since any code in the control itself would have to be written abstractly - we cannot make assumptions about the data that you can.
Depending on what you are looking for, you might be able to find it more easily by sorting the data and doing a binary search, for example.
Mike,
Am asking for some feature like Search(searchCriteria) for ultra data source which will make my work easier. In my case I will have 100000 rows in the grid out of which I need to delete/Update only one row in grid which is based on a unique key column in the grid. Is there some feature supported for this?
Please help.
jacobkingsly said:But when it comes to updation or deletion of data I have no other choice to loop through the entire source to find the source. Is there any simpler way to do it?
The UltraGridRow has a ListObject property which will return the associated object in the underlying data source. So in this case, row.ListObject will return the UltraDataRow that is associated with that row.