Solved

cxGrid open blob field on row change

Posted on 2012-04-03
11
2,162 Views
Last Modified: 2012-04-11
I have a blob field in which I keep my pictures. I was wondering how can I have this field open automatically when I click on a row (or on row change ) ??
pic
0
Comment
Question by:senad
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 19

Accepted Solution

by:
Thommy earned 300 total points
ID: 37804793
Simply place a TDBImage on your form and assign DataField and DataSource properties...
0
 
LVL 26

Assisted Solution

by:Sinisa Vuk
Sinisa Vuk earned 100 total points
ID: 37804810
Use dataset event OnAfterScroll and force combo to open (cell click). Try this one:

MyGrid.SetFocus;
MyGridView.Columns[5].Focused := true;
MyGridView.Controller.EditingController.ShowEdit;

Open in new window


But I wouldn't recommend this operation.
0
 
LVL 22

Author Comment

by:senad
ID: 37804972
Assigning an image component would require me to enlarge the form which is as big as it is.

second suggestion raises :
[DCC Error] Unit1.pas(74): E2003 Undeclared identifier: 'Columns'
[DCC Error] Unit1.pas(75): E2003 Undeclared identifier: 'EditingController'
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 19

Assisted Solution

by:Thommy
Thommy earned 300 total points
ID: 37805112
You can place TDBImage control on a separate form (image form), which is automatically created

Set AfterScroll event of your ClientDataSet to make image form visible...

procedure TForm1.cds1AfterScroll(DataSet: TDataSet);
begin
  if Assigned(Form2) then Form2.visible:= NOT cds1.FieldByName('YourBlobFieldName').IsNull;
end;

Open in new window

0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37805336
why not set the column as a preview column ?
0
 
LVL 22

Author Comment

by:senad
ID: 37807051
where ?
0
 
LVL 37

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 100 total points
ID: 37810004
senad,
if the blob contains a picture ...
add a column of property type image
and set that column as preview column
and also set the preview property visible to true.

image will be shown inside the record
activating the indicator in grid view properties makes it more clear what 1 record is
 grid view images
0
 
LVL 22

Author Comment

by:senad
ID: 37812973
uggghhh...  comes out ugly. especially if you set autoheight to true. Is there a way to increase the image in the grid without setting the autoheight to true ? why does my picture field end up in the middle of the grid ?
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 37815335
ugly ? the right or the left skeleton ?
increase ?
the left margin ?

the preview takes up the total width of all columns
you can left/right/center align the pic using the margins
otherwise, use a image column
0
 
LVL 22

Author Comment

by:senad
ID: 37816183
dont like it ...what I had in mind was to open the blob field automatically when the row gets selected.
not on afterscroll because thats a performance suicide. But I think I will use a dbimage component to
proceed.
0
 
LVL 22

Author Closing Comment

by:senad
ID: 37832309
thanks for ideas .. I think I will use dbimage...
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE10, DigitalPersona Fingerprint reader and MySQL 6 335
Delphi 2 69
Error E2158 compiling with Delphi XE10 Seattle 2 115
Delphi android app hide keyboard 3 17
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 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