Board index » cppbuilder » TListView
KL Chin
![]() CBuilder Developer |
KL Chin
![]() CBuilder Developer |
TListView2003-12-04 12:28:38 PM cppbuilder57 Hi, From what I know, when TListView was hide will have problem to access the TListView->Items data. It must be at least 1 pixel width and visible. Why? So my question how can I force TListView to create a node/item even it was hide. Regards KL Chin |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2003-12-04 01:30:46 PM
Re:TListView
"KL Chin" < XXXX@XXXXX.COM >wrote in message
QuoteFrom what I know, when TListView was hide will have QuoteSo my question how can I force TListView to create a Gambit |
KL Chin
![]() CBuilder Developer |
2003-12-04 01:55:55 PM
Re:TListView
Hi Remy,
Thx for ur reply. I will re-check again. Regards KL Chin "Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message Quote
{smallsort} |
Skybuck Flying
![]() CBuilder Developer |
2004-02-25 08:53:35 PM
Re:TListView
Hi
I miss an event in TListView TList.OnItemCheckboxClick or something like that ;) |
Skybuck Flying
![]() CBuilder Developer |
2004-02-25 08:59:08 PM
Re:TListView
Ah yes found other newsgroup message.
This even should do the trick :P*:D procedure TFormMain.ListViewReceiverMulticastMembershipChanging( Sender: TObject; Item: TListItem; Change: TItemChange; var AllowChange: Boolean); :) |
Skybuck Flying
![]() CBuilder Developer |
2004-02-25 09:02:12 PM
Re:TListView
Actually this OnChange is better than OnChanging for what I want to do...
Otherwise it is vice versa :d procedure TFormMain.ListViewReceiverMulticastMembershipChange( Sender: TObject; Item: TListItem; Change: TItemChange); begin if (Change = ctState) then begin if Item.Checked then begin ShowMessage('checked'); end else begin ShowMessage('unchecked'); end; end; end; |
Skybuck Flying
![]() CBuilder Developer |
2004-02-25 09:08:36 PM
Re:TListView
Hmmm seems like both events are needed to determine which property changed
:D Since these events are used for different properies doh. |
Skybuck Flying
![]() CBuilder Developer |
2004-02-25 09:33:02 PM
Re:TListView
Hmmm it's not as easy as it seems.
Many of these events occur.. which requires the checkbox checked state to be stored for each list item ! |
Skybuck Flying
![]() CBuilder Developer |
2004-02-25 09:59:19 PM
Re:TListView
Ok,
I found the solution. On adding and removing items prevent the OnChange and OnChanging events from happening ( These will otherwise occur a lot and for different items. For example when removing an item some of these event will happen becomes a select property changed... and then the checked property of another item is assign to the boolean which you dont want :D ) procedure ButtonAddOrRemoveClick Etc var TempOnChange : TLVChangeEvent; TempOnChanging : TLVChangingEvent; begin // prevent OnChange and OnChanging events from happening TempOnChange := ListView.OnChange; TempOnChanging := ListView.OnChanging; ListView.OnChange := nil; ListView.OnChanging := nil; // code to add or remove here // re-enable On Change Event ListView.OnChange := TempOnChange; ListView.OnChanging := TempOnChanging; end; FormVariable: var mReceiverMulticastMembershipItemChecked Then in OnChange: procedure TFormMain.ListViewReceiverMulticastMembershipChange( Sender: TObject; Item: TListItem; Change: TItemChange); begin if (Change = ctState) then begin // als deze twee verschillen dan is het verandert. if (mReceiverMulticastMembershipItemChecked <>Item.Checked) then begin if Item.Checked then begin ShowMessage('checked'); end else begin ShowMessage('unchecked'); end; mReceiverMulticastMembershipItemChecked := Item.Checked; end; end; end; And in onChanging: procedure TFormMain.ListViewReceiverMulticastMembershipChanging( Sender: TObject; Item: TListItem; Change: TItemChange; var AllowChange: Boolean); begin if (Change = ctState) then begin mReceiverMulticastMembershipItemChecked := Item.Checked; end; end; Hehe :) works perfectly (for so far tested :) :P ) {*word*30}ing yeah ! :D |
Curtis Richards
![]() CBuilder Developer |
2005-06-17 01:44:25 AM
Re:TListView
Can someone give me an example on how to set the fontstyle
on a listview row if its checked using the checkbox? Right now i am testing something small to make it work. I have five items in my listview with checkboxes enabled. When i check an item, i would like it to change the font style. Curtis |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-06-17 01:59:46 AM
Re:TListView
"Curtis Richards" < XXXX@XXXXX.COM >wrote in message
QuoteCan someone give me an example on how to set the Gambit |
Paul Smith
![]() CBuilder Developer |
2006-06-05 09:23:01 PM
Re:TListView
I am looking for a TListView type component that is fast and has auto-sorting when clicking on a column, preferably free. I am using D2005 and it needs to be available in the .net component pallete. I've tried TCoolListView, TdfsExtListView and TExtListViewCtrl but none of them seem to be compatible with D2005 .net or I am doing something wrong on package creation. Can anyon suggest where to get one from, preferably one that's tried and tested with .net Apps created in D2005.
Many thanks |
Douglas Hay
![]() CBuilder Developer |
2007-04-18 08:43:43 AM
Re:TListView
I have a TListView with ViewStype = vsReport, and the first time I add an
item the values do not appear. All additional items appear fine. TListItem *tli = ListViewLaps->Items->Add(); static int Lap = 1; if (tli) { tli->Caption = Lap++; tli->SubItems->Add(LapTime); tli->SubItems->Add(Pace); tli->SubItems->Add(Position); } I have this code attached to a button. The first time I click the button nothing appears. The second time it works and the Lap value displayed = 2. Thanks for any tips! Doug |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-04-18 09:11:24 AM
Re:TListView
"Douglas Hay" < XXXX@XXXXX.COM >wrote in message
Quoteif (tli) QuoteI have this code attached to a button. The first time I click |
DoctorC
![]() CBuilder Developer |
2008-03-14 11:49:37 PM
Re:TListView
Hi,
I need some tutorials or examples for this component Can anybody help me? Enrico |