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

Cell ContextMenu

1 Answer 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeff Lishingman
Top achievements
Rank 1
Jeff Lishingman asked on 22 Mar 2010, 05:49 PM

Hi All,

 

My requirement for the project is display a context menu for every cell. Columns are runtime created, I'm Binding dynamically with DataTable. I need to save for every cell a value (it is working with binding using Datatable) and one URL. URL are specific for every cell and will be used to get all posible options to be displayed in context menu.

I want to hear different opinions to achieve the goal. I was thinking to use GridViewCell.Tag or create a hidden TextBlock (in every cell) to persist URL values.

I'm using lazy load pattern to get all options only when the user left click inside cell. I tried with RadContextMenu.Opened += new RoutedEventHandler(OnMenuOpened); to trigger the request and get all context menu options. The code is working fine hard coding URL value, the next step is recover the right URL from every cell.

I thank you in advance, all idea are welcome.
Cheers.    

 

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 23 Mar 2010, 10:57 AM
Hi Kevin Radesh,

Using the Tag property would definitely work , however this was never the most elegant solution.
The UI is not the place to store data ( even temporary ) .
I would recommend to store the URL in the underlying business objects ( e.g. with the proper View Model if necessary )  and then use bindings to retrieve the URL .

And definitely NO to the hidden textbox approach .... adding UI element as a data storage holder will give you mostly performance problems .

In other words - instead of the Cell.Tag property , please use something like : MyUnderlyingBusinessObject.URL  property.

All the best,
Pavel Pavlov
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
GridView
Asked by
Jeff Lishingman
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or