Hi everyone,
I need to select a user from the table and populate those results into the datagrid. The use of the datagrid as a solution is kind of mandatory.
I already have some logic implemented in order to add a new row into the datagrid whenever the user clicks on "Select User"
I just can't seem to figure out how to get the columns from the selected row and populate them in the columns of the datagrid. The data from the table is from another module, and I am not able to change the Structure or add any other Attributes to it.
How can I do this?
Thank you very much in advance.
Issue is fixed. The input parameter that I was using on the On Click property of the button was not correct.
Thanks to all of the help.
Hi Diogo Verde,
What I understand is that you are able to add row in data grid dynamically but you also want to add/remove some column from data grid dynamically. Correct?
To add column dynamically what you can do is first add all column of the table in the datagrid and then you can hide and show the column based on the your condition.
Please share your oml file if possible to understand it better.
ThanksPankaj
Other than that you can maintain a dynamic column list to show the columns. I am attaching a sample oml for your reference. You can check and let me know if it solve your problem.
CheersPankaj
Hi Pankaj,
First off all, thank you for your response.
But what I need is this:
- The user clicks on "Select User"
- Then a new row is added to the Datagrid
- And the values from the table columns are populated in the datagrid
Like this:
Hi Diogo Gomes,
When you click on select user you can add this into the database and then refresh your data then it will update the datagrid with new row.
You must first get the selected row from the table. To do this, you can use the SelectedItem or SelectedItems property, depending on whether your implementation allows you to select one or more rows at once. Once you have a selected row, you can access its properties or data cells to get the information you need. You can then populate the columns in the data grid with the corresponding data from the selected row.