views:

20

answers:

1

Hi All,

I am trying to display all the fonts available in the system with its own style. But it is not working. I am following for color it is working fine.

Problem: This code is working fine in firefox but not in IE. Is there any option to make it work.

Code:

foreach (FontFamily font in fonts.Families)
        {
            ddlFontName.Items.Add(font.Name); // Working
        }

        for (int row = 0; row < ddlFontName.Items.Count; row++)
        {
            ddlFontName.Items[row].Attributes.Add("style", "font-family:" + ddlFontName.Items[row].Value); // Not Working
        }
A: 

The default drop down list did not have this capability on every line. Not even the default windows drop down list can do that as it is with out custom render.

To make what you try, you need to make a custom menu, that is looks like drop down list.

In this menou that you make it out of div/ui/li set, you place inside the render style you like, make your selection then save your selection to an input.

Its a big javascript journey...

Take this as example: http://www.marghoobsuleman.com/jquery-image-dropdown

Aristos
But my code is working for backbgound-color.
Geetha
@Geetha Yes the background color is working, a little diferent in every browser but its working. The font is not.
Aristos