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

Change the font menu in radgridview

10 Answers 231 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 27 Feb 2013, 07:30 PM
How can I change the font menu on radgridview??
Attach a photo

10 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 01 Mar 2013, 02:54 PM
Hello Ali,

You can do that in the ContextMenuOpening event:
void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
    e.ContextMenu.Font = new Font("Arial", 11);
}

More information about the context menu in RadGridView is available here: http://www.telerik.com/help/winforms/gridview-context-menus-modifying-the-default-context-menu.html.

I hope this helps.
 

Greetings,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Join us for a FREE webinar to see all the new stuff in action.

Interested, but can’t attend? Register anyway and we’ll send you the recording.
0
Ali
Top achievements
Rank 1
answered on 01 Mar 2013, 03:09 PM
Thank you
Good luck
0
Ali
Top achievements
Rank 1
answered on 03 Mar 2013, 04:58 AM
How do I change the font   Excel Like Filtering
0
Stefan
Telerik team
answered on 06 Mar 2013, 01:11 PM
Hi Ali,

Thank you for writing back.

One way to do that is to handle the popup initialization and set the font of the menu items and the popup. In the case of RadListFilterPopup, which contains RadTreeView, you will have to subscribe to its NodeFormatting event in order to change the appearance of the nodes:
Font f = new Font("Arial", 11);
void radGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
{
 
    BaseFilterPopup popup = (BaseFilterPopup)e.FilterPopup;
    SetMenuFont(popup.Items);
    popup.Font = f;
 
    if (e.FilterPopup is RadListFilterPopup)
    {
        RadListFilterPopup listFilterPopup = (RadListFilterPopup)e.FilterPopup;
        listFilterPopup.MenuTreeElement.TreeView.NodeFormatting -= TreeView_NodeFormatting;
        listFilterPopup.MenuTreeElement.TreeView.NodeFormatting += TreeView_NodeFormatting;
    }
}
 
void TreeView_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
{
    e.Node.Font = f;
}

Off topic, I would like to kindly ask you to separate the questions that are not related to each other in separate threads, as this will make it easier for the community to find their answers.

Kind regards,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Ali
Top achievements
Rank 1
answered on 07 Mar 2013, 08:33 AM
thanks
I
am using Telerik 2011 Q3 SP1 version of events does not FilterPopupInitialized
Can I solve my problem with this version
0
mohammad
Top achievements
Rank 1
answered on 09 Mar 2013, 10:01 AM
I have the same problem.
version telerik Q3 2011 sp1
0
Stefan
Telerik team
answered on 11 Mar 2013, 03:31 PM
Hi guys,

In your version you can use the FilterPopupRequired event to access the filter popup. Here is a sample:
Font f = new Font("Arial", 11);
void radGridView1_FilterPopupRequired(object sender, FilterPopupRequiredEventArgs e)
{
    BaseFilterPopup popup = (BaseFilterPopup)e.FilterPopup;
    SetMenuFont(popup.Items);
    popup.Font = f;
 
    if (e.FilterPopup is RadListFilterPopup)
    {
        RadTreeView tree = (RadTreeView)popup.Controls[1];
        tree.NodeFormatting -= TreeView_NodeFormatting;
        tree.NodeFormatting += TreeView_NodeFormatting;
    }
}
 
private void SetMenuFont(Telerik.WinControls.RadItemOwnerCollection radItemOwnerCollection)
{
    foreach (RadMenuItemBase item in radItemOwnerCollection)
    {
        item.Font = f;
        if (item.HasChildren)
        {
            SetMenuFont(item.Items);
        }
    }
}

I hope this helps.

Greetings,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
mohammad
Top achievements
Rank 1
answered on 12 Mar 2013, 06:17 AM
tanks
But I want to change the font of all parts radgridview
Do you want to change the font of all parts radgridview
Example
0
mohammad
Top achievements
Rank 1
answered on 14 Mar 2013, 10:30 AM
But I want to change the font of all parts radgridview
Do you want to change the font of all parts radgridview
0
Stefan
Telerik team
answered on 14 Mar 2013, 11:28 AM
Hello Mohammad,

I would suggest that you open a new thread and address your questions there, so we do not mix the subjects. This thread is named "Change the font menu in radgridview", so lets keep it for the font of the menus. 

Additionally, you can check out how to use the forums here: http://www.telerik.com/community/forums/winforms/gridview/important-information-on-using-the-telerik-forums.aspx.

Greetings,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
GridView
Asked by
Ali
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ali
Top achievements
Rank 1
mohammad
Top achievements
Rank 1
Share this question
or