Hello all,
currently I am building a customized DataGridTextBoxColumn class.
I wish to override the GetMinimumHeight() method. I think this method
is being called by the DataGrid for each cell in the grid.
What I ofcourse want is to resize the height of rows according to
their
content. When the content has newlines the height should increase, so
all lines are visible in the grid.
I am able to do some resizing, it is pretty hairy though. I can't
figure out
in which order the GetMinimumHeight is called. More specifically;
I am calling GetColumnValueAtRow to determine which item to get the
height from, it does return values. But I have to take care of the
rowIndex myself, and this doesn't work correctly (the rowIndex
parameter in
the code below.)
What I need is a way for the baseclasses to determine which row is
being requested, maybe there is someone from Microsoft that can help
with a
way to override the GetMinumumHeight method?
protected override int GetMinimumHeight()
{
CurrencyManager cur = (CurrencyManager)
DataGridTableStyle.DataGrid.BindingContext
[DataGridTableStyle.DataGrid.DataSource];
string s = GetColumnValueAtRow(cur,rowIndex).ToString();
return CalcStringHeight(s);
}