how to make a button on a datagrid cell...
-
please give me some code or sample on how to make a button on a datagrid cell. thnx!
-
please give me some code or sample on how to make a button on a datagrid cell. thnx!
hi, you can make a button on datagridview very easily at desigen time. when you add a column to datagridview , change its type to DatagridViewButtonColumn. if you want to add column at run time then use following code
Dim ColumnButton As New DataGridViewButtonColumn columnButton.headertext="Your Heading" DataGridView1.Columns.Add(columnButton)
Hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India)
-
hi, you can make a button on datagridview very easily at desigen time. when you add a column to datagridview , change its type to DatagridViewButtonColumn. if you want to add column at run time then use following code
Dim ColumnButton As New DataGridViewButtonColumn columnButton.headertext="Your Heading" DataGridView1.Columns.Add(columnButton)
Hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India)
i want to know both ways... can you please tell me how could i be able to do that on design time? thank you so much!
-
i want to know both ways... can you please tell me how could i be able to do that on design time? thank you so much!
after adding buttonTypecolumn to datagridview ,perform following action suppose index of buttonTypeColumn is 5 (whether you add column at design time or run time)
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick If e.ColumnIndex = 5 Then msgbox "Button Type column of Datagridview is clicked" endif end sub
hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India)
-
hi, you can make a button on datagridview very easily at desigen time. when you add a column to datagridview , change its type to DatagridViewButtonColumn. if you want to add column at run time then use following code
Dim ColumnButton As New DataGridViewButtonColumn columnButton.headertext="Your Heading" DataGridView1.Columns.Add(columnButton)
Hope this helpsRupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India)
i am using a plain datagrid... and the code is not effective... Dim ColumnButton As New DataGridViewButtonColumn -- generate an error ive already change it to Dim ColumnButton As New DataGridButtonColumn but its still not working...
-
i am using a plain datagrid... and the code is not effective... Dim ColumnButton As New DataGridViewButtonColumn -- generate an error ive already change it to Dim ColumnButton As New DataGridButtonColumn but its still not working...
hello cutequencher, sorry for misunderstanding. This code is for datagridview i have no idea about DataGrid. so wait reply from others
Rupesh Kumar Swami Software Engineer, Integrated Solution, Bikaner (India)