Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Change font size dropdown to resemble ms word font size

Last post 08-12-2008 12:34 by mac73. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-11-2008 10:38

    • mac73
    • Not Ranked
    • Joined on 07-08-2008
    • Points 70

    Change font size dropdown to resemble ms word font size

    Hi,

     

    I want to change font size dropdown from values 1 to 7 to similar that of word like 8,8.5,9,11,13 etc.

    Any help is appreciated.

    Regards

    Mac 

     

    Filed under:
    • Post Points: 20
  • 08-11-2008 10:49 In reply to

    Re: Change font size dropdown to resemble ms word font size

    The font size dropdown can be manipulated through the API, for example: 

     protected void Page_PreRender(object sender, EventArgs e)
    {
        // Find the FontSize drop down item in the Toolbar.Items collection.
        ToolbarDropDown dropDown = (ToolbarDropDown)  this.WebHtmlEditor1.Toolbar.Items.GetByType(ToolbarItemType.FontSize);

        // Clear items coming from the FontSizeList property.
        dropDown.Items.Clear();
        // Add items that preview the font size their selection sets.
        dropDown.Items.Add(new ToolbarDropDownItem("<font size='1'>xx-small</font>", "1"));
        dropDown.Items.Add(new ToolbarDropDownItem("<font size='2'>small</font>", "2"));
        dropDown.Items.Add(new ToolbarDropDownItem("<font size='3'>medium</font>", "3"));
        dropDown.Items.Add(new ToolbarDropDownItem("<font size='4'>large</font>", "4"));
        dropDown.Items.Add(new ToolbarDropDownItem("<font size='5'>x-large</font>", "5"));
        dropDown.Items.Add(new ToolbarDropDownItem("<font size='6'>xx-large</font>", "6"));
    }

    More info is available in our online help available here:

    http://help.infragistics.com/NetAdvantage/NET/2008.2/CLR3.5

     

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 35
  • 08-11-2008 11:13 In reply to

    • mac73
    • Not Ranked
    • Joined on 07-08-2008
    • Points 70

    Re: Change font size dropdown to resemble ms word font size

    Thanks Rumen,

    Is there a way i can change to fontsize like 9,10,11 etc?

    • Post Points: 5
  • 08-12-2008 12:34 In reply to

    • mac73
    • Not Ranked
    • Joined on 07-08-2008
    • Points 70

    Re: Change font size dropdown to resemble ms word font size

    This code doesnt work for me. I am able to add items to dropdown form xx-small to xx-large but unable to remove the default items from 1 to 7. I have a sample project than i can send if i am provided the email id.

    I tried following events

    1) Page Prerender

    2) Page Prerender complete

    3) Toolbardropdown pre render

    4) Webhtmleditor pre render

    5) Webhtmleditor load event. I tried loading dropdown dynamically with fontsize and type and still get the same result.

    5) Toolbardropdown ondatabinding

    Am i missing any settings to be one to avoid filling default values?

    Items.Clear() from above code doesnt work since Items.Count in 0 in each event.

    Do you know which event fills dropdownlist?  

     

    • Post Points: 5
Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems