Adding extra columns programmatically when using automatic columns

3 posts, 0 answers
  1. EmpowerIT
    EmpowerIT avatar
    117 posts
    Member since:
    Jun 2007

    Posted 31 Jan 2008 Link to this post

    Is it possible to add additional columns to the rad grid if the grid columns are being built automatically (by setting the property AutoGenerateColumns)?

    I have a dynamic grid which in most cases it is fine to leave the automatically generated columns, however in some instances, I want to hide an automatically generated column and replace it with a drop down column for example (this column should function correctly in edit mode as well)

    What is the best approach? Should I just add a drop downlist control to the cell of the particular column? Or should i create a whole new column?
  2. Vlad
    Vlad avatar
    11100 posts

    Posted 01 Feb 2008 Link to this post

    Hello EmpowerIT,

    If you want to work with automatic updates you can use ColumnCreated event to set desired column Visible property to false and add desired column to the grid using this approach:

    Other possible solution is to add GridTemplateColumn with two-way data-binding. More info can be found here:

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. EmpowerIT
    EmpowerIT avatar
    117 posts
    Member since:
    Jun 2007

    Posted 04 Feb 2008 Link to this post

    Hi Vlad,
    Thanks for the reply. I ended up just catching the ItemCreated event and adding my controls to the controls collection of the required column. Seemed to be a lot easier than actually creating a whole new column

Back to Top