Hi,
I've DGV with my custom List<myClass>
as DataSource.
I want the "DataGridViewTextBoxColumn
" that in this DataGridView to support Multiline property.
Could you help me with this please ?.
Thank you very much.
Hi,
I've DGV with my custom List<myClass>
as DataSource.
I want the "DataGridViewTextBoxColumn
" that in this DataGridView to support Multiline property.
Could you help me with this please ?.
Thank you very much.
You should be able to achieve this by setting the WrapMode
of the DefaultCellStyle
of your DataGridViewTextBoxColumn
to true
.
apart from setting wrap mode of the defaultcellstyle, you need to catch GridView's EditingControlShowing() Event, cast EventArgs object's Contorl property to one you want (textbox,checkbox or button) and using that Type of variable just change its mode as its done below...
` private void MyGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
TextBox TB = (TextBox)e.Control;
TB.Multiline = true;
}
`
Hope this works