webform datagrid 2 select button columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mapfax
    New Member
    • Oct 2006
    • 3

    webform datagrid 2 select button columns

    I have 2 select button columns in my webform datagrid with each button's property set to the 'select' command name. How can I determine the column index selected for each of the buttons so that I then can run different code in the 'datagrid_selec tedindexchanged ' event procedure?

    vs2002; asp1.1
  • mapfax
    New Member
    • Oct 2006
    • 3

    #2
    OK I think I've solved this using ItemCommand CommandSource of the datagrid:
    Code:
     Private Sub masterDataGrid_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles masterDataGrid.ItemCommand
          
            If CType(e.CommandSource, LinkButton).Text.ToString = "Select Hdr" Then
                Session("ColumnIndex") = 0
            ElseIf CType(e.CommandSource, LinkButton).Text.ToString = "Select Sub" Then
                Session("ColumnIndex") = 1
            End If
    
        End Sub

    Comment

    Working...