Hi!
We are using NetAdvantage 2012.2:2038_SR and have an ultragrid where we allow the user to choose which columns to display. The problem is that the horizontal scroll accounts for all the columns not displayed as well... This means that there are about 8000 pixels to the right of the approx 1600 pixels used by the actual columns. This looks kind of silly, see attached screenshot
But that is manageble. What's worse is when we try to print this using a UltraGridDocumentExporter, the page scales to about 2.3 x 2.8 m to fit all the empty space and the text becomes completely unreadable when printing on any normal page size.
As you can see we use child bands but they fit well inside the the visible area and do not need the scroll.
Any ideas regarding how to solve this?
Best regards
Johannes Nordh
Hi Johannes,
I'm a little confused. If you are hiding columns in the grid using the Hidden property, then the grid will not leave any extra space. The only way something like this would happen is if you are hiding the columns by eliminating the UIElements using a CreationFilter or something like that. Are you using a CreationFilter to hide the columns? If so, why are you doing that instead of just using the Hidden property?
Hi Mike
We are using the hidden property to hide the fields we do not want to display.
Pseudo code (yes, in VB(!!!)) for what we are doing (on form load or ViewDefinition change). The real code is somewhat convoluted and partly in Swedish, hence the pseudo code.
For Each aColumn As UltraGridColumn In aBand.Columns aColumn.Hidden = True Next
Loop through our ViewDefinition myPositionInGrid += 1 aColumn = Find grid column corresponding to view column aColumn.Hidden = Not aViewColumn.Visible If Not aColumn.Hidden If Not aColumn.Width.Equals("0") Then If Not aColumn.Width.Equals(aViewColumn.Width) Then aColumn.Hidden = True aColumn.Width = aViewColumn.Width aColumn.Hidden = False End If End If End If aColumn.Header.Caption = aViewColumn.HeaderText 'Could this be the issue? Setting text on (possibly) hidden columns some logic to set aColumn.CellActivation Some logic to set aColumn.TextHAlign and aColumn.Header.Appearance.TextHAlign aColumn.VisiblePosition = myPositionInGrid 'Allow the view definition to sort the columnsEnd loop
Do you see anything iffy?
Hello Johannes,
I am following up to see if you have any additional questions or concerns regarding Mike S last post?
Hi
It's taking me a while to reproduce the problem in a small, uploadable project. There is quite a lot of code involved in the grid creation with DTOs left and right, serialization and enterbrise/business logic.
I will upload the project as soon as I am done...
The version we're using is mentioned in the first post, but it's 20122.2038_SR
Best regardsJohannes Nordh
While you are working on a sample, please let us know if you have any additional questions.