Jump to content


Photo

DbGrid editing - limit column focus

dbgrid column focus

  • Please log in to reply
6 replies to this topic

#1 arilotta

arilotta

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 105 posts
  • LocationTrieste, Italy

Posted 09 July 2018 - 03:35 PM

Hi all,

I have a DbGrid with dgEditing=true.

I would like to limit the columns that can be selected, because some contains icons

and some other are text read-only.

I am struggling with ClientEvents and CellModel, but I not so familiar with JS and

I am wasting too much time.

 

So, how can I limit my grid to only focus on the third column for example ?

 

Thanks you all

 

Andrea


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 09 July 2018 - 07:39 PM

Hi,

 

At the moment, the column index is passed through "eOpts", and you can try this approach I think:

function cellModel.beforeselect(sender, record, index, eOpts)
{
    //colIndx = 2
    return (eOpts == 2);
}

  • 0

#3 arilotta

arilotta

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 105 posts
  • LocationTrieste, Italy

Posted 10 July 2018 - 06:55 AM

Hi Delphi Dev, unfortunately I don't have the "beforeselect" event on cellModel, just these 4:

 

- deselect

- focuschange

- select

- selectionchange

 

How come ?


  • 0

#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 10 July 2018 - 07:00 AM

Hi,

 

Wich build are you using ?!


  • 0

#5 arilotta

arilotta

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 105 posts
  • LocationTrieste, Italy

Posted 10 July 2018 - 07:22 AM

 build 1425


  • 0

#6 arilotta

arilotta

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 105 posts
  • LocationTrieste, Italy

Posted 11 July 2018 - 08:36 AM

Hi Delphi Dev, is "beforeselect" event not supported  in build 1425 ?


  • 0

#7 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 11 July 2018 - 08:44 AM

Hi,

 

Hi Delphi Dev, is "beforeselect" event not supported  in build 1425 ?

 

Unfortunately, does not support


  • 0





Also tagged with one or more of these keywords: dbgrid, column, focus

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users