在一个dataGridView控件中具有不同的对齐方式 [英] Having different alignment in one dataGridView control

查看:85
本文介绍了在一个dataGridView控件中具有不同的对齐方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有2列的dataGridView控件.我想将第一列的对齐方式设置为MiddleLeft,将另一列的对齐方式设置为MiddleCenter.你能让我怎样完成它吗?

非常感谢您

Hello,

I have a dataGridView control with 2 columns. I want to set the alignment of the first column to MiddleLeft and that of the other one to MiddleCenter. Could you please let me how I can get it done?

Thank you very much

推荐答案

dataGridView1.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;


如果您开始使用Google,可能会发现更快:尝试"C#datagridview列对齐",看看会发生什么.这样,您就可以继续使用它,而不必等待我们回复...:-D


You might find it quicker if you start to use Google: try "C# datagridview column alignment" and see what happens. That way, you will be able to get on with it and not wait for us to reply... :-D


请参阅

这篇关于在一个dataGridView控件中具有不同的对齐方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆