Solved

cxGrid open blob field on row change

Posted on 2012-04-03
11
2,123 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

14 Experts available now in Live!

Get 1:1 Help Now