This is a migrated thread and some comments may be shown as answers.

Error: Sys.WebForms.PageRequestManagerServerErrorException: Cannot find cell bound to column with unique name 'EditCommandColumn'

2 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sayle
Top achievements
Rank 1
Sayle asked on 12 Jul 2012, 03:46 PM
All,
I am using the latest RadGrid control. I am seeing an unusual error when "Inserting" a row. The error occurs when the grid's "insert" button is clicked. The Error: Sys.WebForms.PageRequestManagerServerErrorException: Cannot find cell bound to column with unique name 'EditCommandColumn'. However, 'EditCommandColumn' is clearly the first column in the grid! This is happening no matter which EditMode I choose...
What am I missing here please?!
<telerik:RadAjaxPanel ID="apnlPayments" runat="server" LoadingPanelID="ajaxLoadingPanel" Width="100%" Height="348px">
    <h2 style="text-align:center">Loan Payments Editor</h2>
    <div style="width: 100%; height: 340px; padding: 3,5,3,15;">
        <telerik:RadGrid ID="gridPayments" runat="server"
            AutoGenerateColumns="false" ShowFooter="true" CellSpacing="0" CellPadding="0" 
            GridLines="Both" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"
             
            Skin="Hay"
            ActiveItemStyle-CssClass="Row2" ItemStyle-CssClass="Row0" AlternatingItemStyle-CssClass="Row1"
             
            OnItemDataBound="grid_ItemDataBound" OnNeedDataSource="grid_NeedDataSource"
            OnInsertCommand="gridPayments_InsertCommmand" OnUpdateCommand="gridPayments_UpdateCommand"
            OnDeleteCommand="gridPayments_DeleteCommand" OnPreRender="gridPayments_PreRender">
             
            <ClientSettings>
                <Selecting EnableDragToSelectRows="false" AllowRowSelect="true" />
                <Scrolling AllowScroll="true" UseStaticHeaders="false" ScrollHeight="280px" FrozenColumnsCount="2" />
            </ClientSettings>
            <MasterTableView AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowPaging="false"
                DataKeyNames="LoanPaymentID" ClientDataKeyNames="LoanPaymentID" GridLines="Both" CommandItemDisplay="Bottom"
                EditMode="EditForms" EditFormSettings-EditFormType="AutoGenerated" >
                <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="true" AddNewRecordText="" AddNewRecordImageUrl="~/Images/add_16.png" />
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" Visible="true">
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" Width="50px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Delete this Payment?" ConfirmTitle="Delete" ImageUrl="~/Images/icon_delete.png" Reorderable="false" ShowSortIcon="false" Text="Delete" UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" Width="50px" />
                    </telerik:GridButtonColumn>
 
                    <telerik:GridBoundColumn DataField="LoanPaymentPS_ACCT_NO" FilterControlAltText="Filter LoanPaymentPS_ACCT_NO column" HeaderStyle-Wrap="false" HeaderText="PS ACCT NO" MaxLength="50" ReadOnly="true" SortExpression="LoanPaymentPS_ACCT_NO" UniqueName="PS_ACCT_NO" Visible="false" />
                    <telerik:GridDateTimeColumn DataField="LoanPaymentDateDue" DataFormatString="{0:MM/dd/yyyy}" FilterControlAltText="Filter LoanPaymentDateDue column" HeaderStyle-Wrap="false" HeaderText="DATE DUE" ReadOnly="true" SortExpression="LoanPaymentDateDue" UniqueName="LoanPaymentDateDue" Visible="false" />
                    <telerik:GridDateTimeColumn DataField="LoanPaymentDatePaid" DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime" EmptyDataText="01/01/1900" FilterControlAltText="Filter LoanPaymentDatePaid column" HeaderStyle-Wrap="false" HeaderText="DATE PAID" SortExpression="LoanPaymentDatePaid" UniqueName="LoanPaymentDatePaid" />
                    <telerik:GridNumericColumn DataField="LoanPaymentAmount" DataType="System.Decimal" FilterControlAltText="Filter LoanPaymentAmount column" HeaderStyle-Wrap="false" HeaderText="AMOUNT" NumericType="Currency" SortExpression="LoanPaymentAmount" UniqueName="LoanPaymentAmount" ConvertEmptyStringToNull="false" />
                    <telerik:GridBoundColumn DataField="LoanPaymentDescription" FilterControlAltText="Filter LoanPaymentDescription column" HeaderStyle-Wrap="false" HeaderText="DESCRIPTION" MaxLength="50" SortExpression="LoanPaymentDescription" UniqueName="LoanPaymentDescription" Visible="false" />
                    <telerik:GridBoundColumn DataField="LoanPaymentUserReference" FilterControlAltText="Filter LoanPaymentUserReference column" HeaderStyle-Wrap="false" HeaderText="USER REFERENCE" MaxLength="50" SortExpression="LoanPaymentUserReference" UniqueName="LoanPaymentUserReference" Visible="false" />
                    <telerik:GridBoundColumn DataField="LoanPaymentMethodNo" FilterControlAltText="Filter LoanPaymentMethodNo column" HeaderStyle-Wrap="false" HeaderText="METHOD NO" MaxLength="50" SortExpression="LoanPaymentMethodNo" UniqueName="LoanPaymentMethodNo" Visible="false" />
                    <telerik:GridBoundColumn DataField="LoanPaymentMethodReference" FilterControlAltText="Filter LoanPaymentMethodReference column" HeaderStyle-Wrap="false" HeaderText="METHOD REFERENCE" MaxLength="50" SortExpression="LoanPaymentMethodReference" UniqueName="LoanPaymentMethodReference" Visible="false" />
                    <telerik:GridBoundColumn DataField="LoanPaymentType" FilterControlAltText="Filter LoanPaymentType column" HeaderStyle-Wrap="false" HeaderText="TYPE" MaxLength="50" SortExpression="LoanPaymentType" UniqueName="LoanPaymentType" Visible="false" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>                               
    </div>
</telerik:RadAjaxPanel>

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 12 Jul 2012, 05:23 PM
Hello Miles,

May be the issue is your are used EditCommandcolumn in itemdatabound event, When you click on insertbutton at that time editcolumn is not exists for that column...

If you not able to find the issue then please provide your "grid_ItemDataBound" event code.

Thanks,
Jayesh Goyani
0
Sayle
Top achievements
Rank 1
answered on 17 Jul 2012, 06:58 PM
I decided to take a different direction which resolved the issue. It turns out that I didn't need to do anything as fancy as I tried to do. :-)-Cheers!
Tags
Grid
Asked by
Sayle
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Sayle
Top achievements
Rank 1
Share this question
or