I have a databound ComboBox that the application user needs to be able to 'check'. What need to do is to show the user which entries have already been 'checked', that is I need to be able to programmatically set the checked property of the items in the combobox. I can id the items to be checked, I just need the code to actually "check" the item.
Here is my code so far:
If item.IsInEditMode Then
Dim indx As Integer = ctlUserCombo.FindItemIndexByText("Test, Sabo")
Dim cmbo As RadComboBox = CType(item.FindControl("ctlUserCombo"), RadComboBox)
Dim cbox As RadComboBoxItem = CType(cmbo.Items(indx), RadComboBoxItem)
cmbo.Items(indx).Enabled = False
So I am able to change the Enabled property to False...what I need to be able to do is set the combobox to "Checked". However the RadComboBoxItem does not have a 'checked' property. Anyone know how to get the combo box to show checked = true for individual items in the combobox?
Thanks.
var logid = dataBoundItem["LogId"].Text;
var deleted = dataBoundItem["Deleted"].Text; // this is a boolean
var Ownerid = dataBoundItem["OwnerId"].Text;
var locked = Convert.ToBoolean(dataBoundItem["Locked"].Text); // this is a boolean
}
}
Line 112:<body runat="server" id="body">
Line 113: <form id="form1" runat="server">
Line 114: <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
Line 115: </telerik:RadScriptManager>
Line 116: <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
|
public static void SavePanes(){ foreach (KeyValuePair<string, RadPaneSetting> paneState in GetStates<SerializableDictionary<string, RadPaneSetting>>().ToList()) { CormantRadPane pane = Utilities.FindControlRecursive(HttpContext.Current.Handler as Page, paneState.Key) as CormantRadPane; Save<RadPaneSetting>(pane); }}public class RegenerationManager { private static readonly ILog Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly RegenerationManager instance = new RegenerationManager(); private RegenerationManager() { } public static RegenerationManager Instance { get { return instance; } } private IList<CormantRadPane> _regeneratedPanes; //Don't monitor RadDockZone or RadDock -- these are handled by RadDockLayout. public IList<CormantRadPane> RegeneratedPanes { get { if (object.Equals(_regeneratedPanes, null)) { _regeneratedPanes = new List<CormantRadPane>(); } return _regeneratedPanes; } } /// <summary> /// Recreates the page state recursively by creating a control and looking for its known children. /// </summary> /// <param name="splitter"> Splitter having children added to it. </param> private void RegenerateSplitterChildren(RadSplitter splitter) { Logger.InfoFormat("Initializing splitter children for splitter {0}", splitter.ID); foreach (KeyValuePair<string, RadPaneSetting> paneState in RadControlManager.GetStates<SerializableDictionary<string, RadPaneSetting>>().Where(paneState => paneState.Value.ParentID == splitter.ID)) { CormantRadPane pane = new CormantRadPane(paneState.Value); RegeneratedPanes.Add(pane); splitter.Controls.Add(pane); RegeneratePaneChildren(pane); InsertSplitBar(splitter); } } /// <summary> /// Recreates all the dynamically made DockZones. /// </summary> public void RegenerateDockZones() { Logger.Info("Regenerating dock zones."); foreach (KeyValuePair<string, RadDockZoneSetting> dockZoneState in RadControlManager.GetStates<SerializableDictionary<string, RadDockZoneSetting>>()) { try { RadDockZoneSetting dockZoneSetting = dockZoneState.Value as RadDockZoneSetting; if (dockZoneSetting.ID == "RadDockZone1") continue; Logger.Info(String.Format("Loading state data for dock zone with setting ID: {0}", dockZoneSetting.ID)); CormantRadDockZone dockZone = new CormantRadDockZone(dockZoneSetting); //CormantRadPane pane = RegeneratedPanes.First(regeneratedPane => regeneratedPane.ID == dockZoneSetting.ParentID); CormantRadPane pane = Utilities.FindControlRecursive(HttpContext.Current.Handler as Page, dockZoneSetting.ParentID) as CormantRadPane; pane.Controls.Add(dockZone); } catch (Exception exception) { System.Diagnostics.Debug.Assert(false, "Error!"); Logger.ErrorFormat("Error regenerating dock zones. Reason: {0}", exception.Message); } } }