473,978 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3555
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.Contro ls.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}BTInte rnet{dot}com
Nov 20 '05 #2
You can use the ExtendedDataGri d
http://dotnet.leadit.be/extendeddatagrid
Using the ExtendedDataGri dLinkLabelColum n 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 extendedDataGri dLinkLabelColum n1_LinkLabelCol umnClick
(object sender, Leadit.Extended DataGrid.LinkLa belColumnEventA rgs e)
{
MessageBox.Show (((Customer)e.R owValue).Commen ts);
}

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********@hot mail.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********@hot mail.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.h tm>

--
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
1761
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, that the update linkbutton actually goes to the edit command instead of the update command (which I'm pretty sure would be a bug). Anyway, I took out the editcommmand column and replaced it with a regular template column. Within the...
0
1585
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 query string. The problem is, when I return to my initial page and do another search by entering a value in the text box then hitting enter, it takes that value and sends it to the other page as if I hit the edit link within the grid. Help...
0
4803
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 TemplateColumn with a DropDownList (DDL) in the FooterItemTemplate that is populated in the Page_Load event using a Sub Routine as the DataSource of the DDL. The FooterItemTemplate's DDL populates as expected when the DataGrid's DataBind method is called. ...
1
1614
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 datagrid to save to DB. Is it possible to do that??? and how to ?? Million Thanks..
1
1873
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 Edit Commmand are getting fired properly. The One difference I have seen is that in the task bar ..on hovering on the link the javascript for the update link seems different. I dont know if it makes sense..
4
3492
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 Edit Commmand are getting fired properly. The One difference I have seen is that in the task bar ..on hovering on the link the javascript for the update link seems different. I dont know if it makes sense..
1
2110
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 parent grid has a "edit" and "delete" columns. When the "edit" link button is clicked, I want the child grid to display some information related to the parent. Now the child grid also has some command buttons. My problem is that I cannot get the...
2
1357
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 for each record that is displayed a button appears on the right. when the user clicks this button it executes some code. I want this in vb.net
4
1234
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. pls help me.
0
10356
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10172
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11413
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11582
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10917
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8464
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7618
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6561
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3765
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.