Get Default Text for GirdViewCommandColumn

4 posts, 1 answers
  1. Jerry Jansen
    Jerry Jansen avatar
    47 posts
    Member since:
    Aug 2009

    Posted 12 Sep 2011 Link to this post

    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
  2. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 13 Sep 2011 Link to this post

    Hello Jerry,

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

    Best Regards,
    Emanuel Varga
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jerry Jansen
    Jerry Jansen avatar
    47 posts
    Member since:
    Aug 2009

    Posted 13 Sep 2011 Link to this post

    Thanks Emanuel
  5. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 14 Sep 2011 Link to this post

    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
Back to Top