Microsoft OutLook Kind of View

Hi , Is it Possible to have view like Microsoft Outlook when a grouping grid is grouped based on column i.e. when the column is dragged to the Groupdroparea , it should be removed/hide from the grid and when it is dragged back to the grid it appears agian at his original position(retaining the index before dropping)

1 Reply

AD Administrator Syncfusion Team September 3, 2004 11:36 AM UTC

For now, you will have to handle an event to do this type of thing. You can listen to the GroupedColumns changed event, and hide/show things in your event handler. You will also need to keep track of the column and where it was. Here are some snippets.
//subscribe to the event
this.gridGroupingControl1.TableDescriptor.GroupedColumns.Changed += new Syncfusion.Collections.ListPropertyChangedEventHandler(GroupedColumns_Changed);

//used to track where/what column needs to be shown/hidden
private Hashtable saveLocation = new Hashtable();
private Hashtable saveColumn = new Hashtable();

//the handler
private void GroupedColumns_Changed(object sender, ListPropertyChangedEventArgs e)
{
	SortColumnDescriptor col = e.Item as SortColumnDescriptor;
	int i = this.gridGroupingControl1.TableDescriptor.VisibleColumns.IndexOf(col.Name);
	if(i > -1)
	{
		saveLocation.Add(col.Name, i);
		saveColumn.Add(col.Name, this.gridGroupingControl1.TableDescriptor.VisibleColumns[i]);
		this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove(col.Name);
	}
	else
	{
		i = (int) saveLocation[col.Name];
		saveLocation.Remove(col.Name);
		GridVisibleColumnDescriptor vcol = saveColumn[col.Name] as GridVisibleColumnDescriptor;
		saveColumn.Remove(col.Name);
		this.gridGroupingControl1.TableDescriptor.VisibleColumns.Insert(i, vcol);
	}
}

Loader.
Up arrow icon