[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 944
  • Last Modified:

VB.net datagrid ButtonColumn for VB.net windows app

I am working with a datagrid and I am trying to add a button column.  I can not seem to find the buttoncolumn for a datagrid.  I am not sure if this is because I have only VB.net studio or if it because you can only use a button column for web apps.  

Here is my current code.

        Dim ts As DataGridTableStyle
        ts = New DataGridTableStyle
        ts.MappingName = DS1.Tables(0).ToString()
      Dim col1 As New DataGridTextBoxColumn
        With col1
            .MappingName = "StockNum"
            .HeaderText = "Stock #"
            .Width = 80
        End With

        Dim col2 As New DataGridTextBoxColumn
        With col2
            .MappingName = "Desc"
            .HeaderText = "Description"
            .Width = 80
        End With

        Dim col3 As New DataGridTextBoxColumn
        With col3
            .MappingName = "AskingPrice"
            .HeaderText = "Asking Price"
            .Width = 80
            .Format = "c"
            .Alignment = HorizontalAlignment.Right
        End With

        ts.GridColumnStyles.AddRange(New DataGridColumnStyle() {col1, col2, col3, col4, col5, col6, col7})
        With grdInventory
            .TableStyles.Add(ts)
            .DataSource = DS1.Tables(0)
        End With

I want to add a column with  buttons for my first column that will bring up a details page.  
0
Tygh
Asked:
Tygh
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now