This is a migrated thread and some comments may be shown as answers.

GridView Column with Multiple Control Types?

4 Answers 91 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Daryl
Top achievements
Rank 1
Daryl asked on 18 May 2012, 03:29 PM
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

4 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 18 May 2012, 03:39 PM
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
0
Daryl
Top achievements
Rank 1
answered on 18 May 2012, 03:53 PM
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!
0
Accepted
Stefan
Telerik team
answered on 19 May 2012, 10:50 AM
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 >>
0
Daryl
Top achievements
Rank 1
answered on 21 May 2012, 05:02 PM
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.
Tags
GridView
Asked by
Daryl
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Daryl
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or