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

Get Filter Rows Q2 2011

2 Answers 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ms
Top achievements
Rank 1
ms asked on 04 Dec 2012, 01:46 PM
Hi 
i update code from to Q2 2011 in old version when i use RadGrirdView and i type in Filter Text 
to get me certain rows as in my attachment ,when use the following code it not get me the result row 

DataRowView m_dgrvCurrent;
 
m_dgrvCurrent = (DataRowView) (radGridViewCountries.DataSource as BindingSource).Current;

Please tell me how i can get the Filter rows not seletedrow 
this code run before fine but here get me a first row in all data not viewed on Grid 

Thank you 
Mahmoud Salem

2 Answers, 1 is accepted

Sort by
0
ms
Top achievements
Rank 1
answered on 05 Dec 2012, 10:26 AM
i can get a Filter Data :

radGridViewCountries.ChildRows;

and i can set it as Current Row 

(radGridViewCountries.DataSource as BindingSource).Position = ((radGridViewCountries.DataSource as BindingSource)).IndexOf(radGridViewCountries.ChildRows[0].DataBoundItem);
0
Plamen
Telerik team
answered on 07 Dec 2012, 10:43 AM
Hello ms,

Thank you for writing.

The filtered, sorted or grouped rows can be found in the ChildRows collection of the desired template. The currently visible rows can be found in radGridView1.TableElement.VisualRows. Please note that the latter collection contains of GridRowElement objects and you need to access their RowInfo property to access the actual data row. So in order to select the first row after the filtering operation, please consider the following code:
radGridView1.ChildRows[0].IsSelected = true;

to make it current:
radGridView1.ChildRows[0].IsCurrent = true;

I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.

Greetings,
Plamen
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
GridView
Asked by
ms
Top achievements
Rank 1
Answers by
ms
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or