Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - preventing columnreordering after removing groupin
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

preventing columnreordering after removing groupin

 Post Reply Post Reply
Author
Message
BoboP View Drop Down
Groupie
Groupie


Joined: 21 March 2008
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote BoboP Quote  Post ReplyReply Direct Link To This Post Topic: preventing columnreordering after removing groupin
    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.



Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.

https://forum.codejock.com/forum_posts.asp?TID=6415
Back to Top
Peter59 View Drop Down
Groupie
Groupie


Joined: 19 July 2007
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote Peter59 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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.

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....
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2008 at 8:01am
It sounded to me like he would rather allow column reordering.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2008 at 9:23am
Yes, add it to your list.  I'll make sure they are fixed in 12.1.0.  
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.