RadGridView disable updating rows

4 posts, 0 answers
  1. Matt
    Matt avatar
    3 posts
    Member since:
    Oct 2011

    Posted 18 Oct 2011 Link to this post

    Hello,

        I have a RadGridView bound to a collection and i'd like to disable updating of existing rows.  I still need to be able to use the insert functionality of the grid to add new rows, but I do not want rows in the grid to be updated.  Is this possible?

    Using Silverlight, latest Telerik tools

    Thanks!
  2. Matt
    Matt avatar
    3 posts
    Member since:
    Oct 2011

    Posted 18 Oct 2011 Link to this post

    Best way I could find to do this was to check and see if the database created identity key was filled in

     

     

    if ((e.Row.DataContext as DataBoundObject).ID > 0)
    {
        e.Cancel = true;
    }

  3. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 19 Oct 2011 Link to this post

    Hello Matt,

    Would you take a look at this forum thread ? Will the approach suggested there correspond to your needs ?
     

    Kind regards,
    Maya
    the Telerik team

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

  4. Matt
    Matt avatar
    3 posts
    Member since:
    Oct 2011

    Posted 19 Oct 2011 Link to this post

    Thank you, that was very helpful!

    I only ran into an issue when attempting to use the same code on a gridview in the details of my main gridview, so I came up with the following which works in both

    if ((sender as Telerik.Windows.Controls.RadGridView).Items.CurrentAddItem != e.Row.Item)
    {
        e.Cancel = true;
    }

Back to Top