Solved

cxGrid open blob field on row change

Posted on 2012-04-03
11
2,108 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 25

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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now