Skip to content

Select Multiple Rows in Ultragrid

New Discussion
Colm
Colm asked on Feb 21, 2013 8:58 AM

Hi

 I have a grid which I need to select multiple rows and process the contents of each rows cells

I have tried looping through the rows in the grid and checking the grid.Rows(i).Activated = true

but this only returns the first Active row in the grid.

Is there another property which distinguishes selected rows from non selected rows ??

Is there a difference between active and selected rows

Thanks

Colm

Sign In to post a reply

Replies

  • 0
    Amiram Korach
    Amiram Korach answered on Jan 13, 2009 12:31 PM

    Each row has a property named "Selected".

    Active row is the row that has the input focus, hence there is only one active row. Selected row is a row that was selected by the user or by code and there could be more than one.

    If you want to get all selected rows use grid.Selected.Rows

    If you want to select all rows, don't go over them and set Selected = true because this can be very slow, but use grid.Selected.Rows.AddRange(grid.Rows)

    • 0
      Colm
      Colm answered on Jan 13, 2009 1:10 PM

      Thanks for the help

      I just implemented the suggestion for selected rows but when I select several rows the grid.Selected.Rows returns zero rows

      Is there some other property that needs to be set on the grids to allow multiple row selection

       Thanks

      • 0
        Mike Saltzman
        Mike Saltzman answered on Jan 13, 2009 3:43 PM

        If you are seeing selected rows in the grid and grid.Selected.Rows returns no rows, then something is wrong and the rows are not really selected. Are you sure you are looking at the right grid control? Are you sure the rows are actually selected? How are you selecting them? 

      • 0
        Colm
        Colm answered on Jan 13, 2009 6:26 PM

         

        I am using an Infragistics.Win.UltraWinGrid.UltraGrid

        To select the rows I am simply clicking on a row and then using the shift key and the direction arrows to highlight the rows below that row,

        I am looking at the correct grid and using the following code

         

        Dim row As Infragistics.Win.UltraWinGrid.UltraGridRow

        For Each row In grdSage.Selected.Rows

        sSQL =

        "Delete from OverallSageLink where Bankref = '" & grdSage.ActiveRow.Cells(1).Value…………….

         

        The statement grdSage.Selected.Rows is at zero no matter what I select

         

      • 0
        Mike Saltzman
        Mike Saltzman answered on Jan 14, 2009 2:36 PM

        Hi,

        I don't see how that could possibly happen. If it is happening, then it sounds like a very serious bug. But I have not heard any other reports of this. 

        Can you duplicate this in a small sample project? 

      • 0
        Walter Carr
        Walter Carr answered on Jul 15, 2009 4:23 PM

        I'm seeing this same issue in an ultragrid.

      • 0
        Walter Carr
        Walter Carr answered on Jul 15, 2009 4:42 PM

        I figured out that my problem had to do with setting the RowSelectors property to false like so:
        grdCurrent.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;

        Holding the shift key down and clicking the mouse selected multiple cells but it does not select multiple rows. When I set the above property to  Infragistics.Win.DefaultableBoolean.True, the row selector column is displayed and holding down the shift key and clicking the mmouse in the row selectors column will select multiple rows. In summary, setting the RowSelectors property to true and using the row selector column to select multiple rows solved my problem.

      • 0
        Gabriel
        Gabriel answered on Aug 14, 2009 9:04 AM

        Hi,

        I have seen the same thing. We have a made a derived grid from UltraWinGrid 7.3 and when we reload the grid and there is a selected row all the rows after the datasource has been reloaded appears to be selected but the selected.Rows property is empty.

      • 0
        Alexander
        Alexander answered on Dec 21, 2009 12:36 PM

        Hello,

        I have the same Issue by selecting rows from an UltraGrid.

        I tried to implement this example on the following site: How to Drag and Drop Rows in a Grid

        If the DragDrop event is fired, the program get no selected rows. The object of type SelectedRowsCollection has zero values.

        I had opened the UltraWinGrid Designer from the
        grid's smart tag and selected the "Feature Picker" and used the
        "Selection" node.

        I use VS2008 and Infragistic 9.2. I spent much time get the issue solved, but I see no solution.

      • 0
        Chethan Shetty
        Chethan Shetty answered on Jun 24, 2010 6:06 PM

        May be you have set the (UltraGrid Object).DisplayLayout.Override.SelectTypeRow property to select single row only.

        Have a look at the options this provides.

        I got my grid to do multiple selection by setting the property to the following value : Infragistics.Win.UltraWinGrid.SelectType.ExtendedAutoDrag

      • 0
        Hiram
        Hiram answered on Jul 14, 2011 3:13 PM

        You need to set the SelectTypeRowDefault property before you select the rows.

        grid.DisplayLayout.SelectTypeRowDefault =

        SelectType.Extended;

        grid.DisplayLayout.Rows[0].Selected = true;

        grid.DisplayLayout.Rows[1].Selected = true;

      • 0
        Naga kalyan P
        Naga kalyan P answered on Feb 21, 2013 8:47 AM

        I wanted to get the rows that are selected and edit the cells only in grid but not entrie grid. Please help me. I am not able to get selected rows, its is displaying is 0

        if

        (BaseGrid.ActiveRow != null)

                    {    

        foreach(UltraGridRow row in BaseGrid.Rows)

                       {

                          

        if (row.Selected)

                           {

                               row.Activation =

        Activation.AllowEdit;

                           }

         

                       }

                    }

    • 0
      Naga kalyan P
      Naga kalyan P answered on Feb 21, 2013 8:48 AM

       wanted to get the rows that are selected and edit the cells only in grid but not entrie grid. Please help me. I am not able to get selected rows, its is displaying is 0

      if

      (BaseGrid.ActiveRow != null)

                  {   

      foreach(UltraGridRow row in BaseGrid.Rows)

                     {

                       

      if (row.Selected)

                         {

                             row.Activation =

      Activation.AllowEdit;

                         }

       

                     }

                  }

      • 0
        [Infragistics] Boris Toromanov
        [Infragistics] Boris Toromanov answered on Feb 21, 2013 8:58 AM

        Hello,

        I am not sure why are you doing this, because I do not know your scenario but it should work. Could you please try to attach if possible a small sample project reproducing the above mentioned issue, I will be happy to take a look at it.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Colm
Favorites
0
Replies
14
Created On
Feb 21, 2013
Last Post
13 years, 1 month ago

Suggested Discussions

Tags

Created by

Created on

Feb 21, 2013 8:58 AM

Last activity on

Feb 16, 2026 9:52 PM