I have a silverlight hierarchial Grid somewhat similar to the sample http://www.infragistics.com/samples/silverlight/grid/#/hierarchical-data , and have about 4 levels.
I need to add context menu when clicked on a column in any row, and the menuitems displayed are dependent on the value of a column. How i can acheive this. Appreciate any help/suggestions.
thanks.
Hello Nalini,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I created a Style for the CellControl and added XamContextMenu to it. I also handled the Laded event of the ContextMenu and in the handler I was able to get the clicked Cell’s Value order to add different items to the menu. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Stefan,
Thank you so much for your example. It works great. Is there a way to restrict the Context Menu to just one column in the Grid and also not display when clicked out side the grid ?
thanks
Nalini.
Also, is there a way to get the datacontext for the row rather than the cell value ?
I have modified the sample I sent you before, so now it has the functionality you want. Basically added a check in the ContextMenu's Loaded event in order to set just to the "ID" column. I also get the Row instead of the current Cell as per your requirement. Please let me know if you need further assistance on this matter.
thank you so much.