cxGrid open blob field on row change

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 ) ??
LVL 22
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Simply place a TDBImage on your form and assign DataField and DataSource properties...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sinisa VukSoftware architectCommented:
Use dataset event OnAfterScroll and force combo to open (cell click). Try this one:

MyGridView.Columns[5].Focused := true;

Open in new window

But I wouldn't recommend this operation.
senadAuthor Commented:
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'
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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);
  if Assigned(Form2) then Form2.visible:= NOT cds1.FieldByName('YourBlobFieldName').IsNull;

Open in new window

Geert GOracle dbaCommented:
why not set the column as a preview column ?
senadAuthor Commented:
where ?
Geert GOracle dbaCommented:
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
senadAuthor Commented:
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 ?
Geert GOracle dbaCommented:
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
senadAuthor Commented:
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
senadAuthor Commented:
thanks for ideas .. I think I will use dbimage...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.