Jump to content
uniGUI Discussion Forums
Sign in to follow this  
jahlxx

unidbgrid direct input

Recommended Posts

hi.

 

how to direct input data in a unidbgrid.

 

the grid is not radonly, th dataset is not readonly, the columns are not readonly, but I can't direct input data in the grid.

 

why?

 

thanks.

 

Share this post


Link to post
Share on other sites
the grid is not radonly, th dataset is not readonly, the columns are not readonly, but I can't direct input data in the grid.

why?

 

Hi,

 

Sorry, what do you mean?

 

Best regards.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
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;
 

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Any news on this feature?
I need to start typing in cell without press Enter, and move focus to next column when press Enter after finish editing...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×