Solved

how to get the current selected value from grid

  • 23 September 2021
  • 2 replies
  • 811 views

Userlevel 2

Hi Good night. 

 

I need to do the following.

When selecting one or clicking on a row of the grid, obtain the value of the selected Id (current).

 

  • The grid has a “SelectedRow” event?
  • in test mode. I created a Button (AddSelected). When i select a row and then i push de button, I need to get the value (Id) of the current row. (now i am obtain only the value of the first row (Id = 86)
the current Id is 88 but i obtaing 86 ever.

i put the code of the Add Selected button.

    public PXAction<CEEstimate> AddSelected;
[PXButton(CommitChanges=true)]
[PXUIField(DisplayName = "Add Selected")]
protected virtual void addSelected()
{
CEEstimate row = viewCEEstimate.Current;
CEEstimateEstimate rowd = viewCEEstimateEstimates.Current;
//row.Description = CEEstimateEstimate.Current.Id.ToString();
row.Description = rowd.Id.ToString();
}

CEEstimate (viewCEEstimate) is the header and CEEstimateEstimate and viewCEEstimateEstimates is the detail

 

cna you helpme please

icon

Best answer by Naveen Boga 23 September 2021, 15:54

View original

2 replies

Userlevel 2

@Naveen B  a lot of thanks it works!

Userlevel 7
Badge +17

Hi @eddiedaco  It seems there is NO issue with the code.  I have verified this in my location machine. Please find the details below.

You will get this issue only when that particular GRID is NOT decorated with SyncPosition = true in the .aspx page. Please find the screenshot for reference.

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved