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
130
Ultra Grid Selected Row Problem
posted

Hello,

I am having a problem with identifying the currently selected row in an ultragrid. Using VB, my grid is bound to datasource X and I am trying to retrieve the currently selected item in the grid upon a button press event on the form by:

Dim x As X= DirectCast(XBindingSource.Current, X)

The problem is that XBindingSource.Current is always nothing, and thus x is always nothing despite there being items in the grid and with one of the rows selected.

Does anyone have any ideas why the 'current' property is nothing?

NB: This grid is editable, and I have set the 'CellClickAction' property to be 'EditAndSelectText' - could this be part of the problem?

 

Parents
No Data
Reply
  • 990
    Verified Answer
    posted

    Hi,

    To identify the currently selected row(s) in the grid use the UltraGrid.Selected.Rows collection. If you have enabled UltraGrid.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Extended then there can be more than one item in the collection.

    To get to the underlying bound data from there you can use the ListObject property of the row.

    Andy.

     

Children