UI Controls in Windows DataGrid
-
Hi All, I want to create a datagrid with 4 columns. The third column should have a combo box and the last column should have a checkbox. Its easy to get the checkbox column but how can I create a combo box column. The combo box should be visible always not only when it is selected. Can any one tell me, how do I place combo box for each cell in third column of a windows datagrid contorl? Any help is appriciated. Thanks in advance.:) Regards Kais
-
Hi All, I want to create a datagrid with 4 columns. The third column should have a combo box and the last column should have a checkbox. Its easy to get the checkbox column but how can I create a combo box column. The combo box should be visible always not only when it is selected. Can any one tell me, how do I place combo box for each cell in third column of a windows datagrid contorl? Any help is appriciated. Thanks in advance.:) Regards Kais
This is answer is without having VS in front of me and I didn't program ASP.net for some months so my memory of the terminology is a bit rusty. Turn your datagrid column into
<asp:templatecolumn>
, then add an<itemtemplate></itemtemplate>
within the itemtemplate you can add your<ASP:DropDownList>
, make sure to add the right events to the dropdownlist. If you want to fill the dropdownlist on runtime, you have to hook up to the itemdatabind (or something like that) event, there every row of the datagrid is being filled. -- modified at 8:44 Wednesday 21st June, 2006 -
This is answer is without having VS in front of me and I didn't program ASP.net for some months so my memory of the terminology is a bit rusty. Turn your datagrid column into
<asp:templatecolumn>
, then add an<itemtemplate></itemtemplate>
within the itemtemplate you can add your<ASP:DropDownList>
, make sure to add the right events to the dropdownlist. If you want to fill the dropdownlist on runtime, you have to hook up to the itemdatabind (or something like that) event, there every row of the datagrid is being filled. -- modified at 8:44 Wednesday 21st June, 2006 -
Thanks for that suggestion. It works for ASP.NET. Am developing a windows application and using DataGrid available for winforms. Is there a why how to do it in winform datagrid control?? Regards Kais
I overlooked the "windows" part in the title. There is a way, but since I don't have VS in front of me, its kind of hard for me to help you. I believe there is already a .NET object made by somebody that does this. I would use reflector and check how the other columns (checkbox, textbox etc) are made, and then in the same way create a dropdownlist column.
-
Hi All, I want to create a datagrid with 4 columns. The third column should have a combo box and the last column should have a checkbox. Its easy to get the checkbox column but how can I create a combo box column. The combo box should be visible always not only when it is selected. Can any one tell me, how do I place combo box for each cell in third column of a windows datagrid contorl? Any help is appriciated. Thanks in advance.:) Regards Kais
Searching for DataGrid ComboBox[^] gives several results. I think one of those should match your needs.