Grid Folder Browser Demo

The EssentialGrid can be used to develop a powerful TreeView control owing to its flexibility. The tree nodes can be created through a custom TreeCell type. The GridStaticCellModel class is inherited to create this cell type. The plus/minus buttons of the tree nodes are selected by using the ImageIndex property.

Given below is a sample image.

GridFolderBrowser screenshot

Features

The following code example illustrates how to set the data from the data source.

 

	void GridQueryCellInfo(object sender, GridQueryCellInfoEventArgs e) 
	{
		if (e.RowIndex > 0 && e.ColIndex > 0)
		{
		      e.Style.CellValue = externalData[e.RowIndex - 1].Items[e.ColIndex - 1];
		      if (e.ColIndex == 1)
		      {
			e.Style.CellType = "TreeCell";
			e.Style.Tag = externalData[e.RowIndex - 1].IndentLevel;
			e.Style.ImageIndex = (int) externalData[e.RowIndex - 1].ExpandState;
		      }
		}
		e.Handled = true;
	}