We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Range Count

Hai , I am using GDBG and a context menu associated with it and has one column,I want to get the numbers of rows selected wwhen I perform the following steps . 1.Click on second row 2.Click on the 8 th row by pressing Shift ,i.e., Shift+Click Now how can I get the no: of rows selected . Thanks and Regards,

3 Replies

AD Administrator Syncfusion Team September 9, 2004 05:13 AM UTC

You can get the GridRangeInfoList of selected row ranges using grid.Selections.GetSelectedRows. From there you can get the active range, and retrieve its height. GridRangeInfo range = this.gridDataBoundGrid1.Selections.GetSelectedRows(true, false).ActiveRange; if(!range.IsEmpty) { Console.WriteLine("height: {0}", range.Height); }


AR arvind September 13, 2004 02:39 AM UTC

Hai,I think U did''t get my problem .the piece of code sent me will work if he selects from the row numbers but if the user selects within the cell then the range count will be 0. Please do the following steps to find out my pro. 1.Click on one cell. 2.SHIFT+Click on other cell after some rows in the same column . 3.we will get some rows selected rows. 4.Now I want the number of rows selected. >You can get the GridRangeInfoList of selected row ranges using grid.Selections.GetSelectedRows. From there you can get the active range, and retrieve its height. > > >GridRangeInfo range = this.gridDataBoundGrid1.Selections.GetSelectedRows(true, false).ActiveRange; >if(!range.IsEmpty) >{ > Console.WriteLine("height: {0}", range.Height); >} >


AD Administrator Syncfusion Team September 13, 2004 04:54 AM UTC

Here is a KB that explains how you can retrieve arbitrary selections. http://www.syncfusion.com/Support/article.aspx?id=564 If you have a single range of cells selected, you can get its height using int height = this.grid.Selections.Ranges.ActiveRange.Height;

Loader.
Live Chat Icon For mobile
Up arrow icon