本文介绍了如何在DataGriedview中显示一个列的长地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过打破单行中的行显示Datagridview列中的长地址.....

喜欢这样

名称地址联系

Deepak Vill ......... 23456

Dist ......



Raj等.. ......

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 ........

推荐答案

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);







谢谢

Sujeet




Thanks
Sujeet



这篇关于如何在DataGriedview中显示一个列的长地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 18:42