More in this section
Forums / General Discussions / Set Column to readonly when in edit mode

Set Column to readonly when in edit mode

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Aret
    Aret avatar
    8 posts
    10 Oct 2011
    11 Oct 2011
    Link to this post
    I am using 'GridTemplateColumns' on my radgrid and I have trouble setting one of my columns to 'readonly' ONLY when its in 'edit mode'.  Does anyone have any suggestions in how to do this programmatically...?
  2. Maria Ilieva
    Maria Ilieva avatar
    1 posts
    07 Oct 2016
    14 Oct 2011
    Link to this post
    Hi Aret,

    Try the following approach:
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        if (e.Item.IsInEditMode && !(e.Item is IGridInsertItem))
            (e.Item as GridEditableItem)["ColumnName"].Enabled = false;

    I hope this helps.

    Best wishes,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
2 posts, 0 answered