public string GetName(DataGridDataItemEditProvider custom) { int indexOf = GetChildProviderIndexOf(custom); if (indexOf == -1) { return(string.Empty); } if (indexOf >= provider.DataGrid.CurrentTableStyle.GridColumnStyles.Count) { return(string.Empty); } object data = provider.DataGrid [Index, indexOf]; if (data == null || string.IsNullOrEmpty(data.ToString())) { return(style.GridColumnStyles [indexOf].NullText); } else { return(data.ToString()); } }
private void OnColumnsCollectionChanged(object sender, CollectionChangeEventArgs args) { SWF.DataGridColumnStyle column = (SWF.DataGridColumnStyle)args.Element; if (args.Action == CollectionChangeAction.Remove) { DataGridDataItemEditProvider edit = columns [column]; edit.Terminate(); RemoveChildProvider(edit); columns.Remove(column); } else if (args.Action == CollectionChangeAction.Add) { DataGridDataItemEditProvider edit = new DataGridDataItemEditProvider(this, column); edit.Initialize(); AddChildProvider(edit); columns [column] = edit; } else if (args.Action == CollectionChangeAction.Refresh) { foreach (DataGridDataItemEditProvider edit in columns.Values) { edit.Terminate(); } OnNavigationChildrenCleared(); } }
public void SetEditValue(DataGridDataItemEditProvider edit, object value) { int column = provider.CurrentTableStyle.GridColumnStyles.IndexOf(edit.Column); int row = Index; if (column == -1 || row == -1) { return; } provider.DataGrid [row, column] = value; }
public override void InitializeChildControlStructure() { for (int column = 0; column < provider.CurrentTableStyle.GridColumnStyles.Count; column++) { SWF.DataGridColumnStyle columnStyle = provider.CurrentTableStyle.GridColumnStyles [column]; DataGridDataItemEditProvider edit = new DataGridDataItemEditProvider(this, columnStyle); edit.Initialize(); AddChildProvider(edit); if (column == 0) { name = GetName(edit); } columns [columnStyle] = edit; } // To keep track of columns DataGridProvider.CurrentTableStyle.GridColumnStyles.CollectionChanged += OnColumnsCollectionChanged; }
public int GetColumnIndexOf(DataGridDataItemEditProvider custom) { return(provider.CurrentTableStyle.GridColumnStyles.IndexOf(custom.Column)); }
private void OnColumnsCollectionChanged (object sender, CollectionChangeEventArgs args) { SWF.DataGridColumnStyle column = (SWF.DataGridColumnStyle) args.Element; if (args.Action == CollectionChangeAction.Remove) { DataGridDataItemEditProvider edit = columns [column]; edit.Terminate (); RemoveChildProvider (edit); columns.Remove (column); } else if (args.Action == CollectionChangeAction.Add) { DataGridDataItemEditProvider edit = new DataGridDataItemEditProvider (this, column); edit.Initialize (); AddChildProvider (edit); columns [column] = edit; } else if (args.Action == CollectionChangeAction.Refresh) { foreach (DataGridDataItemEditProvider edit in columns.Values) edit.Terminate (); OnNavigationChildrenCleared (); } }
public override void InitializeChildControlStructure () { for (int column = 0; column < provider.CurrentTableStyle.GridColumnStyles.Count; column++) { SWF.DataGridColumnStyle columnStyle = provider.CurrentTableStyle.GridColumnStyles [column]; DataGridDataItemEditProvider edit = new DataGridDataItemEditProvider (this, columnStyle); edit.Initialize (); AddChildProvider (edit); if (column == 0) name = GetName (edit); columns [columnStyle] = edit; } // To keep track of columns DataGridProvider.CurrentTableStyle.GridColumnStyles.CollectionChanged += OnColumnsCollectionChanged; }
public void SetEditValue (DataGridDataItemEditProvider edit, object value) { int column = provider.CurrentTableStyle.GridColumnStyles.IndexOf (edit.Column); int row = Index; if (column == -1 || row == -1) return; provider.DataGrid [row, column] = value; }
public string GetName (DataGridDataItemEditProvider custom) { int indexOf = GetChildProviderIndexOf (custom); if (indexOf == -1) return string.Empty; if (indexOf >= provider.DataGrid.CurrentTableStyle.GridColumnStyles.Count) return string.Empty; object data = provider.DataGrid [Index, indexOf]; if (data == null || string.IsNullOrEmpty (data.ToString ())) return style.GridColumnStyles [indexOf].NullText; else return data.ToString (); }
public int GetColumnIndexOf (DataGridDataItemEditProvider custom) { return provider.CurrentTableStyle.GridColumnStyles.IndexOf (custom.Column); }