예제 #1
0
            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());
                }
            }
예제 #2
0
            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();
                }
            }
예제 #3
0
            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;
            }
예제 #4
0
            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;
            }
예제 #5
0
 public int GetColumnIndexOf(DataGridDataItemEditProvider custom)
 {
     return(provider.CurrentTableStyle.GridColumnStyles.IndexOf(custom.Column));
 }
예제 #6
0
			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 ();
				} 
			}
예제 #7
0
			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;
			}
예제 #8
0
			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;
			}
예제 #9
0
			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 ();
			}
예제 #10
0
			public int GetColumnIndexOf (DataGridDataItemEditProvider custom)
			{
				return provider.CurrentTableStyle.GridColumnStyles.IndexOf (custom.Column);
			}