Jump to content

Show RowEditor RunTime


artem_niko

Recommended Posts

Hello!

At this moment I'm adding new record in database using this code:

(Sender as TUniDBGrid).DataSource.DataSet.Insert;

New empty string in UniDBGrid showing. 

But, I want that also will be showing and a RowEditor, as that him show when I make double click in UniDBGrid in row.

Like that:

image.png.5aa06a7843c096f0035727e30c6182ec.png

Need show RowEditor when adding new record in UniButtonOnClick.

How?

Link to comment
Share on other sites

2 minutes ago, Sherzod said:

Hello,

The editor should appear...

Well, if it would appear every time as expected, then this topic would not be. Sometimes it appears, and sometimes not, and in this case just an empty line is added (where the cursor also does not get up).
But I want the line to be added, and the cursor to appear in it and RowEditor also appear immediately. In other words - you need to emulate when you click on the UniButton event as UniDBGrid.OnBodyDblClick.

Link to comment
Share on other sites

  • 1 month later...

Hi,
I currently have a problem and would like to know if you have any idea how to solve it.
I have a code to insert a record in the grid with the insert key. The problem is that when the field is type float, time or date and it is not an index of the table and it also has an editor assigned to the column, it allows inserting the record only once, then no more.
I have a code to search the indexes of the table and I have a code that assigns editors to the fields type float, time and date.
Attached is a test case in case you want to see it and give me a hand.

GridEditor_Ads.zip

Link to comment
Share on other sites

hi,
I could already reproduce the problem in one of your demos and I describe it to you:

1.- When I double click on the 'salary' cell and activate the grid edition and select the insert key, I get an ajax error and it doesn't allow me to do anything else. I avoid this by writing the line before insert:
UniDbGrid1.CancelEditing (True); 
UniDbGrid1.DataSource.DataSet.Insert;
UniDbGrid1.CancelEditing (False);
I don't know if it is the best solution.
2.- I need to assign the column editors at runtime. For example assigning the editor of the column 'Salary' a UniFormattedNumberEdit1 in the OnShow of the form. 
When I assign the editor at runtime it happens that: By double clicking on the cell 'salary' and activating the edition of the grid and selecting the insert key, 
it inserts a new row perfectly, then I cancel the insertion with the X of the navigator and I try to insert a row in the same way again and it doesn't allow it.
For some reason it doesn't shoot the KeyDown event twice.

I have been able to notice that this happens when I have a combination of placing some columns of the grid in read-only (What I need to do in my project) and at the same time assigning editors at runtime (Which I also need). Could you take a look at this?

I have attached a test case where you can see everything I have described here.

I hope you can give me some idea of how to solve it.
 

GridEditor-TestCase.zip

Link to comment
Share on other sites

On 4/1/2020 at 11:29 PM, ygerdel said:

1.- When I double click on the 'salary' cell and activate the grid edition and select the insert key, I get an ajax error and it doesn't allow me to do anything else.

Hello,

Sorry for the late responce. Can you show this with a gif, video file?

Link to comment
Share on other sites

  • 1 month later...
On 4/7/2020 at 11:26 PM, ygerdel said:

Yes, I attached a video where you can see the effect described.

You can also see that it allows me to insert a record only once (with the insert key), the second time it does not allow inserting.

897261766 - AnyDesk 2020-04-07 15-08-02.zip

 

32 minutes ago, ygerdel said:

Do you have any news about this topic?

Hello,

Sorry, 

Can you make a test app? And please specify which build of UniGUI are you using?

Link to comment
Share on other sites

  • 3 weeks later...

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