RadGridView SelectedItem does not update correctly

4 posts, 0 answers
  1. Jerry
    Jerry avatar
    10 posts
    Member since:
    Mar 2013

    Posted 27 Oct 2014 Link to this post

    I'm using the RadGridView control to display an Observable collection. I also use SelectedItem="{Binding Model.CurrentRow, Mode=TwoWay}" to track which item in the list the grid pointer is on.

    The first column in the grid has a textbox so the user can change the value in the grid. I subscribe to a property change event to validate the content in the textbox.

    The other columns in the grid are not editable.

    The problem:
    When I click on any non-editable column in the grid, the grid Row highlights correctly and the "Model.CurrentRow" updates correctly. However, when I click on a textbox in the first column on a non selected row, that row does NOT receive focus. The grid row focus stays on the prevously selected row, and the "Model.CurrentRow" does not update.

    How can I make the grid row focus on the selected row when i click on an editable textbox in the grid?

    My partial RadGridView xaml:

                    ItemsSource="{Binding Model.MyList}"
                    SelectedItem="{Binding Model.CurrentRow, Mode=TwoWay}">


        Header="Company Name"
       Width="200" >
           <TextBox Text="{Binding CompanyName, Mode=TwoWay}"/>

                            DataMemberBinding="{Binding CustomerType}"
                            Header="Customer Type"

  2. Boris
    Boris avatar
    276 posts

    Posted 29 Oct 2014 Link to this post

    Hi Jerry,

    Generally RadGridView supports selection out-of-the-box. However, in your case, you want to perform this action using a control placed in CellTemplate of the column(the TextBox).  If you click on the cell which contains the control, you will actually click in the TextBox instead of GridViewRow/GridViewCell, so RadGridView's selection logic will not work. 

    For more information about CellTemplate / CellEditTemplate you can check the Setting CellTemplate and CellEditTemplate documentation article.

    I hope this helps.

    Boris Penev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Rajendra
    Rajendra avatar
    1 posts
    Member since:
    Mar 2017

    Posted 25 Oct 2017 in reply to Boris Link to this post

    Im facing issues while selecting multiple items in RadGridView using Select() method provided by RadGridView itself. Sometimes SelectedItems are shown properly but sometimes it does not show SelectedItems correctly even when I am passing correct arguments to Select() method. Could you please guide us on what could be the issue?
  4. Stefan
    Stefan avatar
    878 posts

    Posted 30 Oct 2017 Link to this post

    Hi Rajendra,

    With the provided information I can only be guessing what the cause for such behavior is. Can you please demonstrate how exactly are you performing the selection of the control, so I can assist you further?

    Thanks in advance for your cooperation.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top