Solved

What is the Equivalent of "Grid" control "RowDataBound" for "Form"

  • 28 February 2023
  • 5 replies
  • 88 views

Userlevel 7
Badge +8

Hello Community,

In my “Page_Load” sometimes I use Grid Control RowDataBound to manipulate the grids layout as follows

PX.Web.UI.PXGrid gridWithStyle = (PX.Web.UI.PXGrid)ControlHelper.FindControl("grid", page);
if (gridWithStyle != null)
{
gridWithStyle.RowDataBound += (object grdsender, PXGridRowEventArgs erdb) =>
{
var grdRow = erdb.Row;

//Do Stuff
}
}

I have come across a situation where I need to do the same for “Form” control. I tried to replicate the same logic from Grid and modify it for Form but couldn’t make it work. This is what I have done but I have a problem with the commented part for “DataBound” as follows.

PX.Web.UI.PXFormView formWithStyle = (PX.Web.UI.PXFormView)ControlHelper.FindControl("form", page);
if (formWithStyle != null)
{
formWithStyle.DataBound += (object frmsender, EventArgs erdb) =>
{
// how? var frmRow = erdb.Row;

//Do Stuff
}
}

Any help is appreciated how can I make this work?

icon

Best answer by aaghaei 21 March 2023, 01:41

View original

5 replies

Userlevel 7
Badge +8

@smarenich Can you please help?

Userlevel 7
Badge +3

@aaghaei I personally tried to achieve what you want in the past, but I was not able to bypass certain challenges and problems. So unfortunately I have no way to do this properly for now.

In the future typescript-based UI this should be easier.

Userlevel 7
Badge

Hi @aaghaei  were you able to find a solution? Thank you!

Userlevel 7
Badge +8

Yes with some R&D I could make it work. I forgot to post the solution here.

 

PX.Web.UI.PXFormView formWithStyle = ControlHelper.FindControl("form", page) as PX.Web.UI.PXFormView;
if (formWithStyle != null)
{
formWithStyle.DataBound += (object frmsender, EventArgs erdb) =>
{
// Do stuff
};
}

 

Userlevel 7
Badge

Thank you for sharing your solution with the community @aaghaei !

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