Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 How to make a Default within a listbox of items

Author  Topic 

Adam West
Constraint Violating Yak Guru

261 Posts

Posted - 2009-09-03 : 16:41:56
I have an interface in C# ASP.net that shows parameters for the user to select, and then it runs reports developed in Reporting Services, using the Reportviewer to display.

I need to make some of the Listbox items as Defaults, specifically "*ALL", this *ALL is one of the options I show. I think it should be highlighted and be the default selection.

I have done this, but would like to highlight the ALL, which does show up first. How would you do such a highlight?

// Populate Department
//
private void PopulateDept()
{
DataSet ds = Lib.GetResults(SQL_GET_DEPTS, GetCurrentConnection());

Lib.SetUpListBox(ref listDept, ds, "dept", "CUSTNMBR");
}

nitinnjp
Starting Member

6 Posts

Posted - 2009-09-30 : 03:05:01
Listbox.Items.Insert(0, "* All");

nitin patil
Go to Top of Page
   

- Advertisement -