Skip to main content
Solved

how to get the current selected value from grid

  • September 23, 2021
  • 2 replies
  • 973 views

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

Best answer by Naveen Boga

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.

 

View original
Did this topic help you find an answer to your question?

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3417 replies
  • Answer
  • September 23, 2021

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.

 


  • Author
  • Varsity I
  • 32 replies
  • October 2, 2021

@Naveen B  a lot of thanks it works!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings