Datagrid Horizontal Scrollbar is Unusable
Hye. I have a datagrid which retrieves values from database. The datagrid contains only 1 column. Since some of the values in cells are long, we can only see half of the value. So, I enabled both of the scroll bars; the horizontal and vertical. But I can only use the vertical scroll bar while the horizontal scroll bar is unusable. Its color shows like it was disabled. Can anyone tell me how can I make it usable?
I place this code to enable both scroll bars:
Code:
dbgUserDefDocs.ScrollBars = dbgBoth
By the way, both scroll bars are automatically generated. I mean, I didn't put Hscrollbar or VScrollbar objects on the datagrid.
Re: Datagrid Horizontal Scrollbar is Unusable
The horizontal bar will only become enabled when the columns are wider than the viewport of the datagrid...
Re: Datagrid Horizontal Scrollbar is Unusable
You will need to increase the width of the column.
Re: Datagrid Horizontal Scrollbar is Unusable
I already tried to enlarge the column width. But the horizontal scroll bar is still unusable.
I even made the column width larger than the datagrid width, but still the same.
Re: Datagrid Horizontal Scrollbar is Unusable
Actually as far as I remember you don't even have to add the scroll bars by default they automatically appear as needed. If column(s) are wider than display port then the Horizontal one appears and if taller the vertical one appears.
The column would have to be wider than the view port though. I honestly have never tried it with just one column. Never saw a use for a grid with only one column so may something could be different.
Edit: I did a quick test and with a single column it does not allow to scroll across with the scroll bar. With more than one column it does. Why use a datagrid for a sinlge column of data? Seems like a list box or list view would be a better choice. If you must use a grid then you may want to try the flexgrid control or pull another field into the grid row number or something.
Re: Datagrid Horizontal Scrollbar is Unusable
oh really? well, I'm handling a simple alteration on an existing system. Since I'm new, so, I also don't know why they use datagrid. Anyway, thanks for your information. =)