By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,934 Members | 1,449 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,934 IT Pros & Developers. It's quick & easy.

Redraw problem with .NET Datagrid.

P: n/a
I'm having a strange problem with a VB.NET App, and the built in
Windows.Forms.Datagrid

I have a tabbed interface, and a DataGrid (along with other controls) on
each of my two Tabs.

If the Datagrid on my first Tab has a horizontal scrollbar automatically
drawn because the table is too wide, and I switch to the other tab and
resize the form, when I switch back to the first tab, the horizontal
scrollbar on the datagrid is in the same position it was before the resize.
The Datagrid itself however, has been resized to the fill the form's new
size, such that the Horizontal Scroll bar appears to be floating in the
middle of the Datagrid, until I resize the app form from this tab.
Unfortunately, it only occurs intermittently, and more often when the
application is used via Terminal Server/Remote Desktop on a Windows 2000
Server. I have seen it occur in debug and release mode on my Windows XP SP1
Workstation, though not as often.

I've tried adding a DataGrid.Refresh() on the Tab Switch event to get it to
redraw, but it doesn't solve the problem 100% of the time, as I say, it's
still intermittent, though it seems to occur less frequently with the
..Refresh() calls.

Has anyone else seen this sort of behaviour before, or know what could be
causing it, or a solution?

Thanks.
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Try invalidate it instead of refresh.

Ken
----------------
"Kevin Hodgson" <ke***@caseware.com> wrote in message
news:O9**************@TK2MSFTNGP09.phx.gbl...
I'm having a strange problem with a VB.NET App, and the built in
Windows.Forms.Datagrid

I have a tabbed interface, and a DataGrid (along with other controls) on
each of my two Tabs.

If the Datagrid on my first Tab has a horizontal scrollbar automatically
drawn because the table is too wide, and I switch to the other tab and
resize the form, when I switch back to the first tab, the horizontal
scrollbar on the datagrid is in the same position it was before the resize.
The Datagrid itself however, has been resized to the fill the form's new
size, such that the Horizontal Scroll bar appears to be floating in the
middle of the Datagrid, until I resize the app form from this tab.
Unfortunately, it only occurs intermittently, and more often when the
application is used via Terminal Server/Remote Desktop on a Windows 2000
Server. I have seen it occur in debug and release mode on my Windows XP SP1
Workstation, though not as often.

I've tried adding a DataGrid.Refresh() on the Tab Switch event to get it to
redraw, but it doesn't solve the problem 100% of the time, as I say, it's
still intermittent, though it seems to occur less frequently with the
..Refresh() calls.

Has anyone else seen this sort of behaviour before, or know what could be
causing it, or a solution?

Thanks.

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.