Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2244
  • Last Modified:

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 ) ??
pic
0
senad
Asked:
senad
  • 5
  • 3
  • 2
  • +1
4 Solutions
 
ThommyCommented:
Simply place a TDBImage on your form and assign DataField and DataSource properties...
0
 
Sinisa VukCommented:
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
 
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'
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ThommyCommented:
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
 
Geert GruwezOracle dbaCommented:
why not set the column as a preview column ?
0
 
senadAuthor Commented:
where ?
0
 
Geert GruwezOracle dbaCommented:
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
 
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 ?
0
 
Geert GruwezOracle 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
0
 
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
proceed.
0
 
senadAuthor Commented:
thanks for ideas .. I think I will use dbimage...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now