65.9K
CodeProject is changing. Read more.
Home

Adding fonts to Infragistics WebHtmlEditor

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Mar 23, 2011

CPOL
viewsIcon

9651

Adding fonts to Infragistics WebHtmlEditor

We can add the fonts to the fonts dropdown in addition to the existing basic fonts. To add 'Times New Roman' to the font names drop down-
ToolbarDropDown ddlFonts = (ToolbarDropDown)infraEditor.FindByKeyOrAction("FontName");
ddlFonts.Items.Add(new ToolbarDropDownItem("Times New Roman","Times New Roman"));
Similarly to add all the windows registered fonts-
ToolbarDropDown ddlFonts = (ToolbarDropDown)infraEditor.FindByKeyOrAction("FontName");
InstalledFontCollection fonts = new InstalledFontCollection();
foreach (FontFamily family in fonts.Families)
{
    ddlFonts.Items.Add(new ToolbarDropDownItem(family.Name,family.Name));
}