Print Page | Close Window

preventing columnreordering after removing groupin

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=11214
Printed Date: 13 May 2024 at 5:53am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: preventing columnreordering after removing groupin
Posted By: BoboP
Subject: preventing columnreordering after removing groupin
Date Posted: 26 June 2008 at 8:53am
Hi ,

I don't want columns to be reordered, I have made the property AllowColumnReordering = false,
But when I group the records on clicking columns , and again for removing it when I place column somewhere else from dragged position ,It does allow column reordering.

How can i prevent that , the problem is I wanted to export record list to excel sheet. but when columns reordered , reportcontrol has its rows not reordered by column, bec'z of which . In excel sheet I get different values in different columns

 worksheet.Cells[i , j ] = ReportControl.Rows.Record[j].Value;
here Report control does not have reordered value

...... I would rather like column reordered list to export to excel sheet ....... but if not that I would at least need to prevent column reordering
 Any suggestion will be appreciated.






Replies:
Posted By: SuperMario
Date Posted: 26 June 2008 at 9:17am
You can use ItemIndex of the Column.  This value remains constant, and does not depend on the current order of the columns.  The ItemIndex is given at the time the Columns are added.  The ItemIndex will not change when the columns are moved (dragged and dropped to another location).  Since the Index of the column might change frequently (dragged\grouped), the ItemIndex is used when the column needs to be accessed.

http://https://forum.codejock.com/forum_posts.asp?TID=6415 - https://forum.codejock.com/forum_posts.asp?TID=6415


Posted By: Peter59
Date Posted: 26 June 2008 at 12:16pm
Hi,

maybe it is a workaround to handle ColumnOrderChanged event: iterate through all columns and compare properties ItemIndex and Index. If there is a difference, use Move method to move the column to the original position.

I agree, it would be better if AllowColumnReordering works as expected, even after removing a column from the grouping area...

Maybe we can expect a fixing with one of the next releases?

Peter



Posted By: Aaron
Date Posted: 26 June 2008 at 4:01pm
Originally posted by SuperMario SuperMario wrote:

You can use ItemIndex of the Column.  This value remains constant, and does not depend on the current order of the columns.  The ItemIndex is given at the time the Columns are added.  The ItemIndex will not change when the columns are moved (dragged and dropped to another location).  Since the Index of the column might change frequently (dragged\grouped), the ItemIndex is used when the column needs to be accessed.

http://https://forum.codejock.com/forum_posts.asp?TID=6415 - https://forum.codejock.com/forum_posts.asp?TID=6415
 
SuperMario,
 
It's nice to have the "exported" records in an order you want but the fact remains that you can still reorder columns. The same problem with DisableReorderColumnsCount: dragging a column to groupbox and back allows you to drop it anywhere you want (see my multiple issue post and sample project )
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: SuperMario
Date Posted: 27 June 2008 at 8:01am
It sounded to me like he would rather allow column reordering.


Posted By: Aaron
Date Posted: 27 June 2008 at 8:26am
Originally posted by SuperMario SuperMario wrote:

It sounded to me like he would rather allow column reordering.
 
SuperMario,
 
Please look at the first line BoboP wrote (in original post)


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: SuperMario
Date Posted: 27 June 2008 at 8:46am
I read the last line  He only wanted to prevent it because it wasn't exporting to his excel sheet the way he wanted.


Posted By: Aaron
Date Posted: 27 June 2008 at 9:16am
Originally posted by SuperMario SuperMario wrote:

I read the last line  He only wanted to prevent it because it wasn't exporting to his excel sheet the way he wanted.
 
SuperMario,
 
I look at the first sentence and I feel an issue bubbling up  I tested this and it is true. Do you want me to post one or add it to my list? btw the list still has issues left and now I have to add "and growing" ....
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: SuperMario
Date Posted: 27 June 2008 at 9:23am
Yes, add it to your list.  I'll make sure they are fixed in 12.1.0.  



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net