By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,537 Members | 895 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,537 IT Pros & Developers. It's quick & easy.

Command button in datagrid

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Ahsan wrote:
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


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #2

P: n/a
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_LinkLabelColumnCl ick
(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
"Ahsan" <ah********@hotmail.com> wrote in message
news:05****************************@phx.gbl...
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

Nov 20 '05 #3

P: n/a
* "Ahsan" <ah********@hotmail.com> scripsit:
I am using datagrid with SQl server
I wonder if its possible to create a command button on
each row of the grid.


<http://www.i-syn.gmxhome.de/devcom/colstyles/controlbutton.htm>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.