GridView Column with Multiple Control Types?

5 posts, 1 answers
  1. Daryl
    Daryl avatar
    3 posts
    Member since:
    May 2012

    Posted 18 May 2012 Link to this post

    Hello,

    I am currently researching possibilities for using multiple control types in a single GridViewDataColumn.  Namely, we need to be able to use RadComboBox and RadTextBox interchangeably in a single column.

    I would just like to know if Telerik has encountered this question before, and if there are any reasons why this wouldn't be possible.  If so, how might you suggest a "best practice" for going about this.  I certainly have found very little -- if any -- scenarios of others needing this functionality.

    I appreciate any advice that can be offered.

    Best Regards,

    Daryl
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 18 May 2012 Link to this post

    Hi Daryl, 

    This is certainly possible. You'll need to create a custom cell to do this. Have a look at the help topic at this link. You'll see that the last section adds a RadProgressBarElement and a RadButtonElement into the one cell. 

    Hope this helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Daryl
    Daryl avatar
    3 posts
    Member since:
    May 2012

    Posted 18 May 2012 Link to this post

    Thanks for the quick response!

    This looks like it will lead me in the right direction.  I still will need to find a way to initialize each custom cell as RadTextBox OR RadComboBox, but I think I'll be able to figure that out once I get there.  I will post a follow-up with my results.  Thanks again!
  5. Answer
    Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 19 May 2012 Link to this post

    Hello guys,

    @Daril - if you want to use them interchangeably - once to have a text box and once a combo - you might not need a custom cell. You can just change the editor type.

    Attached you can find a sample application which will open one editor for even rows and another for the odd ones.

    Let me know how this works for you.
      
    Kind regards,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  6. Daryl
    Daryl avatar
    3 posts
    Member since:
    May 2012

    Posted 21 May 2012 Link to this post

    While I marked Stefan's answer as correct, I am actually having to continue using Richard Slade's suggestion to implement my solution.  The reason being is that we are not using the RadGridView in the traditional sense of a "grid".  We have all different kinds of data being used on rows and columns, with entirely different datasources being used.  Changing the editor, while it appearing to work in my scenario, actually starts having problems after I start selecting values.  Due to this, I am forced to manually handle the controls underneath.  I also marked Stefan's response as the answer, because for most people running into a question similar to mine, his response should help.  Either way, thank you both for your responses.
Back to Top
UI for WinForms is Visual Studio 2017 Ready