Jump to content

Add Button Control On Datagrid In Vb


joecool2005
 Share

Recommended Posts

HiI tried to generate a dataGrid like this

Dim dt As DataTableDim dr As DataRow Dim theGrid As New DataGrid			theGrid.BorderColor = Drawing.Color.Black			theGrid.BorderWidth = 1			theGrid.GridLines = GridLines.Both			theGrid.CellPadding = 3			theGrid.CellSpacing = 0			theGrid.HeaderStyle.BackColor = Drawing.Color.AliceBlue			dt = New DataTable			dt.Columns.Add(New DataColumn("First name", GetType(String)))			dt.Columns.Add(New DataColumn("Last Name", GetType(String)))			dt.Columns.Add(New DataColumn(""))			dr = dt.NewRow()			dr(0) = "Joe"			dr(1) = "Cool"			dt.Rows.Add(dr)			theGrid.DataSource = New DataView(dt)			theGrid.DataBind()

Is it possible to add a button control on third column dr(2) ? Something like this <asp:Button id=Button1 runat="server" Text="ok" />If yes, how?ThxJoe

Link to comment
Share on other sites

  • 1 month later...

This is answer if you are using vb.net(web application as i know)in properties of datagrid AUTOGENERATE COLUMNAUTOGENERATE DELETE BUTTONAUTOGENERATE EDIT BUTTONOR AND YOU CAN ADD COLUMN ON CLICK IN ADD NEW COLUMN (( AT THERE SEE DOWN ( WHERE U SELECT A DATASOURCE)))

Edited by fasttrack
Link to comment
Share on other sites

  • 1 year later...

The add edit and delete button seems to work. But I thought the original post was about adding a whole new table / column? I've often checked my work with co-op companies. There are a few companies (www.coop-systems.com) around here locally. I guess I'm confused why you can't just add another dr (2) function at the top under the originals? Or is this after the program is already running?

Edited by Head
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...