Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7795801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:10:25+00:00 2026-06-01T23:10:25+00:00

i got a questiong to ask. I got a dropdown list in my app.However

  • 0

i got a questiong to ask. I got a dropdown list in my app.However the dropdown list is populate with hierarchy format. Please c the picture

enter image description here

As the picture above. How can i bold and underline the parent menu item such as Men , ladies and NA On the other hand , the parent item is not allow to select also.

Here is my coding

        private void createDDLCategory()
    {
        ddlCategory.AppendDataBoundItems = true;
        ddlCategory.Items.Insert(0, new ListItem("All","A"));
        ddlCategory.SelectedIndex = 0;



        var ddl1 = dropdownlist.ddlCategoryWithoutGroup();
        foreach (var value in ddl1)
        {
            if (value.P_CATEGORY_ID == null)
            {

                this.ddlCategory.Items.Add(new ListItem(value.CATEGORY_NAME, value.CATEGORY_ID.ToString()));
                this.ddlCategory.Items.FindByValue(value.CATEGORY_ID.ToString()).Selected = false;

                this.ddlCategory.Items.FindByValue(value.CATEGORY_ID.ToString()).Attributes.Add("disabled", "true");
                this.ddlCategory.Items.FindByValue(value.CATEGORY_ID.ToString()).Attributes.Add("style", "font-weight:bold;");

                foreach (var valueChild in ddl1)
                {

                    if (valueChild.P_CATEGORY_ID == value.CATEGORY_ID)
                        this.ddlCategory.Items.Add(new ListItem("   " + valueChild.CATEGORY_NAME, valueChild.CATEGORY_ID.ToString()));
                }
            }
        }


        foreach (ListItem item in ddlCategory.Items)
        {
            item.Text = HttpUtility.HtmlDecode(item.Text);

        }



    }

Ur help is appreciate.Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:10:27+00:00Added an answer on June 1, 2026 at 11:10 pm

    Have you tried this way:

    ddlCategory.Items.FindByValue("0").Attributes.Add("style", "font-weight:bolder")
    

    MSDN has mentioned that only few style attributes are applicable for IE.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/controlscrashcourse-deriving.asp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a kind of weird question to ask - how can I break
i got a question about unsigned char array. How can i store an integer
In PHP I can do it as simple as : file_get_contents('http://stackoverflow.com/questions/ask'); What's the shortest
Got this regex string from JavaScript: the good parts (pp. 66). Can't get it
I've got a relatively simple Cocoa on Mac OS X 10.6 question to ask.
I've got an android app that pulls a random 20 questions (rows) as a
Hi i got a question to ask u all Here is my codding string
I got a small question with a big background. Let me ask a short
I've got the following question to ask: How do you compile taglib with an
Somebody asked me: can an array in java contain integers and floats? She got

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.