Editing only a few columns in RadGrid

3 posts, 0 answers
  1. Katarina
    Katarina avatar
    17 posts
    Member since:
    Apr 2008

    Posted 27 Mar 2009 Link to this post

    I want only some of columns to be editable in my RadGrid. I have GridEditCommandColumn, GridBoundColumns (for them I dont want to be editable) and GridTemplateColumns (they need to be editable). Is that possible and how?
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 27 Mar 2009 Link to this post

    For columns that you do not want to be editable, simply set the ReadOnly property on the columns to True. This will prevent them from going in to "edit mode" when a row is edited in your grid.

    Hope that help!
  3. DevCraft R3 2016 release webinar banner
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Mar 2009 Link to this post

    Hi Katarina,

    You may also try the following code snippet to prevent editing for the GridBoundColumn in code behind.

    protected void RadGrid1_PreRender(object sender, EventArgs e) 
            foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns) 
                if (col.ColumnType == "GridBoundColumn"
                    GridBoundColumn boundCol = (GridBoundColumn)col; 
                     boundCol.ReadOnly = true

Back to Top