Grid companent...

Posted on 2005-03-17
Medium Priority
Last Modified: 2010-04-06

I need a grid companent that, it will be like excel grids.

I have to write formulas, make alignment, ability make cell border. these may be enough.

Do you know any companent like this?


Question by:koken
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Expert Comment

ID: 13565970
You might be able to embed an excel spreadsheet into your app if you use the OLEContainer component and user it just like excel.
Someone else might be able to give you code on how to do this or supply another alternative.

Author Comment

ID: 13565997
Thanks. But it must be without Excel.
LVL 15

Expert Comment

ID: 13566018
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

Dissaster earned 150 total points
ID: 13568009
Maybe the quantum grid from www.devexpress.com can help you. Take a look at them..
LVL 11

Expert Comment

ID: 13568244
You may also use TStringGrid ('Additional' tab) and draw contents of cells in onDrawCell event (this is really simple).
Here's a small example:

object StringGrid1: TStringGrid
  Left = 8
  Top = 24
  Width = 561
  Height = 369
  DefaultDrawing = False
  GridLineWidth = 0
  Options = [goEditing]
  TabOrder = 0
  OnDrawCell = StringGrid1DrawCell

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
  s : string;
with StringGrid1, Canvas do begin
  s := Cells[aCol, aRow];
  Pen.Width := 1;
  if gdSelected in State then Pen.Color := $000000 else
  if gdFixed    in State then Pen.Color := $888888 else
  Pen.Color := $dddddd;
  if gdSelected in State then Brush.Color := $eeeeee else
  if gdFixed    in State then Brush.Color := $dddddd else
  Brush.Color := $ffffff;
  Brush.Style := bsClear;
  with rect do
  if (length(s) > 0) and (s[1] = '=') then begin
    TextOut(left + (right - left - TextWidth('formula')) div 2, top + (bottom - top - TextHeight('formula')) div 2, 'formula');
  end else begin
    TextOut(left + (right - left - TextWidth(s)) div 2, top + (bottom - top - TextHeight(s)) div 2, s);

Notice that I've changed three settings for StringGrid1 to make it more "custom":
  DefaultDrawing = False
  GridLineWidth = 0
  Options = [goEditing] (removed )

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month13 days, 3 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question