views:

85

answers:

1

I have one user control named XtraTreeList(It is combination of the treeview and datagridview) in which I want to get the location of the cell and nodes, but I can not find any property or method for that. Anyone have used it or any idea about that?

Or can I use the graphics approach to find the location of the cell or nodes ? Like, through the text of the cell can I get the location of the cell in the XtraTreeList with the help of the graphics?

+1  A: 
private Rectangle GetCellBounds(TreeList tree, TreeListNode node, int cellIndex)
{
    RowInfo ri = tree.ViewInfo.RowsInfo[node];
    if (ri == null) return Rectangle.Empty;

    CellInfo ci = tree.ViewInfo.RowsInfo[node].Cells[cellIndex] as CellInfo;
    return ci.Bounds
}

This function can be used to get the bounds of the cell.

Harikrishna