Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Add Column index for AdvStringGrid at Design Time

 Post Reply Post Reply
Author
Wu Steven View Drop Down
New Member
New Member
Avatar

Joined: 12 Dec 2011
Posts: 2
Post Options Post Options   Quote Wu Steven Quote  Post ReplyReply Direct Link To This Post Topic: Add Column index for AdvStringGrid at Design Time
    Posted: 12 Dec 2011 at 4:36pm
I made some changes on AdvStringGrid to show a number index on design time. see the picture below:



Here is the code, very simple. I hope this can become a standard feature and I won't need change it every time when I upgrade the tms pack. thanks!

procedure TAdvStringGrid.ShowColumnHeaders;
var
  I: Integer;
begin
  if FixedRows > 0 then
    for i := 0 to FColumnHeaders.Count - 1 do
      if i < TotalColCount then begin
        if csDesigning in self.ComponentState then
          Cells[i,0] := IntToStr(i)+'-'+CLFToLF(FColumnHeaders)

        else
          Cells[i,0] := CLFToLF(FColumnHeaders);
      end;
end;
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8356
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 13 Dec 2011 at 5:05am
I'm not sure if this won't be confusing when users might think they get an unwanted index added.
Maybe we could at design time display a gray small index number in the top left or bottom right corner of fixed cells
and maybe have an option to turn it off in the quick config panel?
Back to Top
Wu Steven View Drop Down
New Member
New Member
Avatar

Joined: 12 Dec 2011
Posts: 2
Post Options Post Options   Quote Wu Steven Quote  Post ReplyReply Direct Link To This Post Posted: 14 Dec 2011 at 1:31pm
Originally posted by Bruno Fierens

I'm not sure if this won't be confusing when users might think they get an unwanted index added.
Maybe we could at design time display a gray small index number in the top left or bottom right corner of fixed cells
and maybe have an option to turn it off in the quick config panel?

that will work. the index is very convenient, I think everybody will love it. I use it for years, can't coding without it.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8356
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2011 at 10:12am
It will be optionally available in the next version of the grid
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down