c# 4.0 - How to Generate CheckBoxes checked inside a DataGridView dynamically in C#? -
is a datagrid view that contains a checkbox column. I am generating other columns of DataGridView from a table. It's working fine, but now I'm trying to check some checkboxes using this code, but it's not working. Code
String Query = "Group_Info" with information as "SELECT ID, Group_Name +" + Phone_No "; GenerateGridView (dataGridView1, query); Datatable DT = GetTableData ("Select tbl generates group_ID"); Forwarding (Datarao RW in DT.RO) {foreach (DataGridViewRow line in DataGrid View 1.Rao) {DataGridWebCox Box CK = (Datagreat View Markbook Call) (Line Seals [0]. Value); If (convert .toiun 32 (line seals [1]. Value) == convert to iTINT 32 (RW ["GROUP_ID"]) {chk.Value = chk.TrueValue; }}} How can we do this?
May try this:
DataGridViewCheckBoxColumn chk = New DataGridViewCheckBoxColumn (); dataGridView1.Columns.Add (mortgage); Chk.HeaderText = "Check Data"; Chk.Name = "chk"; DataGridView1.Rows [2] .cel [3] .Value = true;
Comments
Post a Comment