Try Now
More in this section

Forums / Developing with Sitefinity / RadGrid - Code behind Data Source - EditFormSettings Template - Binding a field

RadGrid - Code behind Data Source - EditFormSettings Template - Binding a field

2 posts, 0 answered
  1. Kameron
    Kameron avatar
    9 posts
    07 Nov 2011
    29 Feb 2012
    Link to this post
    So I am trying to use the edit popup for the RadGrid and creating a custom template. The problem I am running into is the field I want to display is not working and throwing this error:
    Sys.WebForms.PageRequestManagerServerErrorException: Value cannot be null. Parameter name: expression 

    I tried to bind the data a couple of different ways and am not getting it. Here is my RadGrid, please let me know what I am doing wrong. The grid shows the data correctly, it is just when I click on the "View" link it breaks. Keep in mind, without the Label field in the template, the popup does work and shows the Patient Number in the header.

    <telerik:RadGrid id="rgEmployees" runat="server" allowpaging="True" AllowSorting="true" PageSize="10"
            AutoGenerateColumns="False" AllowFilteringByColumn="false" Skin="Outlook">
        <MasterTableView EditMode="PopUP" PageSize="10" DataKeyNames="Emp#">
                <telerik:GridBoundColumn UniqueName="Emp#" DataField="Emp#" Visible="false"></telerik:GridBoundColumn>
                <telerik:GridEditCommandColumn UniqueName="ViewColumn" EditText="View" ></telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn UniqueName="LastName" HeaderText="Last Name" SortExpression="LastName" DataField="LastName"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="FirstName" HeaderText="First Name" SortExpression="FirstName" DataField="FirstName"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="DeptName" HeaderText="Department Name" SortExpression="DeptName" DataField="DeptName"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="HireDate" HeaderText="Last Hire Date" SortExpression="HireDate" DataField="HireDate"></telerik:GridBoundColumn>
            <EditFormSettings CaptionFormatString="View Patient Number: {0}" CaptionDataField="Emp#" EditFormType="Template" PopUpSettings-Modal="true">
                    <table id="tbView" cellspacing="1" cellpadding="1" width="250" border="0">
                            <td>First Name:</td>
                                <asp:Label ID="lblFName" Text='<%# DataBinder.Eval(Container.DataItem, "FirstName") %>' runat="server" />
            <Selecting AllowRowSelect="true />

    Thank you in advance.
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    24 Oct 2016
    05 Mar 2012
    Link to this post
    Hello Kameron,

     The javascript error is a result of the server error exception. I suggest that you review this help article for more information on error handling with RadAjax. Please check if you do not have duplicate IDs in the dynamically loaded controls. If any issues persist, can you please send us the complete sample of your custom control so we can examine it further.

    All the best,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered