
<
telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server" SelectedDate='<%# Bind("Start") %>' TimeView-EndTime="18:59:59" TimeView-StartTime="08:00:00" TimeView-Interval="00:30:00" />
</telerik:RadDateTimePicker>
| GridDropDownColumn Col_NameSyst = new GridDropDownColumn(); |
| RDG_Fallos.MasterTableView.Columns.Add(Col_NameSyst); |
| Col_NameSyst.DataField = "idSystem"; |
| Col_NameSyst.HeaderText = "System"; |
| Col_NameSyst.UniqueName = "System"; |
| Col_NameSyst.DataSourceID = "sdsSystem"; |
| Col_NameSyst.ListTextField = "System"; |
| Col_NameSyst.ListValueField = "idSystem"; |
| Col_NameSyst.DropDownControlType = GridDropDownColumnControlType.RadComboBox; |
| protected void RDG_Fallos_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| GridEditFormItem editFormItem = e.Item as GridEditFormItem; |
| if (e.CommandName == "InitInsert") |
| { |
| GridDropDownListColumnEditor rdcSystem = (RDG_Fallos.Columns.FindByUniqueName("System") as GridDropDownColumn).ColumnEditor as GridDropDownListColumnEditor; |
| rdcSystem.ComboBoxControl.Enabled = false; |
| rdcSystem.ComboBoxControl.Skin = "Vista"; |
| } |
| else |
| { |
| if (e.CommandName == "Edit") |
| { |
| GridDropDownListColumnEditor rdcSystem = (RDG_Fallos.Columns.FindByUniqueName("System") as GridDropDownColumn).ColumnEditor as GridDropDownListColumnEditor; |
| rdcSystem.ComboBoxControl.Skin = "Vista"; |
| } |
| } |
| } |
I have a webmethod which returns the rows from the query, and passes it as a list. I am using two classes to assign the values.
| public class Types |
| { |
| public Types() |
| { |
| this.Defs = new List< Definitions>(); |
| } |
| public string Name |
| { |
| get; |
| set; |
| } |
| public int Sort |
| { |
| get; |
| set; |
| } |
| public Definitions Defs |
| { |
| get; |
| set; |
| } |
| } |
| public class Definitions |
| { |
| public string Name |
| { |
| get; |
| set; |
| } |
| } |
I am unsure if I am doing this correctly, but this is what I am trying to accomplish. Each Type is a RadPanelBarItem Parent of a Definition. There are multiple Types and Definitions. This is the closest I have come to implementing this in this way.
| ObservableCollection<Types> events = e.Result; |
| //find a specific object |
| String _type = events.FirstOrDefault().Type; |
| IEnumerable<Types> qry = from c in events |
| where (c.Type.ToString().Equals(_type)) |
| orderby c.Sort |
| select c; |
| int ct = 0; |
| if (qry != null) |
| { |
| RadPanelBarItem head = new RadPanelBarItem() |
| { |
| Header = _type |
| , |
| Style = Application.Current.Resources["radPanel_StyleInd"] as Style |
| }; |
| foreach (Types typ in qry) |
| { |
| if (inc.IsActive == true) |
| { |
| RadPanelBarItem pbi = new RadPanelBarItem() |
| { |
| Name = inc.IncType.ToLower() + "_Def_" + ct |
| , |
| Style = Application.Current.Resources["radPanel_StyleInd"] as Style |
| }; |
| pbi.Selected += new EventHandler<Telerik.Windows.RadRoutedEventArgs>(pbi_Selected); |
| head.Items.Add(pbi); |
| ct++; |
| } |
| }; |
| pb.Items.Add(head); |
| } |
| } |
Right away you can see that it isn’t dynamically adding the head—parent items. I need it to add the Types as the head, parent items and definitions as child items… any idea how to accomplish this?