This is a migrated thread and some comments may be shown as answers.

Programmatically Select and Move Rows to the Top

2 Answers 487 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Robert LeGood
Top achievements
Rank 1
Robert LeGood asked on 11 Mar 2013, 09:05 PM
Hi all,

Just wondering if there was to programmatically select specific rows (that meet a criteria, for example), and then move those rows to the top of the grid.

Specifically, I'm looking for a way to do this with a bound list.

This thread was the closet I was able to find on the issue..  http://www.telerik.com/community/forums/winforms/gridview/is-it-possible-the-reorder-the-rows-in-radgridview.aspx

2 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 14 Mar 2013, 02:27 PM
Hi Robert,

It is not possible to reorder rows in bound mode. Nevertheless, you can use the sorting capabilities of
RadGridView to achieve the desired behavior. You should read more about sorting here. In your case, you can create an invisible column which will represent the index of each row. Then you can sort by it. Finally, you can change the value of specific row for this column in the following manner:
this.radGridView1.ChildRows[0].Cells["IndexColumn"].Value = 5;

Note that you should use the ChildRows collection instead of the Rows collection, since it contains the rows in the order produced by a data operation(s) (filtering, sorting, grouping).

Greetings,
Svett
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
jamsheer
Top achievements
Rank 1
Veteran
answered on 11 Dec 2017, 11:29 AM

Hi all,

       How to move RdaGridView selected row Up/Down when keyup or keydown press.

  1.  The user selects one row
  2.  There will be up arrow and down arrow.
  3.  If the user wants to move up, the user clicks up arrow button
  4.  If the user wants to move down, then the user clicks down arrow button
  5.  If the row is at the top then up arrow button becomes disabled
  6.  If the row is at the bottom then down arrow button becomes disabled

Hope you got my question

Jamsheer

 

Tags
GridView
Asked by
Robert LeGood
Top achievements
Rank 1
Answers by
Svett
Telerik team
jamsheer
Top achievements
Rank 1
Veteran
Share this question
or