Hi Friends,
I am designing one application. In which I have to add a Check box into the Datagrid. I have tried different techniques but didn't helpful.
Please let me know How can I add Check box in a Datagrid?
I am waiting for your reply..
Hi Friends,
I am designing one application. In which I have to add a Check box into the Datagrid. I have tried different techniques but didn't helpful.
Please let me know How can I add Check box in a Datagrid?
I am waiting for your reply..
Hi,
Use the below code to add Check box in the datagrid:
Code:
DGTableStyle tstyle = new DGTableStyle();
discontinuedCol.MappingName = "chckbox";
DGBoolColumn chckboxCol=new DGBoolColumn();
discontinuedCol.HeaderText = " ";
chkboxCol.AllowNull = false;
discontinuedCol.Width = 40;
tstyle .GridColumnStyles.add(chckboxCol);
Hi friend,
Hi friend,
First you will need to include "Item Template" in the Datagrid of your application. Then only you are able to include Check box within the "Item Template". I did same thing which is as follows:
Dim str1 as string =" "
dim it as datagriditem
dim ch as checkbox
for each item in datagd1.items
ch=cTp(it.fndcontrol("ch"),checkbox)
if ch.checked=True then
str1=str1 & " , " & it.cells(2).text
end if
next
Response.write(str1)
Hi,
Please follow below instruction to add add Check box in a Datagrid:
*. First create application using In Visual Studio as:
Open Menu File then select project option then choose C sharp and finally click on Windows Form Application.
*. After this process include "DataGridView" option from toolbox of Visual Studio. Then you have to add button for testing the value of Check Box from DatGridView.
Bookmarks