Click here to Skip to main content
15,886,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
anyone know how to add multiline in datagridview or listview in .net

[edit]Subject: Use a subject that describes your problem "Hi if anyone know ? let me know" is not at all helpful - OriginalGriff[/edit]
Posted
Updated 22-Nov-11 23:38pm
v2
Comments
Menon Santosh 23-Nov-11 8:30am    
in Asp.net or Windows Application

1 solution

You should be able to achieve this by setting the WrapMode of the DefaultCellStyle of your DataGridViewTextBoxColumn to true.



C#
private void MyGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
   {
       TextBox TB = (TextBox)e.Control;
       TB.Multiline = true;
   }
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900