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
5549
Multi select rows by code
posted

hi , i want to select each row in my wingrid.

i try it with

   For Each selectedRow As UltraGridRow In Grid_Anlagen1.Rows
          
                        selectedRow.Selected = True
    Next

but it would be always select one row (of 200)

 

Parents
  • 1210
    Offline posted

    The SelectTypeRow is most likely set to Single. Change it to Extended:

    grd.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Extended

    You can do above in the designer, e.g. via Feature Picker -> Selection -> Row Selection

    In code, good place for it is in InitializeLayout:
    e.Layout.Override.SelectTypeRow = UltraWinGrid.SelectType.Extended


    Your row selection code will then work, but you can also accomplish the same thing with one line of code, like this:

    grd.Selected.Rows.AddRange(grd.Rows.All)


    Trausti

Reply Children