4

Recently I have upgraded my app from infragistics v12.2 to 15.2

I am using 'TemplateDataField' of webdatagrid in many places.

After upgrading to 15.2, my controls & pages were unable to find controls of Template column

foreach (GridRecord row in grd1.Rows)
{
        WebNumericEditor txtqty = ((WebNumericEditor)row.Items.FindItemByKey("Quantity").FindControl("txtActualQty"));
        if (Convert.ToInt32(txtqty.Value) <= 0)
}

in above code, I am unable to find 'txtqty' is null.

 <ig:TemplateDataField Key="Quantity" Header-Text="RT Exp">
     <ItemTemplate>
         <cc1:WebNumericEditor ID="txtActualQty" runat="server" CssClass="textbox" 
              onblur="return validateQuantity(this)" Width="90%" MaxLength="11" 
              Value='<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).DataItem, "Quantity")  %>'>
         </cc1:WebNumericEditor>
     </ItemTemplate>
 </ig:TemplateDataField>
2
  • 2
    This is resolved by calling EnsureTemplates() method of webdatagird before accessing template controls.
    – Surya
    Apr 1, 2016 at 6:55
  • At what stage of the page lifecycle are you trying to access the child control? Apr 1, 2016 at 12:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.