Jump to content

Unidbgrid append


heronim

Recommended Posts

Hello!

I need the user to reach the end of a grid by clicking on tab to insert a new line, automatically.
I need this line to be discarded when the user hits ESC or hits the up arrow
I need the user when entering a unidbgrid to automatically insert a blank line.

All these behaviors are common in any grid in Delphi, but I'm having a hard time implementing them in Unigui.

There are codes that deal with this in the forum like the one below, but they cause other problems and instabilities. How do I resolve this? Shouldn't these needs above be standard in Unigui?

procedure TMainForm.UniDBGrid1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
  isLastRecord: Boolean;
begin
  isLastRecord := (Sender as TUniDBGrid).DataSource.DataSet.RecNo = (Sender as TUniDBGrid).DataSource.DataSet.RecordCount;
  
  if (Key = VK_TAB)and(isLastRecord)and(TUniExDBGrid(Sender).CurrCol=(Sender as TUniDBGrid).Columns.Count-1) then
  begin
    // your logic
    (Sender as TUniDBGrid).DataSource.DataSet.Append;
  end;
end;

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
On 10/11/2022 at 11:54 PM, heronim said:

I prepared an example project, in addition to the "grid in dirt state" and "recno mismatch" error messages, focus is lost if all grids are active.

I will try to check your testcase. 

9 minutes ago, heronim said:

So my statement is correct, Unidbgrid is not for data inclusion

Not for displaying data you mean? If so, then your statement is incorrect.

Link to comment
Share on other sites

Hi, 
in "intensive" systems, user must insert data directly into grid cells.
Even if in web world this is a "strange" manner, we need direct input (with automatic append) on Dbgrids for porting Desktop applications, and this make differences with other competitor's systems because it's faster and more ergonomic.
Thanks to all
 

  • Like 2
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

I also need to append record sequentially in Dbgrid, but it seems that nobody have this need.
It's too difficult  to implement a working "VCL" datagrid input?
I remember that a "light" grid for fast data input was planned (like a cached update on client). There are news on this?
Thanks  
 

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