Where's the DataGrid scrollbars (winforms) ?

  • Thread starter Fabrício de Novaes Kucinskis
  • Start date
F

Fabrício de Novaes Kucinskis

Hi all,

I have to problems concerning datagrids, tabcontrols and scrollbars:

1) I created a form with a TabControl. This TabControl has two TabPages: the
first with a datagrid to browse database records and the second with some
controls
(TextBoxes, OptionButtons...) to edit these records. When the second tab is
shown and I use the DataGrid's SetDataBind method, the grid scrollbars are
disabled.

2) Another problem is that the scrollbars appears in the middle of the grid
when loading the form. Its position are corrected when the user clicks the
grid, but I could'nt do this programatically. I tried to clear the datagrid
controls collection (DataGrid.Controls.Clear), but doing this the scrollbars
disapears, and its area are not repainted.

Does anyone knows how to solve these problems?
Thanks in advance,

Fabrício de Novaes Kucinskis.
 
T

Tobin Harris

Fabrício de Novaes Kucinskis said:
2) Another problem is that the scrollbars appears in the middle of the grid
when loading the form. Its position are corrected when the user clicks the
grid, but I could'nt do this programatically. I tried to clear the datagrid
controls collection (DataGrid.Controls.Clear), but doing this the scrollbars
disapears, and its area are not repainted.

Sorry, I can't offer any help here, but I have this problem in SqlBuddy
(http://sqlbuddy.sourceforge.net) and would really appreciate any
explanation/workaround anyone can offer! It's almost as if the datagrid
doesn't realise how much space it's consuming, and therefore shows
scrollbars for it's 'default' size. Any gurus got any thoughts on this? When
you do anything to cause the grid to redraw itself, the scrollbars
disappear, but as Fab said, you can't trigger this programatically.

Tobin Harris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top