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
380
Binding Selected and Active Row
posted

Hi,

Is it possible to bind to the Selected and the IsActiveRow property of the UltraGridRow ?. My DetailViewModel (View model of the row) contains a IsSelected and a IsActive property but i don't know how to set the binding. Microsoft Controls have a ControlBindingsCollection where i can ad a binding is this also possible at the ultrgird ?

This is an example of a Microsoft windows forms button where i have set a binding between the Enabled property of the button and the AllowAddNew property from the ViewModel:

 bnAdd.DataBindings.Add(New Binding("Enabled", m_oViewModel, "AllowAddNew"))

Regards,

Alti

  • 4625
    Offline posted

    Hello Christian,

    Thank you for posting in our forums!

    I am checking about the progress of your issue.

    Please tell us if you have any further questions or we are missing something.

  • 469350
    Suggested Answer
    Offline posted

    Hi Alti,

    I don't think this will work. In theory, you could bind to any control-level property using DataBinding.Add. So the ActiveRow might technically be bindable, but you would need to bind it to something that returns an UltraGridRow that exists in the grid, so that would not make much sense.

    If you want to synchronize the ActiveRow of the grid with your data source's ActiveRow, then you will probably need to write code for this. Presumably your data source fires some event(s) when the active row changes, so you could handle that event and then set the ActiveRow in the grid to the appropriate matching row.

    For IsSelected, I imagine it would be more appropriate to use a CheckBox column in the grid rather than tie it to the grid's row selection functionality.