简体   繁体   English

如何在Visual Studio 2008中的DataGrid中启用水平滚动条

[英]How to enable Horizontal Scroll bar in datagrid in Visual Studio 2008

I have a datagrid with atleast 10 columns in it. 我有一个至少有10列的数据网格。 But on loading the data the horizontal scroll bar does not show up. 但是在加载数据时,水平滚动条不会显示。 How to I get this fixed. 我该如何解决此问题。

Thanks in advance. 提前致谢。

PS I am using Visual Studio 2008 PS我正在使用Visual Studio 2008

Try this: 尝试这个:

columns has Frozen property set as True. 列的“冻结”属性设置为True。 which should be false for all columns. 对于所有列,它应该为false。

Edited : 编辑:

To Frozen property using column using the designer 使用设计器使用列冻结属性 冻结真

Click the smart tag glyph on the upper-right corner of the DataGridView control, and then select Edit Columns. 单击DataGridView控件右上角的智能标记标志符号,然后选择“编辑列”。 Select a column from the Selected Columns list. 从“选定的列”列表中选择一列。 In the Column Properties grid, set the Frozen property to true. 在“列属性”网格中,将Frozen属性设置为true。

    **or try this in code**

Set the DataGridViewColumn.Frozen property to true: 将DataGridViewColumn.Frozen属性设置为true:

dataGridView1.Columns("column").Frozen = True dataGridView1.Columns(“ column”)。Frozen = True

There's a Property named ScrollBars where you can select wich of the scrollbars you'd like to see. 有一个名为ScrollBars的属性,您可以在其中选择要查看的滚动条。 Default is Both . 默认值为Both

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM