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

GridView doesn't display data when its cell has combo box

1 Answer 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Doraemon
Top achievements
Rank 1
Doraemon asked on 21 Apr 2014, 10:39 AM
Hi,

I try to follow the following link to insert a combo box into my gridview.
http://www.telerik.com/help/winforms/gridview-columns-gridviewcomboboxcolumn.html

However, When I copy and paste code of "Binding to collection of custom object", my gridview doesn't display it data (see my attachment). when I click on second cell, it can display its combo box. When I select a  value in combo box, it seems the grid doesn't update value.

I want the following requirement.

I have a class. for example:
class  A {
Id,
Field1,
Field2
}

I want to display list of A into my grid.
Column 1 is Id of a A
Column 2 is a Combo box, it gets data from BB. when user selects a value of its combo box, the value will be set to Field2
Column 3 is a Combo box, it gets data from CC. when user selects a value of its combo box. the value will be set to Field3
Column 4 is a button. The button is displayed as an image. When user clicks on it, the current row will be deleted.

Can you instruct me ? I'm quite new with telerik control. Nice day.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 21 Apr 2014, 12:38 PM
Hello James,

Thank you for contacting us.

I have created and attached the sample from the article. It has two GridViewComboBoxColumn columns, the first is bound to a string array and the second to custom object. Also I have added a GridViewCommandColumn which displays buttons. In this case the CommandCellClick event can be used to delete the clicked row. The Image property of the column can be used to set the image for the buttons.

I hope this will be useful. Should you have further questions, I would be glad to help.
 
Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Doraemon
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or