Hi,
I'm trying to add a context menu to the heder of my gridview. I've follow the code found here: http://demos.telerik.com/silverlight/#GridView/HeaderContextMenu
So I've used (I need to use only C# code,no XAML code):
DataGrid.CurrentGrid point to my RadGridView. The problem is that once te code is here:
I'm trying to add a context menu to the heder of my gridview. I've follow the code found here: http://demos.telerik.com/silverlight/#GridView/HeaderContextMenu
So I've used (I need to use only C# code,no XAML code):
DataGrid =
new SLGrid2();
GridViewHeaderMenu.SetIsEnabled(DataGrid.CurrentGrid as RadGridView, true);
DataGrid.CurrentGrid point to my RadGridView. The problem is that once te code is here:
IEnumerable
<GridViewHeaderCell> cells = row.Cells.OfType<GridViewHeaderCell>();
foreach (GridViewHeaderCell cell in cells)
{
row.Cells is always 0 so the foreach is never executed. My data are loaded after the creation of the grid so maybe it's because there is no data on the grid ? The problem is, if I tried to use the following line once the data are loaded:
GridViewHeaderMenu.SetIsEnabled(DataGrid.CurrentGrid as RadGridView, true);
The code use the Loaded event of the GridView, event that already occurs....
Do you have an idea ?
I hope it's clear :)
Thanks !