Пример #1
0
 public static ListItemDetails[] Create(ListItem[] items, out string selected)
 {
     ListItemDetails[] result = new ListItemDetails[items.Length];
     selected = null;
     for (int i = 0; i < items.Length; i++)
     {
         if (items[i].Selected)
         {
             selected = items[i].Value;
         }
         result[i] = new ListItemDetails {
             Text     = items[i].Text,
             Value    = items[i].Value,
             Selected = items[i].Selected
         };
     }
     return(result);
 }
Пример #2
0
 protected override void PerformDataBinding(IEnumerable data)
 {
     ViewState["data"]             = dataItems
                                   = ListItemDetails.Create(data.Cast <ListItem>().ToArray(),
                                                            out selectedCategory);
 }
Пример #3
0
 protected override void PerformDataBinding(IEnumerable data)
 {
     Debug.Assert(data != null, "data != null");
     ViewState[ViewStateDataLabel] = _dataItems = ListItemDetails.Create(data.Cast <ListItem>().ToArray(), out _selectedCategory);
 }