Jump to content

unidbgrid direct input


jahlxx

Recommended Posts

hi.

 

open insert, edit and delete data directly typing in the dbgrid.

 

if vcl, with dbgrid readonly false, and dataset readonly false, and columns readonly false, I can directly modify a cell, insert a row, and so on.

 

but with unidbgrids, I can't find the way to do that.

Link to comment
Share on other sites

  • 1 year later...

Hi.

 

I'm back with this.

 

I still don't know how to do this.

 

I have this:

procedure Tfalbaranesvimp.dbimportKeyPress(Sender: TObject; var Key: Char);
var
  CurrCol: Integer;
begin
   currcol := lib.gridcol(dbimport);
   if currcol =  14 then begin
      if not (key in ['0'..'9','.','-']) then begin
         Key := #0;
      end
      else begin
          try
             qimp.edit;
             qimp.fieldbyname('qty').asstring := qimp.fieldbyname('qty').asstring + key;
          except
          end;
      end
   end;
end;

I have a numeric column in a grid, and whay press any valid key, want to put in edit mode and start writing, but I can't.

 

some help please.

Link to comment
Share on other sites

 

Yes, I've reviewed my post, but is not the same.

 

about this: http://forums.unigui...in-for-ext-js-4,

 

I read it before making this new post, and I'm trying to do, but I can't. pressing any key over not readonly column/field, does nothing.

 

perhaps I'm missing something.

 

Have you any sample?

 

Thanks.

Link to comment
Share on other sites

  • Administrators

Hi.

 

I'm back with this.

 

I still don't know how to do this.

 

I have this:

procedure Tfalbaranesvimp.dbimportKeyPress(Sender: TObject; var Key: Char);
var
  CurrCol: Integer;
begin
   currcol := lib.gridcol(dbimport);
   if currcol =  14 then begin
      if not (key in ['0'..'9','.','-']) then begin
         Key := #0;
      end
      else begin
          try
             qimp.edit;
             qimp.fieldbyname('qty').asstring := qimp.fieldbyname('qty').asstring + key;
          except
          end;
      end
   end;
end;

I have a numeric column in a grid, and whay press any valid key, want to put in edit mode and start writing, but I can't.

 

some help please.

 

A big NO here.

 

This kind of programming is something that you must AVOID in uniGUI.

 

Why aren't you simply using a column editor?

There are several examples under demo folder. Simply attach a numeric editor to your column.

There is no need to monitor keys on server side. It must be totally avoided.

Link to comment
Share on other sites

direct input, with no need to press enter key to edit.

 

 

Enviado desde mi SM-A500FU mediante Tapatalk

and direct insert for new record - no need for "Add button" in the navigator . it should behave like vcl dbgrid that when reach last column and press enter or tab or in any record when pressing down arrow the new record should be inserted. 

Link to comment
Share on other sites

  • 7 months later...

Hi, 

I have the same problem on editing.....

If I must convert desktop applications I need that UniDbgrid must be edited as Dbgrid, Append, navigate, and editing must be the same.
I need immediate editing pressing the first char in the cell, and I must navigate with data refreshed on editchanged event.

I'm locked in convert my Delphi application because my customers don't accept that they must press Enter for start edit; they want to edit typing data value in the cell and move to next cell with enter.

There are progress on this?

 

Thanks. 

Link to comment
Share on other sites

Hi.

 

I do this, and works for me. Sure must be a better way to do, but ...

 

in onkeydown of dbgrid:

 

   currcol := xdbgrid((sender as tunidbgrid)).CurrCol;

   if (key >= 96) and (key <= 105) then
      key := key - 48;

   if ((key >= 48) and (key <= 57)) or  // 0 .. 9
      ((key >= 65) and (key <= 90))     // A .. Z
    then begin
     if dbgrid.datasource.dataset.state <> dsedit then begin
        dbgrid.datasource.dataset.edit;
        dbgrid.datasource.dataset.fields[currcol].asstring := chr(key);
     end;
   end;
 

Link to comment
Share on other sites

I'm perfectly agree with you.

The problem is that Unigui is really powerful, but some LITTLE things don't permits me to present new project in "web" manner because  customers are used to working with speed and ergonomics in our desktop applications, and I cannot present the same features on web...

(we use Devexpress, Infopower, etc... so grids are very important and customers do not want to lose speed).
Farshad should introduce some little improvements and features in Unidbrid, so we can have direct input, editing cell and columns events and other things at CLIENT level.... (like my ancient request of partial fetching without paging....)

All this starting from the assumption that UNIGUI is fantastic.

 

  • Like 1
Link to comment
Share on other sites

Farshad should introduce some little improvements and features in Unidbrid, so we can have direct input, editing cell and columns events and other things at CLIENT level.... (like my ancient request of partial fetching without paging....)

 

+1

It is really necessary functionality.

Link to comment
Share on other sites

  • 5 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...