TheSwamp

Code Red => .NET => Topic started by: Ricky_76 on April 13, 2011, 09:09:59 AM

Title: vb.net DataGvriView HorizontalScrollBar Problem [SOLVED]
Post by: Ricky_76 on April 13, 2011, 09:09:59 AM
Hi,

I have a little problem making the horizontal scrollbar of DataGrivView visible.
To be honest the bar appear when populating, but disappear as soon as the control is populated.

The dgv properties are setted correctly (imho):
- ScrollBars : Both
- Dock : Fill

If there is no solution to make it work, I'll need to know how to use an external
ScrollBar to "move" the DataGrivView inside his parent control.


Thanks
/r
Title: Re: vb.net DataGvriView HorizontalScrollBar Problem
Post by: n.yuan on April 14, 2011, 10:59:02 AM
How do you add columns to the DataGridView? At design time or at run time by code? How do you know the scroll bar is there when the datagridview is being populated?

If the columns are added at design time (with "Add Column" and "Edit Columns" dialog box in VS), when the total width if all columns is greater than the width of the DataGridView, does the scroll bar appear? It should, unless there is one or more columns' "AutoSizeMode" is set to "Fill", which would shrink one or more columns' width so that all columns would fit the DataGridView, thus no scroll bar is needed.
Title: Re: vb.net DataGvriView HorizontalScrollBar Problem
Post by: Ricky_76 on April 14, 2011, 12:25:27 PM
Hi yuan,

I add data by assigning a DataTable to the .DataSource property.

I know that the ScrollBar is visible because I see it when populating (1, 2 seconds).

thanks
/r
Title: Re: vb.net DataGvriView HorizontalScrollBar Problem
Post by: Ricky_76 on April 20, 2011, 11:10:35 AM
Ok, problem solved.

Was due to the code:

For Each column As DataGridViewColumn In dgv_mTelecamera.Columns
     column.Frozen = True
Next column


tnx
/r