i need help using listview custom
i need help using listview custom,
i didnt know why this crash,
read some sample using FilledListItem on binding,
but i always get crash,
any help,
sample include here listview_always_buggy
delphi berlin
procedure TForm1.LinkListControlToField1FilledListItem(Sender: TObject;
const AEditor: IBindListEditorItem);
var
LItem: TListViewItem;
begin
if AEditor.CurrentIndex > 0 then
begin
LItem := ListOrder_H.Items[AEditor.CurrentIndex];
LItem.Objects.DetailObject.Font.Size := 10; // crash here
LItem.Objects.AccessoryObject.Visible := False;
LItem.Objects.TextButton.Enabled := False;
LItem.Objects.TextButton.Visible := False;
if FDMemTable1.Active = True then
if FDMemTable1.RecordCount > 0 then
begin
if FDMemTable1.FieldByName('validasi_terkirim').AsString <> '' then
begin
LItem.Objects.AccessoryObject.Visible := False;
LItem.Objects.TextButton.Enabled := False;
LItem.Objects.TextButton.Visible := True;
LItem.ButtonText := 'Sdh dikirim';
end
else
begin
LItem.Objects.AccessoryObject.Visible := False;
LItem.Objects.TextButton.Enabled := False;
LItem.Objects.TextButton.Visible := False;
LItem.ButtonText := 'Open';
end;
end;
//LItem.Objects.ImageObject.Bitmap.Assign(Image1.MultiResBitmap[1].Bitmap);
end;
end;
i post here two day ago
http://community.embarcadero.com/answers/tlistview-crash-on-filledlistitem-binding
http://community.embarcadero.com/answers/tlistview-crash-on-filledlistitem-binding
i didnt know why this crash,
read some sample using FilledListItem on binding,
but i always get crash,
any help,
sample include here listview_always_buggy
delphi berlin
procedure TForm1.LinkListControlToField1FilledListItem(Sender: TObject;
const AEditor: IBindListEditorItem);
var
LItem: TListViewItem;
begin
if AEditor.CurrentIndex > 0 then
begin
LItem := ListOrder_H.Items[AEditor.CurrentIndex];
LItem.Objects.DetailObject.Font.Size := 10; // crash here
LItem.Objects.AccessoryObject.Visible := False;
LItem.Objects.TextButton.Enabled := False;
LItem.Objects.TextButton.Visible := False;
if FDMemTable1.Active = True then
if FDMemTable1.RecordCount > 0 then
begin
if FDMemTable1.FieldByName('validasi_terkirim').AsString <> '' then
begin
LItem.Objects.AccessoryObject.Visible := False;
LItem.Objects.TextButton.Enabled := False;
LItem.Objects.TextButton.Visible := True;
LItem.ButtonText := 'Sdh dikirim';
end
else
begin
LItem.Objects.AccessoryObject.Visible := False;
LItem.Objects.TextButton.Enabled := False;
LItem.Objects.TextButton.Visible := False;
LItem.ButtonText := 'Open';
end;
end;
//LItem.Objects.ImageObject.Bitmap.Assign(Image1.MultiResBitmap[1].Bitmap);
end;
end;
i post here two day ago
http://community.embarcadero.com/answers/tlistview-crash-on-filledlistitem-binding
http://community.embarcadero.com/answers/tlistview-crash-on-filledlistitem-binding
Put a breakpoint on the line where it crashes, and inspect the parts of your statements. Eg, Objects or DetailObject may be NIL.
ReplyDeletei know the line crash, but why, because in one row record is not crash, after add more row than crash.
ReplyDelete