This is a migrated thread and some comments may be shown as answers.

[Solved] GridButtonColumn Text="Select" And Method

1 Answer 188 Views
Grid
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 08 Aug 2009, 06:35 AM
hi

I have a method eg: Shared Sub Demo(byval rowvalue as String).
How do i call this method using  <telerik:GridButtonColumn Text="Select" CommandName="Select">
                        </telerik:GridButtonColumn> so that when i click the select button it also passes in the value of the selected row?


Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 10 Aug 2009, 05:13 AM
Hi,

Try passing the selected row value to the method in the ItemCommand event. Here is a sample code.

VB:
 
 
 
   Protected Sub RadGrid1_ItemCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) 
        If e.CommandName = "Select" Then 
            Dim selectedRow As GridDataItem = DirectCast(e.Item, GridDataItem) 
                ' you may pass the value to the function 
                
           Dim selectedRowID As String = selectedRow("ID").Text.ToString() 
            
        End If 
    End Sub 
 
 


Shinu
Tags
Grid
Asked by
L
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or