在c#win中,动态冻结右侧的列.形式 [英] Dynamically Freeze Column on Right side in c# win. form

查看:185
本文介绍了在c#win中,动态冻结右侧的列.形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#win中动态冻结右侧的列.形式?与冻结时一样,它停止显示滚动条.

How to Dynamically Freeze Column on Right side in c# win. form? As when freezing it, it stops showing the scroll bar.

dgvSales.Columns["Net Total"].Frozen = true;


净总计"列位于右上角.

在此先感谢


"Net Total" column exists in the extreme right corner.

Thanks in advance

推荐答案

我没有尝试过此解决方案,但它似乎有效:
http://stackoverflow.com/questions/3240201/in- datagridview-how-to-2-column-that-freeze [
I didn''t tried this solution, but it seems to be working:
http://stackoverflow.com/questions/3240201/in-datagridview-how-to-2-column-that-will-freeze[^]


尝试一下
dgvSales.Columns["Net Total"].DisplayIndex = dgvSales.Columns.Count


为什么要输入代码.请改用智能工具. ;)

要使用设计器冻结列:
>>从控件的智能标记中选择Edit Columns.
>> Select a column从选定的列"列表中.
>>在列属性"网格中,将Frozen 属性设置为true.
看来您可能传递了错误的列名.可能是拼写错误或单词之间的空格等.
因此,使列名称正确,然后尝试一下,
Why would go for code. Use smart tools instead. ;)

To freeze a column using the designer:
>> Choose Edit Columns from the control''s smart tag.
>> Select a column from the Selected Columns list.
>> In the Column Properties grid, set the Frozen property to true.

And it seems that you might have passed the wrong column name. Might be spelling mistake or the space between words etc.
So make a column name proper and give it a try like,
this.dataGridView1.Columns["ColumnName"].Frozen = true;


-KR


-KR


这篇关于在c#win中,动态冻结右侧的列.形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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