Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7720723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:44:38+00:00 2026-06-01T03:44:38+00:00

i m using stringgrid in my application.The data is fetched from the database(backend mysql)

  • 0

i m using stringgrid in my application.The data is fetched from the database(backend mysql) and displayed in stringgrid.

enter image description here

I want to insert image in status cell of each row.
i.e.

      if status =online then -->image1
      else --->image2

anyone has any idea regarding how to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:44:39+00:00Added an answer on June 1, 2026 at 3:44 am

    You will have to implement the OnDrawCell event.

    Example :

    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Longint;
      Rect: TRect; State: TGridDrawState);
    var
      s: string;
      aCanvas: TCanvas;
    begin
      if (ACol <> 1) or (ARow = 0) then
        Exit;
      s := (Sender as TStringGrid).Cells[ACol, ARow];
    
      // Draw ImageX.Picture.Bitmap in all Rows in Col 1
      aCanvas := (Sender as TStringGrid).Canvas;  // To avoid with statement
      // Clear current cell rect
      aCanvas.FillRect(Rect);
      // Draw the image in the cell
      if (s = 'online') then
        aCanvas.Draw(Rect.Left, Rect.Top, Image1.Picture.Bitmap)
      else 
        aCanvas.Draw(Rect.Left, Rect.Top, Image2.Picture.Bitmap);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Android TelephonyManager an application can obtain the state of data activity over the
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
I know it's important to keep user interface code separated from domain code--the application
I have a application that like firefox, can be enhanced from plugins available from
I would persuade a friend me that using Using Database Components (DB Aware Controls)
Using mercurial, I've run into an odd problem where a line from one committer
Using Visual SourceSafe's Open SourceSafe Database... command, there is an option at the bottom
How to print the content of a stringgrid using Rave report in Delphi?
I want to put a TCheckBox inside a TStringGrid in Delphi in every cell
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.