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

User conditional Formating and Theme

7 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Filleau
Top achievements
Rank 1
Filleau asked on 03 Dec 2010, 03:46 PM
Hi

How to apply the défault application theme to the "Conditional Formating" windows who is displayed for end users ?

(In my application, I use the Dersert Theme, so when this windows is showed, the blue color is not welcome.)

Thanks

Anthony

7 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 04 Dec 2010, 09:58 AM
Helo Anthony,

This will happen automatically if you set the application theme name for the entire application.
ThemeResolutionService.ApplicationThemeName = "Desert"

(See screenshot)

Hope that helps
Richard
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 04 Dec 2010, 11:51 AM
Hello guys,

Or if you are using different themes in your application and just want to show the ConditionalFormattingForm with a different theme, you can just do the following:

var conditionalFormattingForm = new ConditionalFormattingForm(this.radGridView1.MasterTemplate, null);
conditionalFormattingForm.ThemeName = "Desert";
conditionalFormattingForm.Owner = this.FindForm();
conditionalFormattingForm.Show();
 
And to use this from the grids's ContextMenu, you can just use the following:
//register for the context menu opening event
radGridView1.ContextMenuOpening += new ContextMenuOpeningEventHandler(radGridView1_ContextMenuOpening);
  
void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
    var conditionalFormattingItem =
        e.ContextMenu.Items.Where(i => i.Text.Contains("Conditional")).FirstOrDefault();
    if (conditionalFormattingItem == null)
    {
        return;
    }
  
    var index = e.ContextMenu.Items.IndexOf(conditionalFormattingItem);
    e.ContextMenu.Items.RemoveAt(index);
    conditionalFormattingItem = new RadMenuItem(conditionalFormattingItem.Text);
    e.ContextMenu.Items.Insert(index, conditionalFormattingItem);
  
    conditionalFormattingItem.Click += this.conditionalFormattingItem_Click;
}
 
void conditionalFormattingItem_Click(object sender, EventArgs e)
{
    var conditionalFormattingForm = new ConditionalFormattingForm(this.radGridView1.MasterTemplate, null);
    conditionalFormattingForm.ThemeName = "Desert";
    conditionalFormattingForm.Owner = this.FindForm();
    conditionalFormattingForm.Show();
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga

Telerik WinForms MVP
0
Filleau
Top achievements
Rank 1
answered on 04 Dec 2010, 12:50 PM
Thanks all !

Perfect !
0
Filleau
Top achievements
Rank 1
answered on 08 Dec 2010, 05:02 PM
Hi again, me again...

What's about system dialog box ?

I need to open an savedialogbox. If I wan't a to apply a theme on it I need to rewrite it ?

0
Richard Slade
Top achievements
Rank 2
answered on 08 Dec 2010, 05:22 PM
Hello,

the Windows Save Dialog box is still a windows form control and therefore you would have to look at implementing your own as this cannot be styled as far as Im aware.
Richard
0
Filleau
Top achievements
Rank 1
answered on 08 Dec 2010, 05:54 PM
Thanks.
But I can imagine that it must be already exist a code to do that.... somewhere.
0
Richard Slade
Top achievements
Rank 2
answered on 08 Dec 2010, 06:02 PM
Hi Again,

Have a look at the Telerik response in this forum post

hope that helps
Richard
Tags
GridView
Asked by
Filleau
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Emanuel Varga
Top achievements
Rank 1
Filleau
Top achievements
Rank 1
Share this question
or