0

Hi,
I generated columns from database and getting cell values from database too. my problem is that for some columns I have to generate checkbox in each cell at runtime.
I m using visual studio 2010.
Please Help

Thanks

3
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by Patel Pritesh
0

This will generate a checkbox column in your datagridview:

Dim chkBoxCol As New DataGridViewCheckBoxColumn
        DataGridView1.Columns.Add(chkBoxCol)

Is this what was required ??
then by looping through all the checkboxes you can set value(s) accordingly.

0

'Below code will create checkbox column at last in datagrid with heading "Mark"

With datagridview_name

            Dim col As New DataGridViewCheckBoxColumn
            col.Name = "Mark"
            col.HeaderText = "Mark"
            col.TrueValue = 1
            col.FalseValue = 0
            col.FlatStyle = FlatStyle.Popup
            col.ReadOnly = False
            .ReadOnly = False
            .Columns.Insert(.Columns.Count - 1, col)

End With

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.