We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Altering VisibleColumns does not reset Horizontal Scroll Bar Correctly

Thread ID:

Created:

Updated:

Platform:

Replies:

32562 Aug 3,2005 12:52 PM Aug 9,2005 02:42 PM Windows Forms 17
loading
Tags: GridControl
Eric Robishaw
Asked On August 3, 2005 12:52 PM

in the GridGroupingControl (2.5x): If I set the VisibleColumns the horizontal scroll bar does not reset. So, scrolling all the way to the right, there are still columns to the right. I can get to these columns by using the right-arrow on the keyboard to move right of the last showing column, which does force the grid to scroll. Here''s a snippet: tableDescriptor.VisibleColumns.Clear(); foreach (string colName in visibleCheckedColumns) { if (tableDescriptor.Columns.IndexOf(colName) != -1) { tableDescriptor.VisibleColumns.Add(colName); } }

Administrator [Syncfusion]
Replied On August 3, 2005 01:42 PM

You might try code like: this.gridGroupingControl1.Table.TableDirty = true; this.gridGroupingControl1.Refresh(); to see if that will handle this. There have been many changes to the GridGroupingingCOntrol since 2.5 that might affect this. Here is a little sample I where I tried to see this problem using 2.0.5.1. It seems to behave as expected. Can you modify it to show the problem? http://www.syncfusion.com/Support/user/uploads/GGC2051_69453ace.zip

Eric Robishaw
Replied On August 4, 2005 06:19 PM

I''ve modified your example to reproduce the problem. Just run it and w/o even clicking either of the buttons, you''ll see the horizontal scrollbar is wrong. GridTableDescriptor_5898.zip

Eric Robishaw
Replied On August 4, 2005 06:21 PM

Discovered problem occurs when you alter the headertext of the Descriptor columns!

Administrator [Syncfusion]
Replied On August 4, 2005 07:08 PM

I may be missing something, but here is theh screen I see when I run the sample. The scrollbar appears OK to me and seems to scroll OK. http://www.syncfusion.com/Support/user/uploads/pic_d11fed1e.zip Are you seeing something different, or am I missing something?

Eric Robishaw
Replied On August 5, 2005 09:48 AM

Hes, the Horizontal scrollbar is not showing a scroll region. See my screenshot. screenShot_8054.zip

Administrator [Syncfusion]
Replied On August 5, 2005 10:30 AM

Exactly what 2.x version are you using? I do not recall any 2.5.x public releases. The picture I uploaded is with with 2.0.5.1 using .NET 1.1 and WinXP. Have you considered upgrading?

Eric Robishaw
Replied On August 5, 2005 10:55 AM

Sorry, 2.0.5.1

Eric Robishaw
Replied On August 5, 2005 10:59 AM

Also, DotNet Framework 1.1 (1.1.4322, rev. 2032) and XP Pro, SP2 (Build 2600.050301-1519)

Administrator [Syncfusion]
Replied On August 5, 2005 11:39 AM

I am using the same OS and library version. And you get your picture running the exact sample you uploaded above, correct? Your grid comes up already scrolled. Mine comes up not scrolled. Mine shows themed headers, but yours does not. I am sort of at a loss here. If we could see the problem we may be able to suggest a work-around for 2.0.5.1, but without seeing I am not sure.

Eric Robishaw
Replied On August 5, 2005 03:04 PM

Great. What do you suggest? I''ve run on 3 different boxes, with differing results. My box (development) fails, the other two work. Any suggestions?

Eric Robishaw
Replied On August 5, 2005 03:09 PM

BTW, on my box it doesn''t show themed scroll bars, but on the working boxes it does. BUT...other windows (like Explorer, etc..., including the window I''m typing this message from) do show themed scroll bars. Just thought that might give a hint.

Administrator [Syncfusion]
Replied On August 5, 2005 06:35 PM

Have you tried turning off the themes on your system to see if that makes it work? this.gridControl1.ThemesEnabled = false; You could install the 3.x code base and try that. I will ask around here at Syncfusion to see if anyone else has any suggestions.

Eric Robishaw
Replied On August 6, 2005 02:22 AM

Yes. No effect. Also, setting: gridGroupingControl1.ShowNavigationBar = true; BEFORE populating and then to False AFTER populating causes the Horizontal Scroll bar to completely disappear altogether. Even tried UnDocking the grid, which has no effect. Is there any private / protect method that I can invoke through reflection that might force a resize of the H Scrollbar for now? We''re right in the middle of a mission critical project, and moving to 3.0 isn''t feasable right now. While customizing visibleColumns of the grid isn''t a show stopper, if I can use a reflection invoke of some hidden method to get us around the problem for now, I can make it work. As far as 3.0 is concerned: Can I load 3.0 demo on the same box w/ 2.0.5.1? >Have you tried turning off the themes on your system to see if that makes it work? > >this.gridControl1.ThemesEnabled = false; > > >You could install the 3.x code base and try that. > >I will ask around here at Syncfusion to see if anyone else has any suggestions. > > > >

Administrator [Syncfusion]
Replied On August 6, 2005 06:46 AM

>>As far as 3.0 is concerned: Can I load 3.0 demo on the same box w/ 2.0.5.1? Yes. But you would probably want to keep both 2.0 versions of your project and 3.2 versions of your project in separate folders though as the assmbly names have changed in teh 3.0 requiring you to use different referneces in that project. But the different names also make it much simpler for 2051 and 3210 to exist side by side. Since things work in that sample on two of your other systems, I think there is a chance that there is something specific on the non-working system that is causing this problem. If it is a glitch in the particular Framework installation, OS installation, or Syncfusion installation, then re-installing stuff might resolve it. But this would be a monumental undertaking with no reall assurance that it would resolve the problem. Here is something else to try in that sample. Take the all the code in the Form.Load handler and move it to the first button handler, commenting out the code that was there. Then run the project and see if the grid comes up ok if you populate from the button handler. If it does, then you can move the code back to Form.load, and at the bottom of form.Load add a timer that triggers a refresh of the grid after a slight pause. At the bottom of FormLoad, add timer, and put code in the tick event. //bottom of form.Load Timer t = new Timer(); t.Interval = 40; t.Tick += new EventHandler(t_Tick); t.Start(); //the handler private void t_Tick(object sender, EventArgs e) { Timer t = sender as Timer; t.Stop(); t.Dispose(); //just acces teh columns object. int count = gridGroupingControl1.TableDescriptor.Columns.Count; gridGroupingControl1.Table.TableDirty = true; gridGroupingControl1.Refresh(); }

Eric Robishaw
Replied On August 8, 2005 01:11 PM

No such luck moving event to button handler. Also... while this simple test DOES work on 2 other machines, the full project that the sample was attempting to mimick DOES NOT. i.e., I get the horizontal scroll behavior on all machines. I haven''t taken the time to narrow down what''s difference, since I could duplicate it with minimal effort on my box. Anyhow, I''m going to try 3.0 to see if that solves the problem.

Eric Robishaw
Replied On August 9, 2005 02:05 PM

Version 3.2.1.0 Does the same thing!!!!! There''s got to be something I can explore here. Are there any new exposed methods in 3.2 that would allow me to force the grid to recalc the h-scroll bar? HELP! Eric

Eric Robishaw
Replied On August 9, 2005 02:42 PM

Update: Adding an Application.DoEvents() between filling the grid and altering the Header Columns fixes the problem w/ 3.2.1.0.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;