Disabling/hiding column editor depending on value in another column

Thread is closed for posting
1 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 16 Mar 2006 Link to this post



    RadGrid for ASP .NET version

    RadControls for ASP .NET AJAX version

    3.0.3 and later

    2008.1.415 and later

    .NET version

    1.x (RadGrid for ASP .NET)

    2.0 and later (RadControls for ASP .NET AJAX)

    Visual Studio version

    2002/2003 (RadGrid for ASP .NET)

    2005 and later(RadControls for ASP .NET AJAX)

    Programming language


    Browser support

    all supported by RadGrid for ASP .NET

    all browsers supported by RadControls for ASP .NET AJAX

    Here are the steps you need to undertake to disable the editor for a certain field when some custom conditions are met:

    1. subscribe to the ItemDataBound handler of the grid
    2. check whether the currently bound item is in edit mode
    3. retrieve the value for the edited field which will be used as a flag for enabling/disabling the column editor
    4. if the value matches the condition, disable the editor field (you can get reference to it through the auto-generated column editor)

    In the example we are enclosing, the editor for the ContactTitle will be disabled when you edit the first grid row. Note that you can hide completely the editor when setting its Visible property to false.

Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.