Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

cxGrid open blob field on row change

Posted on 2012-04-03
11
Medium Priority
?
2,217 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
[X]
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
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 19

Accepted Solution

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

Assisted Solution

by:Sinisa Vuk
Sinisa Vuk earned 400 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
Technology Partners: 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!

 
LVL 19

Assisted Solution

by:Thommy
Thommy earned 1200 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 38

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 38

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 400 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 38

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

688 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