Hi,
I have a dataset handle returning from a class.
And this handle is attached to the bindingsource -> ultragrid.
And after some filter criteria the values in the dataset are changed but values in the ultragrid are not refreshed.
the dataset has the new set of values but these values are not available in the bindingsource.
Can any one help me on this?
Thanks!
Regards,
Vikas.
You just need to reopen the query. PLEASE do not set the handle property of the BindingSource to unknown and reset. That should never be necessary and is a big waste of time. It will refresh its schema and everything else that has not actually changed.
The BindingSource works off of a query result set. If the query is not reopened, the record count may be wrong, which is critical for the grid to work correctly, and at least for the records that you've already scanned through it would be trying to read that original set, not anything related to the new records.
And if the AutoSync property of the BindingSource is true, which it is by default, you don't even have to call the Refresh method. The query open will take care of it.
Thanks Peter.
Those methods didnt work. When i try to read the record count in the bindingsource it always return with the inital value (called for first time).
Second time the dataset has different number of records but binding source do not.
You just need to reopen the query. PLEASE do not set the handle property of the BindingSource to unknown and reset. That should never be necessary and is a big waste of time. It will refresh its schema and everything else that has not actually changed.
The BindingSource works off of a query result set. If the query is not reopened, the record count may be wrong, which is critical for the grid to work correctly, and at least for the records that you've already scanned through it would be trying to read that original set, not anything related to the new records.
And if the AutoSync property of the BindingSource is true, which it is by default, you don't even have to call the Refresh method. The query open will take care of it.
Thanks Laura Stern. Mapping the bindingsource to the Query handle worked.