Hi everyone,
I'm trying to make a datagrid which allows custom components into cells. I used CellFormatting event of the radGridView. But when i use this event, something strange happening. I introduced the scenario with pictures as bellow;
First i open the form;
Please check 1.png
Then i resize the form;
Please check 2.png
Then i return back to its normal size;
Please check 3.png
Here's the code i wrote for cellformating;
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo is GridViewDataColumn && ((GridViewDataColumn)e.CellElement.ColumnInfo).Name == "column1")
{
//if (!(e.CellElement.RowElement is GridHeaderRowElement)) // I can't write this code because my codes can't find GridHeaderRowElement class.
{
if (e.CellElement.Children.Count > 0)
return;
ucTextBoxButton txt = new ucTextBoxButton();
txt.KeyDown += new KeyEventHandler(txt_KeyDown);
e.Column.ReadOnly = true;
ucGridViewTextBoxButtonColumn gridviewclm = new ucGridViewTextBoxButtonColumn(txt);
gridviewclm.StretchHorizontally = true;
gridviewclm.StretchVertically = true;
e.CellElement.Children.Add(gridviewclm);
}
}
}
Do you have any ideas?