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

Get Default Text for GirdViewCommandColumn

3 Answers 49 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jerry Jansen
Top achievements
Rank 1
Jerry Jansen asked on 12 Sep 2011, 07:00 PM
I have 3 GridViewCommandColumn in my radGridView. I need to determine which one of the three command columns were pressed. I can't seem to figure out how to get the "Default Text" value to determine which command column was clicked. I can get the value of the command column by the CommandCellClick event but I can not get the "Default Text" value. My three default text values of the three command columns are "Time Sheet", "Print Monthly", and "Registration". Thanks for any help you can provide. New at WinForms!

Private Sub RadGridView1_CommandCellClick(sender As Object, e As System.EventArgs) Handles RadGridView1.CommandCellClick
        Dim gcce As GridCommandCellElement = TryCast(sender, GridCommandCellElement)
 
        'GridViewCommandColumn
        If gcce Is Nothing OrElse gcce.Value Is Nothing Then
            Return
        End If
        MessageBox.Show(gcce.Value.ToString())
End Sub

3 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 13 Sep 2011, 09:17 AM
Hello Jerry,

Just use commandCell.CommandButton.Text or in your case gcce.CommandButton.Text.

Best Regards,
Emanuel Varga
0
Jerry Jansen
Top achievements
Rank 1
answered on 13 Sep 2011, 01:40 PM
Thanks Emanuel
0
Emanuel Varga
Top achievements
Rank 1
answered on 14 Sep 2011, 10:50 AM
Glad to be able to help,

If you have any more questions please just let me know, and if the question has been solved, please mark the question as answered, so that others can find the answers to their questions faster.

Best Regards,
Emanuel Varga
Tags
GridView
Asked by
Jerry Jansen
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Jerry Jansen
Top achievements
Rank 1
Share this question
or