Via the built-in search footer in the VCL TAdvStringGrid, it is easy and fast to locate data in a grid. This can be done via search and moving to or highlighting the matches or it can be done via narrow down. The default method is search. As the user types in the search edit, a search is performed in the grid and the grid moves to the first matching item. Optionally, other matching items are highlighted. When grid.SearchFooter.SearchColumn is set to a specific column index, the search is only performed in this specific column. In addition to this search method, a narrow-down is also possible. This is enabled by setting grid.SearchFooter.SearchType := stNarrowDown. While the user types in the search edit, all rows that do not match the condition are removed from the grid. Just like with regular search, the narrow-down can be performed on all column values or only on the specified column via grid.SearchFooter.SearchColumn. In this example, the search type is set to stNarrowDown, the search column to 5 and as the user types '6', only rows with cars with 6 cylinders are displayed: |
Suppose you want to make www.google.com clickable in a grid cell, you could do this by adding HTML formatted text : grid.Cells[1,1] := '<a href="http://www.google.com">www.google.com</a>'; An alternative shorter way is to use grid.URLShow = true. This will detect the protocol http:// as part of an URL. If you do not want to see the protocol however, you can set grid.URLFull := false. So, with these settings: Grid.URLFull := false; Grid.URLShow := true; Grid.Cells[1,1] := 'http://www.google.com'; The clickable link www.google.com will be automatically visible in cell 1,1: |
You can set this via: AdvEdit.LabelTransparent := false; AdvEdit.EditLabel.Color := clYellow; |
You can change the background color for a specific day via the event OnGetDayProp. This event for example, sets the background color for easter Sunday day to yellow: procedure TForm3.PlannerMonthView1GetDayProp(Sender: TObject; Date: TDateTime; var Caption: string; CaptionBrush: TBrush; AFont: TFont; var BKColor, BKColorTo: TColor); begin if date = encodedate(2017,4,16) then bkcolor := clYellow; end; You can add an additional text, also via this OnGetDayProp event: procedure TForm3.PlannerMonthView1GetDayProp(Sender: TObject; Date: TDateTime; var Caption: string; CaptionBrush: TBrush; AFont: TFont; var BKColor, BKColorTo: TColor); begin if date = encodedate(2017,4,16) then begin bkcolor := clYellow; Caption := 'easter'; end; end; You can specify a hint for a specific date via the event OnGetDateHintString: procedure TForm3.FormCreate(Sender: TObject); begin PlannerMonthView1.ShowHint := true; end; procedure TForm3.PlannerMonthView1GetDateHintString(Sender: TObject; dt: TDateTime; var isEvent: Boolean; var EventHint: string); begin if dt = encodedate(2017,4,16) then begin EventHint := 'easter'; end; end; |
This code snippet shows how to access the content of the richeditor and in this case, extract the text as plain text: var i: integer; el: TREElement; txt: TTextElement; s : string; begin s := ''; for i := 0 to AdvRichEditor1.Context.Content.Count - 1 do begin el := AdvRichEditor1.Context.Content.Items[i]; if el is TTextElement then s := s + (el as TTextElement).Text; if el is TLineBreakElement then s := s + #13#10; end; end; |
Assign a BitmapContainer to TTMSFMXRichEditor and add an image to the BitmapContainer and set its name, for example to 'Img1'. Next, insert a reference to this BitmapContainer via for example: TMSFMXRichEditor1.AddNamedPicture(32,32,'img1'); |
You can access the internal search editor for the TTMSFMXTableView component and customize the search text. Do this from the TMSFMXTableView .OnApplyStyleLookup event as when this event is triggered, the internal search edit control is created: procedure TForm1.TMSFMXTableView1ApplyStyleLookup(Sender: TObject); var edSearch: TTMSFMXSearchEdit; begin edSearch := TMSFMXTableView1.GetSearchEdit; edSearch.TextPrompt := 'Enter text to search here'; end; |
As always, we thank all users for the numerous inputs, feedback, comments and suggestions. This is an invaluable help to steer our developments here at TMS software. We continue to look forward to all your further communications to direct our team to provide you better tools and components for your needs.
Kind regards,
TMS software team
Email:
info@tmssoftware.com
Web: http://www.tmssoftware.com
Support, FAQ & Manuals: http://www.tmssoftware.com/site/support.asp