Jump to content

Enter key in UniDBGrid


ITGuy

Recommended Posts

Hello there.
I have been struggling with this for days and have searched everywhere on the form. I want my enter key to move focus to the cell below it (next row) and immediately start editing it (almost like Excel). At this moment, when I press enter, it goes to the cell below but doesn't open the cell for editing. So I have to tap enter again. I just want to tap enter once, then move down, edit and tap enter again.
I am using Delphi 10.2 and UniGUI 1.90.0 build 1566.
Thanks for your assistance.

Link to comment
Share on other sites

object StockTakeGrid: TUniDBGrid
            Left = 16
            Top = 306
            Width = 729
            Height = 337
            Hint = ''
            CreateOrder = 6
            DataSource = DataSource1
            Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgMultiSelect, dgDontReloadAfterEdit]
            WebOptions.Paged = False
            WebOptions.PageSize = 100000
            WebOptions.KeyNavigation = knDisabled
            WebOptions.FetchAll = True
            WebOptions.RetainCursorOnSort = True
            LoadMask.Message = 'Loading data...'
            LayoutConfig.Region = 'center'
            TabOrder = 3
            Exporter.Enabled = True
            Exporter.FileName = 'Stocktake'
            Exporter.Title = 'Stocktake'
            OnKeyDown = StockTakeGridKeyDown
            OnClearFilters = StockTakeGridClearFilters
            OnSetCellValue = StockTakeGridSetCellValue
            OnColumnFilter = StockTakeGridColumnFilter
            OnAfterLoad = StockTakeGridAfterLoad
            Columns = <
              item
                FieldName = 'PRODUCTNAME'
                Filtering.Enabled = True
                Filtering.Editor = UniEdit10
                Title.Caption = 'Item Name'
                Width = 255
                ReadOnly = True
              end
              item
                FieldName = 'QUANTITYTOTAL'
                Filtering.Enabled = True
                Filtering.Editor = UniEdit12
                Title.Alignment = taCenter
                Title.Caption = 'Counted'
                Width = 80
                Color = 1551867
                Alignment = taCenter
              end
              item
                FieldName = 'MOVEOUT'
                Title.Alignment = taCenter
                Title.Caption = 'Move Out'
                Width = 80
                Color = 1551867
                Alignment = taCenter
              end
              item
                FieldName = 'MOVEIN'
                Title.Alignment = taCenter
                Title.Caption = 'Move In'
                Width = 80
                Color = 1551867
                Alignment = taCenter
              end
              item
                FieldName = 'UNIT'
                Filtering.Enabled = True
                Filtering.Editor = UniEdit11
                Title.Alignment = taCenter
                Title.Caption = 'Unit'
                Width = 75
                Alignment = taCenter
              end
              item
                FieldName = 'ST_COUNTED'
                Title.Alignment = taCenter
                Title.Caption = 'Adjusted'
                Width = 60
                Alignment = taCenter
                ReadOnly = True
              end
              item
                FieldName = 'STOCKDATE'
                Title.Alignment = taCenter
                Title.Caption = 'Last Count'
                Width = 100
                Alignment = taCenter
                ReadOnly = True
              end
              item
                FieldName = 'CATEGORIE'
                Filtering.Enabled = True
                Filtering.Editor = UniEdit14
                Title.Alignment = taCenter
                Title.Caption = 'Category'
                Width = 150
                Alignment = taCenter
                ReadOnly = True
              end
              item
                FieldName = 'COSTPRICE'
                Title.Alignment = taCenter
                Title.Caption = 'Cost Price'
                Width = 80
                Alignment = taCenter
                ReadOnly = True
              end
              item
                FieldName = 'RETAILPRICE'
                Title.Alignment = taCenter
                Title.Caption = 'Retail Price'
                Width = 80
                Alignment = taCenter
                ReadOnly = True
              end>
          end



Only the quantitytotal column is editable

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