Jump to content

UniDBGrid Options cannot change in runtime


Sanyi

Recommended Posts

  • 2 months later...

No. My Customer Portal Login is office@medianova.hu

I red it. 

 

"

Starting from yesterday uniGUI forums started using the new email forums@fmsoft.net. Previous email was info@fmsoft.net.

This means that all forum notifications will be sent from forums@fmsoft.net.

You may need to adjust your email server whitelist to avoid emails from forums@fmsoft.net to go into spam folder.

"

Link to comment
Share on other sites

5 hours ago, Sanyi said:

Done

Thanks.

On 11/11/2021 at 3:47 PM, Sanyi said:

UniDBGrid1.Options :=UniDBGrid1.Options+[dgRowNumbers]; not working!

For now, you can use the workaround.

1. In Design Time:

UniDBGrid1.Options -> include [dgRowNumbers]

2. Hide, for example OnFormReady event:

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  UniDBGrid1.JSInterface.JSCall('getColumnManager().columns[0].hide', []);
end;

2. Show:

  UniDBGrid1.JSInterface.JSCall('getColumnManager().columns[0].show', []);

 

Link to comment
Share on other sites

Just now, Sanyi said:

And what it with others?

Hmm...

Just now, Sanyi said:

I need to add or remove dgCheckSelect, dgMultiSelect, dgEditing. These will be working?

I think it's better for you to decide during the design time.

2 minutes ago, Sanyi said:

dgEditing

You can replace some options with properties, for example dgEditing with ReadOnly.

Link to comment
Share on other sites

Just now, Sanyi said:

but I need it runtime, it depends on some other values.

Specifically, what options did you check? Which ones work. At the beginning of the post, you didn't talk about other options.
In any case, you should be aware that not all settings can be changed at runtime.

But eventually you can re-create the grid at runtime.

Link to comment
Share on other sites

Hi Sherzod,

I tried your solution but not working.

1. I add dgRowNumbers in my formcreate. When I here call your solution, comes an error:

image.png.0a208078c7448e9ddd4df64dfe1224d8.png

2. When I add after form create with a button clikc, then I see the column, but without numbers:

image.png.bb38c6c2a69591c23f5af8dfffb90884.png

This is a very big projects, with more then 400 source files!

I need the runtime solution which works with Version 1546!

 

Regards,

Sándor

Link to comment
Share on other sites

Hi Sherzod,

I did it.

Conclusion:

1. I'm programming C++. Before I set these options with a pascal code: 

procedure AddUniDBGridOption(var dg :TUniDBGrid;opt :TUniDBGridOption);
begin
  dg.Options :=dg.Options+[opt];
end;

procedure RemoveUniDBGridOption(var dg :TUniDBGrid;opt :TUniDBGridOption);
begin
  dg.Options :=dg.Options-[opt];
end;
 

That works no more in new version. I set the options with C++ code for example Rownumbers: dg->Options =dg->Options+TUniDBGridOptions() <<dgRowNumbers. That works with both of old and new versions. Very strange....

 

But dgEditing don't works. Here I'm doing what your wrote: I set ReadOnly property of grid.

 

Thanks your help,

Regards,

Sándor

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