473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Command button in datagrid

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
3 3528
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
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
* "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: NETDeveloper | last post by:
Hi, I almost have my nested datagrid working properly. I created a datagrid on a user control and dropped that onto another datagrid. At first, I noticed when I was stepping through the code,...
0
by: Steve Bishop | last post by:
I have a form with a search text box and a grid that displays the results. Within the grid, I have edit command links set up to response.redirect to another page that puts the DataKey value in the...
0
by: Shane O. Pinnell | last post by:
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a datagrid populated from a dataset. I have a...
1
by: Grey | last post by:
my idea is want to add textbox on the datagrid. the data of the textbox was extract from DB. use can change the value on the textbox anytime. after the change, user just click the button on the...
1
by: siaj | last post by:
Helo All, If some one has faced a similar issue.. My datagrid Update command is not getting fired in fact it seems that the no event fires on clicking the update link. Although the cancel and the...
4
by: siaj | last post by:
Hello All, If some one has faced a similar issue.. My datagrid Update command is not getting fired in fact it seems that the no event fires on clicking the update link. Although the cancel and the...
1
by: Peter Rilling | last post by:
I have an interesting problem with a datagrid. It is the standard chicken-and-the-egg problem. I have this page with two datagrids. It essentially defines a parent-child relationship. The...
2
by: hcs | last post by:
Hello, is it possible to place a command button in a datagrid in vb.net . i am converting a program i have written in access to vb.net. in access i have a subform sent to "continous form" and...
4
by: shalini166 | last post by:
I place command button in datagrid. When i click one button in the column.Another form or other datagrid will open. i don't how to make click event for column in the datagrid.please help me. ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.