Skip to main content

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?

@smarenich Can you please help?


@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.


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


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
};
}

 


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


Reply