TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chris
NA
1
0
Disable dropdown box option
May 2 2007 3:02 PM
Let me preface by admitting I'm a bit of a C# noob. I'm here learning on the job and need to find a way to disable certain options in a dropdown box we have. That said, here's the code:
<ASP:DROPDOWNLIST ID="drpAreas" RUNAT=
server
AUTOPOSTBACK=False></ASP:DROPDOWNLIST>
It's filled from a database with this code:
foreach(DataRowView drv in dvTopics)
{
if (int.Parse(drv.Row["Category_key"].ToString()) != iCurrKey)
{
iCurrKey = int.Parse(drv.Row["Category_Key"].ToString());
//Add The Parent Level Category
this.drpAreas.Items.Add(new ListItem("--- " + drv.Row["Name"].ToString() + " ---",drv.Row["area_key"].ToString()));
}
else
{
//Add a sub area
this.drpAreas.Items.Add(new ListItem(this.Server.HtmlDecode(" ") + drv.Row["sub_area"].ToString(),drv.Row["area_key"].ToString()));
}
}
It creates a box that looks something like this:
--- Heading 1 ---
Subheading 1-1
Subheading 1-2
--- Heading 2 ---
Subheading 2-1
Subheading 2-2
What I'd love to do is make it so a user can SEE but NOT SELECT any of the headings. Any ideas?
Thanks!
Reply
Answers (
0
)
How to retrive an ole embedded file
Tab control on a Pocket 2003