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

Combo Box Column Custom Items

3 Answers 245 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alex Rogers
Top achievements
Rank 1
Alex Rogers asked on 24 Nov 2009, 09:36 PM
Hello
 
I am trying to do something similar to this post http://www.telerik.com/community/forums/winforms/gridview/adding-items-to-a-combobox-column.aspx which is basically trying to bind different data to each new row in a comboboxcolumn inside a radgrid. 

I would like to be able to add my own items in the combobox inside each row without binding them to a dataset.  
combobox.items.add(item) basically.   I downloaded the sample app that was included with the post but it is an older version and C# so I can't quite get the coding figured out ( I am using Q2 2009 SP1 in VB .net).

I am also planning on using other columns and setting my own values but the combobox seems to be the most difficult.

Also, when the combobox selection is changed, will I be able to trap that and perform some operation?

Thanks

Alex

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 30 Nov 2009, 02:20 PM

Hello Alex Rogers,

Thank you for the questions.

You can insert RadComboBoxItems directly in the RadComboBoxEditorElement. This will allow you to use the editor without binding the GridViewComboBoxColumn to a datasource. I am attaching a sample project which demonstrates this approach.

As to selection events, you can subscribe to the SelectedIndexChanged event in the CellEditorInitialied event handler of RadGridView. This approach is demonstrated in the sample project as well.

Generally, when you want to convert a code snippet/project from C# to VB.NET (and vise versa), you can use our Code Changer on-line tool at www.codechanger.com.

I hope this helps. If you have additional information, do not hesitate to contact me.

Regards,

Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Alex Rogers
Top achievements
Rank 1
answered on 30 Nov 2009, 04:53 PM
Thanks

Is there a way to do this:

1. Create new row for RadGrid
2. Create new columns for RadGridRow (ex: checkbox,text,combobox)
3. Fill in the information for each of the columns (selected or not selected, text value, comboboxitems)
4. Add the new row to an existing RadGrid
5. Repeat until all rows have been created.

The columns would always be in the same order and the grid could be created ahead of time. Users would not be adding new rows themselves, the rows would be added based off of information from a DB.
0
Nikolay
Telerik team
answered on 03 Dec 2009, 05:06 PM
Hi Alex Rogers,

I am not quite sure that I completely understand your scenario. However, all the separate operations that you want to perform are possible in RadGridView. You can refer to the follwowing help articles:
Adding and Inserting Rows
Columns
Databinding RadGridView

In addition,, you can take a look at our Examples demo application, section GridView. There are many examples which demonstrates particular features of the RadGridView control.

I hope this helps. If there is something specific in your case that I did not understood, please describe in more details what is your scenario. This will allow me to help you further.

Regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Alex Rogers
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Alex Rogers
Top achievements
Rank 1
Share this question
or