hi every one .
does any one know how to insert checkbox in datagrid so user can select row and how to know which rows selected

hi every one .
does any one know how to insert checkbox in datagrid so user can select row and how to know which rows selected

Hi,
I can give you some guides

About how to insert checkbox , I think you have to work with Table Styles property.

About how to know which row selected here you have to take the current data grid index by
DataGrid1.CurrentRowIndex

then you can access any values in the selected row by
DataGrid1.Item(.CurrentRowIndex, 0)

0 is for the first column and 1 for the second ....

Good Luck

Hi,

To insert a checkbox to every row you must add a template column to your data grid.

Loren Soth

i have a problem using datagrid in vb.net.

i want to bound it with database and want to change column length

please tell me about it

i have the same problem, i have check box and when checked i want the complete row to read of checked one.. can anyone help me plzzzzz

i have the same problem, i have check box and when checked i want the complete row to read of checked one.. can anyone help me plzzzzz

you can read by using the datagridview.currentrow.cells[0] ,
datagridview.currentrow.cells[1].value , datagridview.currentrow.cells[2] .value ....

like wise u can read the values of all the columns in the datagridview...

i have a problem using datagrid in vb.net.

i want to bound it with database and want to change column length

please tell me about it

Use the datasource property of the datagridview to bind the database with the datagridview....

You can change the column length by

datagridview.columns(0).width = length

eg.

datagridview1.columns(0).width = 200

Likewise you can change the width of the datagridview....

You can also use the datagridview autoresizecolumns method to resize the columns automatically...

Thanks....

Apr 17th, 2006 > this thread brings memory when I was doing my project :(

however, it is better to open new thread with title that describe your problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.