Jump to content

Dynamical works's with DBGRID


Skyp

Recommended Posts

Hi. 

Do not display values in BDGrid.
Processing fields in a query (q_for_users1) is as follows:
// Query - good job
 for I := 0 to FieldCount-1 do
         begin
           s:='';
           for j := 0 to pos('.',Field_list)-1 do
             begin
                  s:=s+Field_list[j];
             end;
             for j := pos('.',Field_list)+1 to Length(Field_list) do
             begin
                  s:=s+Field_list[j];
             end;
               with Q_for_users1 do
               begin
         Fields.Name:=Trim(s);
        fields.DisplayLabel:=Field_list;  // Field_list list of allowed characters
           Fields.Visible:=true;

                       end;
         end;
 
Anddd insert a Grid:
-------------------------------------------------------------------------------------------------------------------
  with UniMainModule do
      begin
        DATASOURCEUSER.Enabled := false;
        DATASOURCEUSER.DataSet := Q_for_users1;
        UniMainModule.DATASOURCEUSER.Enabled := true;

      end;
 

 uniSession.AddJS((obj_out as TuniDBgrid).JSName+'.store.suspendEvents();');
         (obj_out as TuniDBgrid).BeginUpdate;

   (obj_out as TuniDBgrid).DataSource := DATASOURCEUSER;
      for i := 0 to Field_list.Count - 1 do
      begin

        if (obj_out is TuniDBgrid) = true then
        begin
          with (obj_out as TuniDBgrid) do
          begin
            (obj_out as TuniDBgrid).Columns.Add;
            //   s:=  unimainmodule.Q_for_users1.fields.Name;
            (obj_out as TuniDBgrid).Columns.Visible := true;
       (obj_out as TuniDBgrid).Columns.FieldName :=Q_for_users1. fields.Name;
            (obj_out as TuniDBgrid).Columns.title.Caption := Field_list;
            (obj_out as TuniDBgrid).Columns.Width := 100;

          end;
        end;
    end;
    (obj_out as TuniDBgrid).endupdate;
         uniSession.AddJS((obj_out as TuniDBgrid).JSName+'.store.resumeEvents();');
        uniSession.AddJS((obj_out as TuniDBgrid).JSName+'.view.refresh();');
    end;

-------------------------------------------------------------------------------------

 All runs without error but in the Grid cell (their number corresponds to the limit in the query) are empty.  Who faced?

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...