无法将类型为“System.Windows.Forms.DataGridViewTextBoxCell”的对象强制转换为类型“AdvancedDataGridView.TreeGridCell”。
 
void cells_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e)
{
// Exit if there already is a tree cell for this row
if (_treeCell != null) return; if (e.Action == System.ComponentModel.CollectionChangeAction.Add || e.Action == System.ComponentModel.CollectionChangeAction.Refresh)
{
TreeGridCell treeCell = null; if (e.Element == null)
{
foreach (DataGridViewCell cell in base.Cells)
{
if (cell.GetType().IsAssignableFrom(typeof(TreeGridCell)))
{
treeCell = (TreeGridCell)cell;  //错误出现的位置
break;
} }
}
else
{
treeCell = e.Element as TreeGridCell;
} if (treeCell != null) 
  _treeCell = treeCell;
}
}咋回事呢?