Jump to content

Help with RowControl of UniDBGrid1RowExpand?


sicoobcooplivre

Recommended Posts

 

 

 

procedure TFGENERARRESERVAS.UniDBGrid_VPEDDETRowExpand(Sender: TUniCustomDBGrid;
  const RowId: Integer; var RowControl: TControl; Container: TUniContainer);
var
  AUX:TFGENERARRESERVASAUX1;
  I:INTEGER;
  W_IDPEDDET:Int64;     //20210212 se cambia de integer
begin
  W_IDPEDDET := VPEDDET_CDS.FieldByName('IDPEDDET').AsLargeInt ;
  d.generarreservas_g_idpeddet := W_IDPEDDET;

  // mostrar una forma asociada al grid    EL AUXILIAR DEBE SER UN FRAME
 // AUX:= TFGENERARRESERVASAUX1.Create(Self );
 // AUX.p_idpeddet := VPEDDET_CDS.FieldByName('IDPEDDET').AsInteger ;
 //  RowControl := AUX.Create(Container);

  RowControl := TFGENERARRESERVASAUX1.Create(Container);
 // VPEDDET_CDS.RefreshRecord ;    //20210212

 

 

image.png.c7ac5873fbc85e30ed9d514dae95bc26.png

Link to comment
Share on other sites

What I need is to pass a value to the RowWidget that is expanded.
The user types some values outside the unidbgrid, in a uniedit, and I need to get the RowWidget that is expanded and pass a value to it!
If possible, it would solve my case, but if not, I think of another way to display the data!
Thank you for your attention!

Link to comment
Share on other sites

12 hours ago, sicoobcooplivre said:

The user types some values outside the unidbgrid, in a uniedit, and I need to get the RowWidget that is expanded and pass a value to it!
If possible, it would solve my case

Okay, if I understand your case correctly:

1. Using the standard demo as an example ->

\FMSoft\Framework\uniGUI\Demos\Desktop\Grid - RowWidget

2. DetailFrm -> We will change the value of UniEdit1.

image.png.14030a336eeb97c0b6146b6255aa3b6b.png

3. MainForm ->

Uses ..., System.StrUtils;

Usage:

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  I: Integer;
begin
  for I := 0 to UniDBGrid1.Owner.ComponentCount-1 do
    if UniDBGrid1.Owner.Components[I] is TUniContainerPanel then
      if StartsStr(UniDBGrid1.Name+'_'+UniDBGrid1.JSName+'_Row', UniDBGrid1.Owner.Components[I].Name) then
        if UniDBGrid1.Owner.Components[I].Components[0].FindComponent('UniEdit1')<>Nil then
          TUniEdit(UniDBGrid1.Owner.Components[I].Components[0].FindComponent('UniEdit1')).Text := 'NewValue'

end;

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...