Get Filter Rows Q2 2011

3 posts, 0 answers
  1. ms
    ms avatar
    8 posts
    Member since:
    Oct 2012

    Posted 04 Dec 2012 Link to this post

    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. ms
    ms avatar
    8 posts
    Member since:
    Oct 2012

    Posted 05 Dec 2012 Link to this post

    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);
  3. Plamen
    Admin
    Plamen avatar
    132 posts

    Posted 07 Dec 2012 Link to this post

    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.
Back to Top