Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
UltraGrids and BindingSources: First Row and DataSourceChanged
posted

Hello,

I have two questions about using the UltraGrids with a BindingSource.

Firstly, why is the first row automatically made active after binding the bindingsource as the grid's datasource? I don't like this functionality, because strangely enough the Position- or CurrentChanged is not called when this row is automatically selected.

This causes the CurrentChanged event not to be fired when a user actually clicks (and selects/makes active) that first row. In order to get around this issue, I have bound the AfterRowActivate event and I unbind it the first time it has fired. In the event code I check whether the Position of the BindingSource = 0 and if it is, I fire the CurrentChanged event myself.

This is really annoying; is there any other way around this? I would like it i the first row doesn't become active automatically, but the CurrentChanged event would still be fired if the first row is made active.

 

Secondly, why doesn't the UltraGrid have a DataSourceChanged event or something like that? I really need it, but I can't find anything in the API.