Hello, I'm new in the docentric world and c# programming. May I have your help please?
I'been reading this info https://www.docentric.com/documentation/examples/managing-code-behind help
It's says that we can populate unbound elements in the ElementInitializeEventHandler event, but the example use a instruccion comparing to an objet that I cant found the reference in my project with Docentric dll v5.1.26. the object instance is: InstanceModel.FieldElementInstance. Where is it?
The code is:
void dg_ElementInitializeEventHandler(object sender, ElementInitializeEventArgs e)
{
// Check if the current rendering element is the kind of Field element named as “AverageProductPrice”
if (e.Element is InstanceModel.FieldElementInstance &&
((InstanceModel.FieldElementInstance)e.Element).Name == "AverageProductPrice")
{
// Set the formatted value of the element
var products = DataAccess.GetProducts().Where(p => p.Category.Name == "Seasonings");
((InstanceModel.FieldElementInstance)e.Element).TextValue = products.Average(p => p.Price).ToString("n2");
}
}
Thansk ind advance for your help.
Regards from Nicaragua.