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

Right click or double click support for header

6 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jerry Kurata
Top achievements
Rank 1
Jerry Kurata asked on 12 Jun 2010, 03:53 PM
Hi,

Our users want to change the properties of columns.  This includes properties such as the column header, font, font size, cell backgrounds, etc.  We want to have them do this by selecting the column and either right clicking or double clicking to bring up a property change window.  I do not see support for either a right click or double click in the grid.  How can we add this support?

Jerry

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Jun 2010, 07:14 AM
Hello Jerry,

 If you want you can use the "context menu" approach illustrated on this demo.

Greetings,
Vlad
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.
0
Jerry Kurata
Top achievements
Rank 1
answered on 16 Jul 2010, 11:11 PM
Is it possible to wire up something more visual like a UserControl or a ChildWindow to the contextmenu?
0
Jerry Kurata
Top achievements
Rank 1
answered on 19 Jul 2010, 04:26 AM
Hi Vlad,

I got my child window wired into the control, but when the child window completes I need to call a method in the code behind for the XAML file from the GridViewMenuHeader class.  Can you show me how I can do this?

Thanks again,

Jerry
0
Yavor Georgiev
Telerik team
answered on 19 Jul 2010, 09:39 AM
Hello Jerry Kurata,

 Generally, if you show your window using its ShowDialog method, you can be sure that code after the ShowDialog call will execute only after the window is closed.

var window = new MyWindow();
window.ShowDialog();
if (window.MyCustomProperty == MyCustomValue)
{
    DoSomething();
}

The DoSomething() call happens only after the window is closed. 

Sincerely yours,
Yavor Georgiev
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
0
Jerry Kurata
Top achievements
Rank 1
answered on 19 Jul 2010, 03:55 PM
Thanks Yavor,

I have that bit of code, but I need to understand how I can access a method in the code behind for the XAML from where you have DoSomething() which resides in the GridViewMenuHeader class shown in the demo.  Is there a way I can walk back from the grid to the code behind?

Jerry
0
Yavor Georgiev
Telerik team
answered on 20 Jul 2010, 12:03 PM
Hello Jerry Kurata,

 It would be best to have no interactions between the GridViewMenuHeader class and the Silverlight UserControl that hosts the RadGridView. That is why GridViewMenuHeader is initialized via an attached property. If you're unable to move your logic to GridViewMenuHeader, you can always get the GridView's page from GridViewMenuHeader like so:

var page = this.grid.ParentOfType<MyUserControlType>();
page.MyMethod();

Regards,
Yavor Georgiev
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
Jerry Kurata
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Jerry Kurata
Top achievements
Rank 1
Yavor Georgiev
Telerik team
Share this question
or