473,491 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Button in DataGrid (WinForms)

Hi all, I have generated a dynamic DataTable which I then bind to a datagrid
in my application.

What I want to do is add a column which contains a button relating to each
row in the datatable. When a user clicks on the button an event is raised so
I can show the user more information pertaining to information in the
current row..

I have tried the following..
[vbcode]
' Create the table
objDT = New System.Data.DataTable("Computer")

' Add the columns
objDT.Columns.Add("Select", GetType(Button))

' Add in a button...
Dim oButton As New Button
oButton.Text = "Select"
objDR("Select") = oButton

' Add the row to the datatable
objDT.Rows.Add(objDR)

[/vbcode]

I then bind the above datatable to my datagrid and I get no errors but no
button appears... Is it even possible to place a button in a datagrid???

Thanks in advance for any ideas/ other methods...
Cheers

Jul 21 '05 #1
0 1373

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
18265
by: Shivang | last post by:
Hello Everybody, I am using Datagrid in VB.net. I don't want the auto generation of rows in the datagrid (last row shouldnt be the new row with empty values)..in addition to this the datagrid...
5
2250
by: John Spiegel | last post by:
Hey all, I have contusions and I think a minor concussion after trying to find information on advanced WinForms DataGrid use. Does anyone know of a site / book that gets really in-depth on the...
3
1705
by: JAdrianB | last post by:
I'm trying to use a datagrid for data entry. I've created a couple of combo box columns using information from http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q480q That example basically sets...
6
1696
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can...
1
1152
by: Ken Dopierala Jr. | last post by:
Hi, I have a datagrid that I fill with a dataset. I would like to add a column that includes a button (and maybe in the future other controls like CheckBoxes). I can do this with the ASP...
1
2348
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
1
1568
by: MCDave | last post by:
Hi all, I'm trying to get a datagrid to display a button in every row, so that when the user clicks on it, the value from the first column (record index) is read, and then a new window opens for...
0
330
by: Mark | last post by:
Hi all, I have generated a dynamic DataTable which I then bind to a datagrid in my application. What I want to do is add a column which contains a button relating to each row in the datatable....
1
1466
by: TonyJ | last post by:
Hello! If there is a datagrid in VS2005 for winforms what kind of datagrid is it then. 1.Is it a bound datagrid that has a direct connection to columns for tables in the database. 2. Is it an...
0
7115
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
7154
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
7190
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...
0
7360
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
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4881
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...
0
4578
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...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
280
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...

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.