Click to See Complete Forum and Search --> : Scroll Bar in DataGrid


vchapran
May 17th, 2002, 03:05 PM
I'm adding columns to the DataGrid at run time this way:

Dim ts As DataGridTableStyle
Dim clnText As DataGridTextBoxColumn

DataGrid1.DataSource = dsDataSet
dgEmployees.DataMember = "Employees"
ts = New DataGridTableStyle()
ts.MappingName = "Employees"
clnText = New DataGridTextBoxColumn()
clnText.MappingName = "EmployeeID"
clnText.Width = 0
ts.GridColumnStyles.Add(clnText)

I'm adding many columns, they appear in the grid. The total width of all columns together is greater than the width of Grid, so horizontal Scroll Bar is added to the grid. Fine. The problem: when I click on the right button on the scroll bar the thumb and contents of the grid do not move. If I move the thumb at least just a little bit to the right by dragging with mouse then the right button works until the thumb is not on the most left position. It
looks like a bug. Does anybody know any trick to make the right button on the scrollbar work?
Thank you

Vlad

vchapran
May 22nd, 2002, 07:24 AM
I'm using this trick:
I'm adding all columns I need to be invisible at the end and set their width =1, not 0. Scroll bar works fine and columns almost invisible.
Vlad