3 Answers, 1 is accepted
0
Hi Mohan,
Thank you for writing.
In the ContextMenuOpening event of RadGridView, you can retrieve the cell the user right-clicked and from it you can get the column the context menu is opened for. In the same event you can customize the items available in the context menu. Here is an example:
I hope this will be useful. Should you have further questions, feel free to write back.
Greetings,
Ivan Petrov
the Telerik team
Thank you for writing.
In the ContextMenuOpening event of RadGridView, you can retrieve the cell the user right-clicked and from it you can get the column the context menu is opened for. In the same event you can customize the items available in the context menu. Here is an example:
private
void
radGridView1_ContextMenuOpening(
object
sender, ContextMenuOpeningEventArgs e)
{
GridDataCellElement cell = e.ContextMenuProvider
as
GridDataCellElement;
if
(cell ==
null
)
{
return
;
}
if
(cell.ColumnInfo.Name ==
"Some column name"
)
{
e.ContextMenu.Items.Add(
new
RadMenuItem(
"Column spedific action"
));
}
}
I hope this will be useful. Should you have further questions, feel free to write back.
Greetings,
Ivan Petrov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Mohan
Top achievements
Rank 1
answered on 12 Jul 2012, 08:10 PM
Hi Ivan,
Thanks for giving solution. This code working for particular column but after selecting the cell of the column and i right click the mouse any where in the grid context menu is showing. I need solution like context menu is should show with in the particular column of selected cell not in outside the selected cell and header of the cell. Please immediately give solution for this..
Thanks for giving solution. This code working for particular column but after selecting the cell of the column and i right click the mouse any where in the grid context menu is showing. I need solution like context menu is should show with in the particular column of selected cell not in outside the selected cell and header of the cell. Please immediately give solution for this..
0
Hi Mohan,
Thank you for writing back.
I am afraid I do not fully understand your last reply. Can you please describe in bit greater detail what the current behavior is and what the behavior you want is? Some screen shots or sketches would be very helpful.
I am looking forward to your reply.
Regards,
Ivan Petrov
the Telerik team
Thank you for writing back.
I am afraid I do not fully understand your last reply. Can you please describe in bit greater detail what the current behavior is and what the behavior you want is? Some screen shots or sketches would be very helpful.
I am looking forward to your reply.
Regards,
Ivan Petrov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>