I want to create a ListUtility class for RadCombobox.
This class should be like a DropDownlist.
Example:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;
/// <summary>
/// Utility Klasse. Hilfsfunktionen für Dropdown Listen
/// </summary>
public static class ListUtility {
public static void FillDropDownList( DropDownList list, ArrayList sl, bool addEmpty ) {
try {
if (addEmpty && (1 != sl.Count)) {
list.Items.Add( "" );
}
foreach (WListItem entry in sl) {
ListItem item = new ListItem( entry.Value, entry.Key );
list.Items.Add( item );
}
} catch (Exception ex) {
LogUtil.LogMessage( "Fatal Error in FillDropDownList\r\n" + ex.Message + "\r\n" + ex.StackTrace );
}
}
public static void FillDropDownList( DropDownList list, IDictionary sl ) {
FillDropDownList( list, sl, true );
}
public static void FillDropDownList( DropDownList list, ArrayList sl ) {
FillDropDownList( list, sl, true );
}
}
In the example above, the namespace is System.Web.UI.WebControls.
How combine programmatically a RadComboBox?