Hello everyone I'm trying to register invoice lines using GridGroupingControl.
As I have a set of doubts, I attach a small example so you can understand what I need
1) In the first column I have a combo duly filled in. How can I make it appear filled with the first element of the Combo by default?
2) If, after choosing the element I want in the combo, pressing the Return key adds the line to the grid. But using the TAB key or the mouse no longer does it.
How can I force the same behavior as the Return key?
3) how can I force column change in grid when pressing return key?
4) when pressing the return key in the last editable column of the grid, how can I change to the first column of the next row.
5) I am validating the grid cell contents in Grelha_TableControlCurrentCellValidating. When I press the CTRL+L keys, I'll get information for the grid and the database. I fill the Grid columns with this information. How can I force it to go through Grid_TableControlCurrentCellValidating in order to validate the information obtained.
hoping someone can help me :-)
Ricardo
Thanks for your help
Keep Safe
Ricardo
|
Queries |
Solutions | |
|
In the first column I have a combo duly filled in. How can I make it appear filled with the first element of the Combo by default? |
Your requirement to add the first element of the Combo by default value in AddNewRecord of GridGroupingControl can be achieved by using ShowDefaultValuesInAddNewRecord and DefaultValue properties. Please refer the below code snippet,
| |
|
If, after choosing the element I want in the combo, pressing the Return key adds the line to the grid. But using the TAB key or the mouse no longer does it.
How can I force the same behavior as the Return key?
|
Your requirement to add the new row to the grid when pressing tab key or mouse click can be achieved by customizing the TableControlCurrentCellEditingComplete event in GridGroupingControl. Please refer the below code snippet,
| |
|
how can I force column change in grid when pressing return key? |
Your requirement to move focus to next column when pressing return key in GridGroupingControl can be achieved by setting GridDirectionType.Right for EnterKeyBehavior property in GridGroupingControl.Table.TableModel.Options. Please refer the below code snippet,
| |
|
when pressing the return key in the last editable column of the grid, how can I change to the first column of the next row.
|
Your requirement to move focus to the first column of the next row when pressing return key in last column in GridGroupingControl can be achieved by setting GridWrapCellBehavior.WrapRow for WrapCellBehavior property in GridGroupingControl.Table.TableModel.Options. Please refer the below code snippet,
| |
|
I am validating the grid cell contents in Grelha_TableControlCurrentCellValidating. When I press the CTRL+L keys, I'll get information for the grid and the database. I fill the Grid columns with this information. How can I force it to go through Grid_TableControlCurrentCellValidating in order to validate the information obtained.
|
Your requirement to validating the grid cell contents when pressing return CTRL+L keys in GridGroupingControl can be achieved by calling the CurrentCell.Validate method in e.TableControl. Please refer the below code snippet,
|
Thanks for your help :-)
i will try the solutions that you provided
Have a nice weekend, and keep safe.
Good Morning
my apologies for returning to this subject so late.
The example sent, which along with some more parameterizations, has two problems.
1 - I can't get it to go to the event Private Sub OnTableControlCurrentCellKeyUp(ByVal sender As Object, ByVal e As GridTableControlKeyEventArgs)
2 - when filling in the fields of the line, the column where it was done Ctrl + L, does not show the value. and so when going %_TableControlCurrentCellValidating doesn't have any value to validate
Hi Ricardo,
We have analyzed the sample you provided and found that the reason for the event not getting executed is because the respective event was not declared. Please find the below code snippet,
|
'Added the Event declaration AddHandler gridGroupingControl1.TableControlCurrentCellKeyUp, AddressOf OnTableControlCurrentCellKeyUp |
We have attached the modified sample, please find it in the attachment.
If you have any queries or concern, please revert to us. We are here to assist you.
Regards,
Sreemon Premkumar M.
Hello Sreemon
yes i have a question, and it's the most important of all :-)
The purpose of doing Ctr+l is to open a list with the set of records that can be used and chose one.
what happens is that the value that this list returns is not in the grid cell.
and so when you go to validating the cell is empty.
so i press ctrl + l on CustomerID columm
after that it gos into the image above
Captura de ecrã 2023-07-21 173034
and then if fills the row except the colunm where the ctrl + L was pressed
Hi Ricardo Abranches,
Currently, we are analyzing your reported scenerio. We will validate and update you the details on or before July 26, 2023.
We appreciate your patience until then.
Regards,
Chidanand M
Hi Richard Abranches,
Based on the information provided, we analyzed the reported scenerio. When a cell is in edit mode, it contains a text box. The Display Element is not bound to the textbox in WinForms. As a now the text box is empty, if you try to validate the current cell immediately, the value in the text box will be validated, leading to the particular cell being empty. To overcome this issue, you can select the cell and then use the Escape key to exit from the edit mode or set ActivateCurrentCellBehavior to GridActivateAction.DblClickOnCell.
Please refer the below code snippet:
|
[VB] gridGroupingControl1.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell |
Please refer to the UG documentation about GridGroupingControl for your reference.
If you have any issues or queries, feel free to reach out to us. We are here to assist you.
Regards,
Chidanand M.
it is working. Thanks :-)
Best regards
Hi Ricardo Abranches,
We are glad that the provided response meets your requirement. Please let us know if you need further assistance. As always, we are happy to help you out.
Regards,
Chidanand M
I apologize for returning to this subject, but there is a situation that I have not yet been able to resolve.
the last column of the grid is read only. The aim is that when you press ENTER or TAB in that column, the grid changes to a new line in insertion mode. I send an example below,
the colunm name is "ValorLinha"
Hi Ricardo Abranches,
Your requirement can be achieved by using the AddNew method in the TableControlCurrentCellKeyUp event. We have modified the sample to meet your requirement. You can find the sample in the attachment.
Kindly refer the below mentioned code snippet:
|
if(e.TableControl.CurrentCell.ColIndex == 10 && e.Inner.KeyCode == Keys.Enter) { e.TableControl.Table.AddNew(); } |
We hope this helps. Please let us know, if need any further assistance.
Regards,
Chidanand M
Hello
I'm returning to this subject, because I still can't "master" the grid
1) Image P1.png - How can I do it so that when leaving the second textbox the first column of the grid is selected
2) Image p2.png - if you click on the combo in column one, and then press ENTER, a grid line is created below the initial one. If you don't click on the combo, this line is not created. This situation only happens in the first row. How can I make the behavior of the first row the same as the rest.
3) Image p3.png - If in the first column of the row you press the Up cursor button, a row is added at the end of the Grid. How can I avoid this situation?
4) Image P4.png - When, after filling in some rows, I click on the button, a row is added at the end of the grid. How can I avoid this situation.
Images and example attached
Hi Ricardo Abranches,
Could you please provide the reference images you mentioned in the previous response. It will be helpful for us to better understand of your requirement.
Regards,
Chidanand M.
Hi Ricardo Abranches,
Currently, we are analyzing your requirement. We will validate and update you the details on or before November 09, 2023.
We appreciate your patience until then.
Regards,
Chidanand M.
Hi Ricardo Abranches,
We are little bit unclear about your second query. Could you please explain about your query, do you want to make the behavior of the first row the same as the rest or first column the same as the rest.
By providing this information, we can gain a better understanding of the issue and work towards finding a prompt resolution.
Regards,
Chidanand M.
On the contrary, what I need is for the first row to have the same behavior as the following ones.
Regards
Hi Ricardo Abranches,
Currently, we are analyzing your requirement. We will validate and update you the details on or before November 20, 2023.
We appreciate your patience until then.
Regards,
Hi Ricardo Abranches,
Sorry for the inconvenience.
We need more time to analyze your requirement. We consider this as a high priority and will provide an update on or before November 22, 2023.
Regards,
Chidanand M.
Hi Ricardo Abranches,
Please find the response for your queries
|
How can I do it so that when leaving the second textbox the first column of the grid is selected |
Your requirement
can be achieved by setting the WantTabKey as false and then Set the focus to
the GridGroupingControl in TableControl.KeyUp event. Kindly refer the
below code snippet
|
|
|
if you click on the combo in column one, and then press ENTER, a grid line is created below the initial one. If you don't click on the combo, this line is not created. This situation only happens in the first row. How can I make the behavior of the first row the same as the rest. |
The first row is the AddNew record. So, if you enter text and then press Enter, it will create a new row. If you want to stop the process, you can set Grid.TableDescriptor.AllowNew to false. This will remove the AddNew row from the grid. |
|
|
If in the first column of the row you press the Up cursor button, a row is added at the end of the Grid. How can I avoid this situation? |
We are unable to replicate this reported scenario, it works as expected. Could you provide the video demonstration or the exact replication procedure which will help us to provide the better solution. |
|
|
When, after filling in some rows, I click on the button, a row is added at the end of the grid. How can I avoid this situation. |
Based on the provided information, the issue did not occur until some rows were filled. This behavior arises specifically when values are filled in the first row, as it serves as the AddNew Row. To prevent this behavior, you can disable the AddNew Row from the view by setting Grid.TableDescriptor.AllowNew to false. |
Chidanand M.