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

gridview

1 Answer 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
salini
Top achievements
Rank 1
salini asked on 08 Nov 2010, 11:30 AM
how to get a column value on the click of a context menu item on a grid view

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander
Telerik team
answered on 11 Nov 2010, 02:38 PM
Hello Salini,

Thank you for your question.

You can handle ContextMenuOpening event of RadGridView to find the column for which the menu is opened:
private string columnName;
private void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
    GridHeaderCellElement contextMenuProvider = e.ContextMenuProvider as GridHeaderCellElement;
    if (contextMenuProvider != null)
    {
        columnName = contextMenuProvider.ColumnInfo.Name;
    }
    else
    {
        columnName = this.radGridView1.CurrentColumn.Name;
    }
}

I hope it helps.

Best regards,
Alexander
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
salini
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or