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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Last Visible Column

Thread ID:





16648 Jul 21,2004 12:31 PM UTC Jul 21,2004 02:50 PM UTC WinForms 5
Tags: GridControl
Administrator [Syncfusion]
Asked On July 21, 2004 12:31 PM UTC

I''m trying to get the last visible column. You previously told me: this.ViewLayout.LastVisibleCol which works great, EXCEPT, I need to get it from the OnLayout() in my derived grid control, which is causing it to be out of date. For example, if I have 4 columns visible and resize to 3 columns visible, it will give me 4 instead of 3. Then if I resize to 4, it gives me 3. Basically, it''s a step behind. This happens even if I call base.OnLayout() first. Is there a way to get this number updated because I need it in the OnLayout to figure out whether or not to show my scroll bars. Thanks.

Administrator [Syncfusion]
Replied On July 21, 2004 01:06 PM UTC

Try calling this.ViewLayout.Reset before you try to access the this.ViewLayout.LastVisibleCol to see if that handles this problem.

Administrator [Syncfusion]
Replied On July 21, 2004 01:17 PM UTC

Nope. Same response...

Administrator [Syncfusion]
Replied On July 21, 2004 02:00 PM UTC

I do not think I see a problem in this sample. It seems to have the proper value of LastVisibleCol as I size the form. Do you see the problem in this sample? LayoutOverride_8594.zip

Administrator [Syncfusion]
Replied On July 21, 2004 02:19 PM UTC

It''s working fine in your example. When I do the same before & after tracing in my code, however, I get the same value both before and after, the base.OnLayout() call. Very strange. I''ll see if I can figure out some reason it''s not getting updated in the OnLayout call, but nothing is coming to mind at this point. Pete

Administrator [Syncfusion]
Replied On July 21, 2004 02:50 PM UTC

Found a solution. Kinda kludgy, but it works and doesn''t appear to have any noticeable side-effects. Thanks for your help. It got me looking in the right place. Pete


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon