Command button in datagrid

  • Thread starter Thread starter Ahsan
  • Start date Start date
A

Ahsan

Hi there

I am using datagrid with SQl server
I wonder if its possible to create a command button on
each row of the grid.

Actually I want to open a new form on every button click
with differnt values.

Thanks in advance.
ason
 
You can use the Controls.Add( Control ) Method to add controls to the
datagrid and then position them above specific cells.You need to set the
size and width of those buttons though.

Dim ButtonA As New Button
DataGrid.Controls.Add( ButtonA )


Regards - OHM
 
You can use the ExtendedDataGrid
http://dotnet.leadit.be/extendeddatagrid
Using the ExtendedDataGridLinkLabelColumn you can have a LinkLabel inside a
cell. You can use this when you want to be able to react for example to a
mouse click on a cell. The sample below shows how the Column can be used to
show data in a MessageBox when the user clicks on the cell.

private void extendedDataGridLinkLabelColumn1_LinkLabelColumnClick
(object sender, Leadit.ExtendedDataGrid.LinkLabelColumnEventArgs e)
{
MessageBox.Show(((Customer)e.RowValue).Comments);
}

Use the LinkLabelText to control the caption that the LinkLabel shows in the
cell. If you leave this property empty, the LinkLabel will show the real
value of the corresponding cell.


--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
Back
Top