Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How Can i Display A long address in Datagridview column by breaking lines in single row.....
like that
Name Address Contact
Deepak Vill......... 23456
Dist......

Raj etc ........
Posted

SQL
In windows application, first of all you need to do is changing the DataGridView RowStyle so it can be auto sized based on your content

dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.Fill;
dataGridView1.RowsDefaultCellStyle.WrapMode = DataGridViewTriState.True;

then replace the comma by newline

Eval("test").ToString().Replace(",", System.Environment.NewLine);



Thanks
Sujeet
 
Share this answer
 
Comments
DeepakMahiChauhan 28-Feb-13 6:58am    
Eval("test").ToString().Replace(",", System.Environment.NewLine);
in this code what is Eval("tesh")
Eval("test") is your data. Please update and check it

Thanks
Suijeet
 
Share this answer
 

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