/// <devdoc> /// Extracts the value(s) from the given cell and puts the value(s) into a dictionary. Indicate includeReadOnly /// to have readonly fields' values inserted into the dictionary. /// </devdoc> public override void ExtractValuesFromCell(IOrderedDictionary dictionary, DataControlFieldCell cell, DataControlRowState rowState, bool includeReadOnly) { DataBoundControlHelper.ExtractValuesFromBindableControls(dictionary, cell); IBindableTemplate bindableTemplate = ItemTemplate as IBindableTemplate; if (((rowState & DataControlRowState.Alternate) != 0) && (AlternatingItemTemplate != null)) { bindableTemplate = AlternatingItemTemplate as IBindableTemplate; } if (((rowState & DataControlRowState.Edit) != 0) && EditItemTemplate != null) { bindableTemplate = EditItemTemplate as IBindableTemplate; } else if ((rowState & DataControlRowState.Insert) != 0 && InsertVisible) { if (InsertItemTemplate != null) { bindableTemplate = InsertItemTemplate as IBindableTemplate; } else { if (EditItemTemplate != null) { bindableTemplate = EditItemTemplate as IBindableTemplate; } } } if (bindableTemplate != null) { bool convertEmptyStringToNull = ConvertEmptyStringToNull; foreach (DictionaryEntry entry in bindableTemplate.ExtractValues(cell.BindingContainer)) { object value = entry.Value; if (convertEmptyStringToNull && value is string && ((string)value).Length == 0) { dictionary[entry.Key] = null; } else { dictionary[entry.Key] = value; } } } return; }
public override void ExtractValuesFromCell(IOrderedDictionary dictionary, DataControlFieldCell cell, DataControlRowState rowState, bool includeReadOnly) { DataBoundControlHelper.ExtractValuesFromBindableControls(dictionary, cell); IBindableTemplate itemTemplate = this.ItemTemplate as IBindableTemplate; if (((rowState & DataControlRowState.Alternate) != DataControlRowState.Normal) && (this.AlternatingItemTemplate != null)) { itemTemplate = this.AlternatingItemTemplate as IBindableTemplate; } if (((rowState & DataControlRowState.Edit) != DataControlRowState.Normal) && (this.EditItemTemplate != null)) { itemTemplate = this.EditItemTemplate as IBindableTemplate; } else if (((rowState & DataControlRowState.Insert) != DataControlRowState.Normal) && this.InsertVisible) { if (this.InsertItemTemplate != null) { itemTemplate = this.InsertItemTemplate as IBindableTemplate; } else if (this.EditItemTemplate != null) { itemTemplate = this.EditItemTemplate as IBindableTemplate; } } if (itemTemplate != null) { bool convertEmptyStringToNull = this.ConvertEmptyStringToNull; foreach (DictionaryEntry entry in itemTemplate.ExtractValues(cell.BindingContainer)) { object obj2 = entry.Value; if ((convertEmptyStringToNull && (obj2 is string)) && (((string)obj2).Length == 0)) { dictionary[entry.Key] = null; } else { dictionary[entry.Key] = obj2; } } } }