.Net, ASP.NET, DropDownList, Programming, Visual Studio 2010, Web Development

Using an XMLDataSource with a DropDownList Control

If you work a lot with ASP.NET then it’s likely that at some point or another you will ask yourself how to hook up an XML Data Source with a DropDownList control.

This just makes sense if you want to manage your drop-downs from a file rather than from a database, and carries a range of advantages. For example, not having to go through a DBA to update a simple DropDownList item would be a good reason in my books.

Continue reading “Using an XMLDataSource with a DropDownList Control”

Advertisement
.Net, ASP.NET, DropDownList, HTML, Programming, UpdatePanel, Web Development, WebForms

How to Extend the Expanded Select List Options for Older Browsers

A Lengthening Select List
Example of a Lengthening Select List

When putting together a Web based form space can be at a premium. Select lists are typically auto-adjusted by your browser to be the length of the longest option in the list.

But that just doesn’t work when space is tight and in many of my forms one doesn’t want the select list to automatically size itself to a length beyond what has been allocated for it, especially if the options are dynamically coming from a database.

To handle this gracefully for all browsers is actually not quite as simple as it seems and requires a bit of JavaScript to work universally.

Continue reading “How to Extend the Expanded Select List Options for Older Browsers”

.Net, ASP.NET, DropDownList, Programming, VB.NET, Web Development, WebForms

ASP.NET Overview of Binding a DropDownList to a FormView

If you use (or want to use) .NET WebForms databinding then you know that dropdown lists can be tricky to populate and mange. For example, say you have a FormView control with an embedded DropDownList control that you want to bind and pre-select when someone views the form. It’s not immediately intuitive how to do so, but it’s really quite straightforward.

Here’s how: Continue reading “ASP.NET Overview of Binding a DropDownList to a FormView”