Board index » delphi » *** URGENT *** TListView *** URGENT ***

*** URGENT *** TListView *** URGENT ***

Greetings,

I have been searching for days now for some help with a few TListView
questions and no-one seems able to help. I cannot beleive that with all the
Delphi developers out there, Borland support staff and information sources
(web or otherwise) that no-one can help me. Here are my questions:

I am using a TListView in vsReport mode and using checkboxes.

My questions are:

1) how can I disable an item (no selection or checking of checkbos allowed)
in the TListView

2) how can I disbale the display of checkboxes next to some of the items.

Thanks in advance

Robert Lancasrer

 

Re:*** URGENT *** TListView *** URGENT ***


Robert,

Answers below

"Robert Lancaster" <robert.lancas...@thales-geosolutions.com> wrote in
message news:3d21426f_2@dnews...

Quote
> Greetings,

> I have been searching for days now for some help with a few TListView
> questions and no-one seems able to help. I cannot beleive that with all
the
> Delphi developers out there, Borland support staff and information sources
> (web or otherwise) that no-one can help me. Here are my questions:

> I am using a TListView in vsReport mode and using checkboxes.

> My questions are:

> 1) how can I disable an item (no selection or checking of checkbos
allowed)
> in the TListView

procedure TForm1.ListView1Changing(Sender: TObject; Item: TListItem;
  Change: TItemChange; var AllowChange: Boolean);
begin
  if (Change = ctState) and not {whatever condition} then
    AllowChange := False;
end;

Quote

> 2) how can I disbale the display of checkboxes next to some of the items.

AFAIK you would have to use an ownerdraw TListView.
Quote

> Thanks in advance

> Robert Lancasrer

Re:*** URGENT *** TListView *** URGENT ***


Quote
"Mark Williams" <mcg.willi...@{*word*269}.net> wrote:

>Robert,

>Answers below

>"Robert Lancaster" <robert.lancas...@thales-geosolutions.com> wrote in
>message news:3d21426f_2@dnews...
>> Greetings,

>> I have been searching for days now for some help with a few TListView
>> questions and no-one seems able to help. I cannot beleive that with all
>the
>> Delphi developers out there, Borland support staff and information sources
>> (web or otherwise) that no-one can help me. Here are my questions:

>> I am using a TListView in vsReport mode and using checkboxes.

>> My questions are:

>> 1) how can I disable an item (no selection or checking of checkbos
>allowed)
>> in the TListView

>procedure TForm1.ListView1Changing(Sender: TObject; Item: TListItem;
>  Change: TItemChange; var AllowChange: Boolean);
>begin
>  if (Change = ctState) and not {whatever condition} then
>    AllowChange := False;
>end;

>> 2) how can I disbale the display of checkboxes next to some of the items.

>AFAIK you would have to use an ownerdraw TListView.

>> Thanks in advance

>> Robert Lancasrer

Dear

   But the TListview.onchanging will invoke three times. How can I add ask message in Onchanging. for example

procedure TForm1.ListView1Changing(Sender: TObject; Item: TListItem;
  Change: TItemChange; var AllowChange: Boolean);
begin
  if  {whatever condition} then
    if Messagedlg(....) = IDYes then
          AllowChange := False;
end;

this messagebox will popup three times. How can I appear the messagebox once?I have controlled LVN_Listviewchanging message but I cannot resolve the problom

thanks
sparkle

Other Threads