Hide/Show column in edit mode depending on value of other column

4 posts, 0 answers
  1. Peter
    Peter avatar
    2 posts
    Member since:
    Mar 2014

    Posted 19 Feb Link to this post

    Hi 

    I have a grid with several GridDropDownColumn. 
    I want to be able to show/hide of few of these GridDropDownColumn depending on what is selected in on of the other GridDropDownColumn.

    How can I perform this? Is it possible client side.

    I know how to find a Dropdowncontrol if I use GridTemplateColumn and disable the control but I would prefer the show/hide the entire column

     

  2. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 24 Feb Link to this post

    Hi Peter,

    Some of the columns generate their editing controls automatically, which brings convenience to the developer constructing the grid CRUD system. GridNumericColumn, for example, creates a RadNumericTextBox input control to enable only numeric characters when updating a numeric field. The ID of the automatically generated control starts with the RNTB prefix, which is abbreviation for RadNumericTextBox.
    Copy Code
    var numBox = $telerik.findControl(container, "RNTB_numboxID");

    When Template form is used, however, the ID of any inner control is set manually. And it can be accessed later on using the same ID.

    I suggest that you check the sample provided in the following post:
    http://www.telerik.com/forums/find-control-in-insert-item-grid-client-side#2tgx6AugyU6c562P--mIIg

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter
    Peter avatar
    2 posts
    Member since:
    Mar 2014

    Posted 01 Mar in reply to Eyup Link to this post

    I can get the control by ID, but it is possible to get row in the editform that contains the control and hide the entire row or get the label/header control and hide that as well
  5. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 04 Mar Link to this post

    Hi Peter,

    Generally, you can use the someTelerikControl.get_parent() method to access the container grid item. It may require that you generate the items objects beforehand using grid.get_masterTableView().get_dataItems().

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top