Jump to content


Photo

Runtime Enable MultiSelect not woking in UniDBGrid


  • Please log in to reply
13 replies to this topic

#1 abhimanyu

abhimanyu

    Member

  • uniGUI Subscriber
  • PipPip
  • 15 posts

Posted 15 February 2017 - 05:55 AM

Hi,

When I try to enable multiselect of uniDBGrid on button click it was not working.
 

Below is code of button click, and attached a Demo as well.

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniDBGrid1.Options := UniDBGrid1.Options + [dgCheckSelect, dgRowSelect, dgMultiSelect];
end;


procedure TMainForm.UniButton2Click(Sender: TObject);
begin
  UniDBGrid1.Options := UniDBGrid1.Options - [dgCheckSelect, dgRowSelect, dgMultiSelect];
end;

 

Attached Files


  • 0

#2 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10356 posts

Posted 15 February 2017 - 06:42 AM

Hi,

 

Not all Grid options can be enabled/disabled at runtime. The only place that it can be done is Form's or Frame's OnCreate event.


  • 0

#3 abhimanyu

abhimanyu

    Member

  • uniGUI Subscriber
  • PipPip
  • 15 posts

Posted 15 February 2017 - 06:56 AM

Hi,

 

Not all Grid options can be enabled/disabled at runtime. The only place that it can be done is Form's or Frame's OnCreate event.

Is that any other way to enable multiselect or not?  


  • 0

#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 15 February 2017 - 07:11 AM

Hi,

 

You can use this approach for now:

 

1. Enable in designtime:

[dgCheckSelect, dgRowSelect, dgMultiSelect]

 

2. Your logic:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  //UniDBGrid1.Options := UniDBGrid1.Options + [dgCheckSelect, dgRowSelect, dgMultiSelect];

  UniDBGrid1.JSInterface.JSCall('getSelectionModel().deselectAll', []);
  UniDBGrid1.JSInterface.JSCall('getSelectionModel().setSelectionMode', ['MULTI']);
end;

procedure TMainForm.UniButton2Click(Sender: TObject);
begin
  //UniDBGrid1.Options := UniDBGrid1.Options - [dgCheckSelect, dgRowSelect, dgMultiSelect];

  UniDBGrid1.JSInterface.JSCall('getSelectionModel().deselectAll', []);
  UniDBGrid1.JSInterface.JSCall('getSelectionModel().setSelectionMode', ['SINGLE']);
end;

Best regards.


  • 2

#5 M477H13U

M477H13U

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 117 posts
  • LocationAix-en-Provence

Posted 05 June 2018 - 03:50 PM

Hello there everyones !! (:

 

I would like to have a confirmation on that matter:

 

http://forums.unigui...i-1100/?p=56137

 

Regards,


  • 0

M477h13U,

 

UniGUIVersion: 1.10.0.1458.


#6 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10356 posts

Posted 05 June 2018 - 04:08 PM

Hello there everyones !! (:

I would like to have a confirmation on that matter:

http://forums.unigui...i-1100/?p=56137

Regards,

Which one?

Sent from my SM-N950F using Tapatalk
  • 0

#7 M477H13U

M477H13U

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 117 posts
  • LocationAix-en-Provence

Posted 06 June 2018 - 07:29 AM

"Well, my main problem is that I want to switch grid option between dgRwoSelect to dgEditing programmatically ! Is that possible ?

If so, what approach should I take ?

 

Thanks for your time !   ^_^"


  • 0

M477h13U,

 

UniGUIVersion: 1.10.0.1458.


#8 M477H13U

M477H13U

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 117 posts
  • LocationAix-en-Provence

Posted 08 June 2018 - 01:09 PM

Hello Farshad, hello UniGUI Developers ! (:

 

I would really appreciate if you could at least tell me if it is already possible and I am doing something wrong or if it is not possible at the moment and you are searching a solution or if you are just thinking about it ..  -_-  :rolleyes:  ;)

 

Regards,


  • 0

M477h13U,

 

UniGUIVersion: 1.10.0.1458.


#9 M477H13U

M477H13U

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 117 posts
  • LocationAix-en-Provence

Posted 13 June 2018 - 07:32 AM

Hello UniGUI developpers !

 

I am still waiting for an answer concerning that matter.... 

 

 

Regards,


  • 0

M477h13U,

 

UniGUIVersion: 1.10.0.1458.


#10 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 13 June 2018 - 08:21 AM

Hi,

 

Sorry for delay, can you still use the "FreeAndNil" solution?

 

And I'm sorry that I again ask for clarification, what do you mean by saying "between dgRowSelect to dgEditing"?


  • 0

#11 M477H13U

M477H13U

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 117 posts
  • LocationAix-en-Provence

Posted 13 June 2018 - 03:39 PM

Hi,

 

Sorry for delay, can you still use the "FreeAndNil" solution?

 

And I'm sorry that I again ask for clarification, what do you mean by saying "between dgRowSelect to dgEditing"?

 

I thought that the FreeAndNil matter was fixed?..

 

Clarification:

  • Grid configured at conception with dgRowSelect.
  • User click on a button and it programmatically change grid configuration to dgEditing.

Regards,


  • 0

M477h13U,

 

UniGUIVersion: 1.10.0.1458.


#12 M477H13U

M477H13U

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 117 posts
  • LocationAix-en-Provence

Posted 18 June 2018 - 08:25 AM

Hello UniGUi users!

 

I wish I could have an answer concerning my question (waiting for two weeks now -_-) :

 

Clarification:

  • Grid configured at conception with dgRowSelect.
  • User click on a button and it programmatically change grid configuration to dgEditing.

Regards,

 

Is that possible or not ? :(

 


  • 0

M477h13U,

 

UniGUIVersion: 1.10.0.1458.


#13 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 18 June 2018 - 09:10 AM

Hello,

 

Sorry for delay

 

Not all Grid options can be enabled/disabled at runtime. The only place that it can be done is Form's or Frame's OnCreate event.

 

Sorry that maybe I do not really understand the situation, why you want that behavior,

But, we will try to find an approach if possible


  • 0

#14 M477H13U

M477H13U

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 117 posts
  • LocationAix-en-Provence

Posted 18 June 2018 - 09:54 AM

Hello,

 

Sorry for delay

 

 

Sorry that maybe I do not really understand the situation, why you want that behavior,

But, we will try to find an approach if possible

 

Well, our client need a grid where they can :

  • Some times select data for actions (PDF generation, validate data etc) --> dgMultiSelection
  • Some times Insert Update Delete data --> dgEditing

So in order to fulfill client's demands, we need a grid that is able to do these two things ..

 

For now, we are destroying the grid and recreating it with correct options..!


  • 0

M477h13U,

 

UniGUIVersion: 1.10.0.1458.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users