Please help me how to create a simple RadioButton Column in DataGridView.
-
I want to use RadioButton in DataGridView but I do not how to do that. I just need a very simple Class for getting/setting its Checked state true/false. That is all I need for this control. Please help me to that. It is urgent Thanks in advance Best Regards, pvphuc
-
I want to use RadioButton in DataGridView but I do not how to do that. I just need a very simple Class for getting/setting its Checked state true/false. That is all I need for this control. Please help me to that. It is urgent Thanks in advance Best Regards, pvphuc
According to your question, I hope this article willl help: Build a Custom RadioButton Cell and Column for the DataGridView Control. You can also download the code samples for the project. Windows Forms 2.0 offers several cell and column types for its DataGridView control. For example, the product ships with a text-box–based cell and column (DataGridViewTextBoxCell/DataGridViewTextBoxColumn) and a check-box–based duo (DataGridViewCheckBoxCell/DataGridViewCheckBoxColumn) among others. Even though the product comes with a rich set of cell and column types, some developers may want to create their own cell and column types to extend the functionality of the grid. Thankfully the DataGridView control architecture is extensible enough that such custom cells and columns can be built and used in the grid. This document explains how to create and use a cell and column that easily let the user pick an entry among multiple choices. http://msdn2.microsoft.com/en-us/library/aa730882(vs.80).aspx
SSK.
-
According to your question, I hope this article willl help: Build a Custom RadioButton Cell and Column for the DataGridView Control. You can also download the code samples for the project. Windows Forms 2.0 offers several cell and column types for its DataGridView control. For example, the product ships with a text-box–based cell and column (DataGridViewTextBoxCell/DataGridViewTextBoxColumn) and a check-box–based duo (DataGridViewCheckBoxCell/DataGridViewCheckBoxColumn) among others. Even though the product comes with a rich set of cell and column types, some developers may want to create their own cell and column types to extend the functionality of the grid. Thankfully the DataGridView control architecture is extensible enough that such custom cells and columns can be built and used in the grid. This document explains how to create and use a cell and column that easily let the user pick an entry among multiple choices. http://msdn2.microsoft.com/en-us/library/aa730882(vs.80).aspx
SSK.
-
Thanks Vri SSK I have read that article but it is so complex. I just need a very simple class for my work. It is always display on the cell and user can check it. Could you give me another solution. Thanks so much pvphuc
That sample is about as simple as it gets for what you said you want to do. There is no "very simple" way to do this.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Thanks Vri SSK I have read that article but it is so complex. I just need a very simple class for my work. It is always display on the cell and user can check it. Could you give me another solution. Thanks so much pvphuc
The simple way is that, but is not a proper way u can add the asp.net label control in the gridview column and in the event of databinding of gridview u can write html (
-
The simple way is that, but is not a proper way u can add the asp.net label control in the gridview column and in the event of databinding of gridview u can write html (