Posted 8 March 2018, 1:12 am EST
Hi Michael!
I would like to suggest you a simpler way for this, using Editor property of column and AfterRowColChange event of the grid.
You can set following properties of TextBox control and assign this to the column’s Editor :
TextBox txtBox = new TextBox();
txtBox.Multiline = true;
txtBox.ScrollBars = ScrollBars.Both;
txtBox.WordWrap = true;
c1FlexGrid1.Cols[1].Editor = txtBox;
Next, you can start editing for the selected cell.
private void C1FlexGrid1_AfterRowColChange(object sender, RangeEventArgs e)
{
if(c1FlexGrid1.Cols[e.NewRange.c1].Editor is TextBox)
{
TextBox txtBox = c1FlexGrid1.Cols[e.NewRange.c1].Editor as TextBox;
c1FlexGrid1.StartEditing(e.NewRange.r1, e.NewRange.c1);
txtBox.SelectionStart = txtBox.Text.Length;
}
}
Attached is the sample for your reference.
Prj_ScrollbarsInCell.zip
Best regards,
Meenakshi