Print Page | Close Window

Add Column index for AdvStringGrid at Design Time

Printed From: TMS Software
Category: General
Forum Name: Feature Requests
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=1026
Printed Date: 20 Sep 2019 at 3:59pm


Topic: Add Column index for AdvStringGrid at Design Time
Posted By: Wu Steven
Subject: Add Column index for AdvStringGrid at Design Time
Date 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;



Replies:
Posted By: Bruno Fierens
Date 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?


Posted By: Wu Steven
Date 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.


Posted By: Bruno Fierens
Date Posted: 15 Dec 2011 at 10:12am
It will be optionally available in the next version of the grid



Print Page | Close Window