tlistview

How may I add additional data for each existing item in a `TListView`?

瘦欲@ 提交于 2020-01-24 23:09:22
问题 I'm working with TListView and I have successfully populated each item's caption and first subitem. See example below. user pass working status valid data1 pass --- --- data2 pass2 ---- ----- - - - After populating each item, I acquire additional data for each item. I want to add this data to populate each item's 'working', 'status', and 'valid' columns. How may I add this additional data for each item? Each time I have tried, it appears the data is being stored in new items and displayed

Tlistview - There is any component like Tlistview but with DB access?

↘锁芯ラ 提交于 2019-12-24 22:47:39
问题 I've been trying to make a creative thing to avoid the dbgrids , and i've found the Tlistview (using the one from alphaskins , tslistview ), and seems to be a nice way! The problem is, I don't want to code the event onclick on every tlistview to position a record/dataset according to the item I selected on the tlistview .. and I'm doing it with the tlistview item's caption .. and there could be records with the same names Here is one of the codes I want to avoid: with q_find_process do begin

Center subitem images in a TListView

和自甴很熟 提交于 2019-12-24 00:43:20
问题 Is it possible to fix the drawing of subitem images in a TListView so that they are not cut-off on the left hand side as shown in the image? 回答1: Well, Pieter van Wyk , I did minimal example of how you can owner-draw your TListView component in order to center images in sub-items. Answer has been rewritten. In order to decrease size of answer I had deleted unused and wrong parts. Previous versions may be found in history of question editing. Picture below represents work of the new code. One

how auto size the columns width of a list view in virtual mode?

寵の児 提交于 2019-12-21 07:09:33
问题 When I use a TListView (ViewStyle = vsReport) I can autofit the width of the columns setting the LVSCW_AUTOSIZE or LVSCW_AUTOSIZE_USEHEADER values in the Width property of each column, now I start to use the Listview in virtual mode, but the width of the columns is not modified according to these values. So the question is : How I can adjust the width of the columns to fit to the content or header, when the lisvtiew is in virtual mode? 回答1: Since the list view in virtual mode don't know the

Delphi - Get and Set Scrollbar Position of a ListView

夙愿已清 提交于 2019-12-21 04:32:09
问题 It might seem like a silly & simple question, and yet, I've been unable to find a satisfying answer. Basically, I have a TListview (style = vsReport) with data. Sometimes, I have to update it, and therefore, I have to clear the listview and fill it again with the updated data. However, when I do that, the scrollbar position is reseted to 0. I would like to be able to get the scrollbar position before the clearing and set it back to what it was before. If the updated data has the exact same

Delphi XE2 listview artifacts

杀马特。学长 韩版系。学妹 提交于 2019-12-17 16:57:09
问题 I am using listview in vsreport virtual mode, have two columns and after I populate the list, select one row, and then select some other row there's an artifact left on a previously selected row, see image below. How to fix this? and this is my code that gets the data from an array procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem); begin Item.Caption := FloatToStr(Item.Index + 1); Item.SubItems.Add(FloatToStr(a[Item.Index])); end; When I hover the mouse, the artifacts dissapear

Create a customized Item Appearance for ListView Delphi XE7

僤鯓⒐⒋嵵緔 提交于 2019-12-17 12:38:22
问题 Im having a lot of trouble trying to create a customized item appearance for the TListView firemonkey control for Delphi XE7. What I want is to define my own "design" for what an item should be and use that item. For example : I would like to have an item with a Title(on top) - A Description(Middle) - A Date (Bottom) - Button(Right). I could not find any good documentation about this but i got some samples of how to create an TListView with muti details, but the problem is : that sample is

Create a customized Item Appearance for ListView Delphi XE7

烂漫一生 提交于 2019-12-17 12:38:12
问题 Im having a lot of trouble trying to create a customized item appearance for the TListView firemonkey control for Delphi XE7. What I want is to define my own "design" for what an item should be and use that item. For example : I would like to have an item with a Title(on top) - A Description(Middle) - A Date (Bottom) - Button(Right). I could not find any good documentation about this but i got some samples of how to create an TListView with muti details, but the problem is : that sample is

Fixing an error in a method declaration in a form in Delphi

你。 提交于 2019-12-08 07:16:54
问题 Why am I getting this error, I replaced a stringgrid with a listview, I then set it to viewstyle vsreport but I am getting an error like (expected '=' but '(' found) its flashing on this procedure below procedure TForm2.ListView2DblClick(Sender: TObject); this is my code uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, StdCtrls, ComCtrls; type TForm2 = class(TForm) Edit1: TEdit; Edit2: TEdit; ListView1: TListView; ListView2: TListView; procedure

How change text color in a column in TTNTListView?

China☆狼群 提交于 2019-12-07 19:03:21
问题 I use a TTNTListView in Delphi 7. It is set to vsReport. At OnCustomDrawSubItem event I use this code: procedure TForm.ListViewCustomDrawSubItem(Sender: TCustomListView; Item: TListItem; SubItem: Integer; State: TCustomDrawState; var DefaultDraw: Boolean); begin if SubItem = 2 then if (Item.SubItems.Strings[1] = Text1) or (Item.SubItems.Strings[1] = Text2) then Sender.Canvas.Font.Color := clGreen else Sender.Canvas.Font.Color := clRed; end; The problem is that all subitems >= 3 are drawn with