VirtualList Mode Problems |
Post Reply |
Author | |
MottoDoki
Newbie Joined: 16 September 2010 Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 16 September 2010 at 5:38am |
Hello everyone, I'm a little newbie in using this control, i have done research inside this forum but doesn't find any answers. I don't find a lot of information about SetVirtualMode option and samples are not very helpfull. So here is my problem : I would like to have a checkbox on one editable column and a format number on a non editable column For the format column i am using sample from this web page http://manpagesfr.free.fr/man/man3/printf.3.html My exemple is really simple using codejock 13.4.0, 1 form with 1 reportcontrol only Here the code : Option Explicit Private Const COLONNE_TEXT = 0 Private Const COLONNE_AMOUNT = 1 Private Const COLONNE_CHECKBOX = 2 Private Declare Function InitCommonControls Lib "Comctl32.dll" () As Long Private Sub Form_Initialize() InitCommonControls End Sub Private Sub Form_Load() RPList.Columns.DeleteAll RPList.Records.DeleteAll RPList.AllowColumnSort = True RPList.AllowEdit = True RPList.EditOnClick = True Dim RPColumn As ReportColumn Set RPColumn = RPList.Columns.Add(COLONNE_TEXT, "COLONNE_TEXT", 100, True) RPColumn.Editable = False Set RPColumn = RPList.Columns.Add(COLONNE_AMOUNT, "COLONNE_AMOUNT", 100, True) RPColumn.Editable = False RPColumn.Alignment = xtpAlignmentRight Set RPColumn = RPList.Columns.Add(COLONNE_CHECKBOX, "COLONNE_CHECKBOX", 100, False) RPColumn.Editable = True RPColumn.Alignment = xtpAlignmentIconCenter InitDataListe RPList.CreateIconViewAndRowNumberColumn RPList.SetCustomDraw xtpCustomBeforeDrawRow RPList.PaintManager.FreezeColsDividerColor = RGB(150, 150, 20) RPList.PaintManager.FreezeColsDividerStyle = RPList.PaintManager.FreezeColsDividerStyle Or xtpReportFreezeColsDividerBold RPList.Redraw End Sub Private Sub InitDataListe() RPList.SetVirtualMode 15000 RPList.Populate End Sub Private Sub RPList_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, _ ByVal Item As XtremeReportControl.IReportRecordItem, _ ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics) Select Case Item.Index Case COLONNE_TEXT Metrics.Text = "COLONNE_TEXT" Case COLONNE_AMOUNT Item.Format = "%aq.2f" Metrics.Text = "10214.12" Case COLONNE_CHECKBOX If Not Item.HasCheckbox Then Item.HasCheckbox = True Item.Editable = True Item.TristateCheckbox = False Item.CanEditCheckboxItem = False End If End Select End Sub When i click on the checkbox all the column has the checkbox check and my amount is never formatted but it should be like this in output : 10 214.12 Can anyone help me to figure what is the problem, there must be something i missed ? Thank You |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
I have to ask you this first: Do you load LOTS of data? (LOTS= >100000 records)
In Virtualmode you have only ONE record and data is filled dynamically (in BeforeDrawRow event)from external data (like array or recordset) BeforeDrawRow event will fire for every single item (cell) and you have to set the data ready to fill it dynamically.
Do you load LOTS of data? (LOTS= >100000 records)
If you think it takes a lot of time to load 100000 records (4 columns)? Takes about 1 second... If you are still interested, please let me know
|
|
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.... |
|
MottoDoki
Newbie Joined: 16 September 2010 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Hello,
Thank you for your answer, you right i don't think i will have more than 20 000 row, i'm going to do more test with big fill. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |