Programatically bringing a telerik radgridview into view and make the first cell editable

2 posts, 0 answers
  1. Sabuj
    Sabuj avatar
    8 posts
    Member since:
    Jan 2012

    Posted 12 Apr 2012 Link to this post

    I would like to bring a row of my RadGridView into view programatically. I have a more than 100 rows. When I create a row(which I am doing by adding an item to a observable collection) I would like that new row to be selected and bring that into view. I was able to select the new row in my code but could not do the scrolling. More over I want the first cell of the row to be in edit mode so that the user can input text. I am following MVVM pattern for the application and would like to keep zero code in my views. How Can I achieve this?

    Any help or suggestion will be appreciated....

    Here is some of my code


    <telerik:RadGridView ItemsSource="{Binding AllPartClasses}" 
    SelectedItem="{Binding SelectedPartClassViewModel, Mode=TwoWay}"        
    SelectionMode="Single" IsSynchronizedWithCurrentItem="True">

    in my view model I did this

    void AddNewPartClassExecute()
            PartClass newPartClass = new PartClass();
            PartClassViewModel tempPartClass = new PartClassViewModel(newPartClass);
            tempPartClass.IsInValid = true;
            SelectedPartClassViewModel = tempPartClass;

    public PartClassViewModel SelectedPartClassViewModel
                return _selectedPartClassViewModel;
                _selectedPartClassViewModel = value;

  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 16 Apr 2012 Link to this post


     Please take a look at this forum thread on how to scroll to the newly added row. Then to put the first cell into edit mode, you will need to call the BeginEdit() method of the GridViewRow.

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top