Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Grid (Filter or Sort) - Object Reference Not Set to an Instance of an Object

$
0
0

I have two grids, that when I try to filter or sort, I get the error Object Reference Not set to an instance of an object. It doesn't seem to make it back to the server side code, or at least not where I'm expecting, from as far as I can tell. I put breakpoints all over the place and none were ever hit.

I've compared the markup for these grids to several others that are working and fail to see any difference. I should mention these are both on the same page inside of a RadTabPanel.

Here is the full text of the inner exception:

Inner exception message: Object reference not set to an instance of an object. Exception message: Exception of type 'System.Web.HttpUnhandledException' was thrown. [6/17/2016 4:30:54 PM] 
 
Error Details:
6/17/2016 4:30:54 PM...Inner Exception 
Exception Message: Object reference not set to an instance of an object.
Exception Stack: 
 at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Exception Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Exception Stack: 
 at System.Web.UI.Page.HandleError(Exception e)
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 at System.Web.UI.Page.ProcessRequest()
 at System.Web.UI.Page.ProcessRequest(HttpContext context)
 at ASP.pages_home_aspx.ProcessRequest(HttpContext context) in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\wtu\d747c192\fbb86567\App_Web_rfsuwzi4.1.cs:line 0
 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

 

Here the markup for the first Grid that fails:

<telerik:RadGridID="rgPendingAssignment"
    runat="server"
    MasterTableView-HeaderStyle-CssClass="radGridLargest"
    AllowPaging="True"
    AllowSorting="True"
    AutoGenerateColumns="False"
    CellSpacing="0"
    PageSize="25"
    ClientSettings-AllowColumnsReorder="false"ClientSettings-Resizing-AllowColumnResize="false"ClientSettings-Scrolling-UseStaticHeaders="true"
    EnableLinqExpressions="False"
    ExportSettings-ExportOnlyData="false"ExportSettings-IgnorePaging="true"ExportSettings-OpenInNewWindow="true"ExportSettings-HideStructureColumns="true"
    GridLines="None"
    GroupingSettings-CaseSensitive="false"MasterTableView-AllowMultiColumnSorting="false"MasterTableView-AllowNaturalSort="false"AllowFilteringByColumn="true"MasterTableView-CommandItemDisplay="Top"
    MasterTableView-CommandItemSettings-ShowAddNewRecordButton="false"
    MasterTableView-CommandItemSettings-ShowRefreshButton="false"
    MasterTableView-CommandItemSettings-ShowExportToCsvButton="false"
    MasterTableView-CommandItemSettings-ShowExportToExcelButton="true"ExportSettings-Excel-Format="Xlsx"
    MasterTableView-CommandItemSettings-ShowExportToPdfButton="true"ExportSettings-Pdf-AllowCopy="true"ExportSettings-Pdf-AllowPrinting="true"ExportSettings-Pdf-AllowModify="true"
    MasterTableView-CommandItemSettings-ShowExportToWordButton="true"ExportSettings-Word-Format="Docx"
    MasterTableView-PagerStyle-PagerTextFormat="{4} Page {0} of {1}, rows {2} to {3} of {5}"
    MasterTableView-PagerStyle-Position="TopAndBottom"MasterTableView-PagerStyle-PageButtonCount="10"MasterTableView-PagerStyle-EnableAllOptionInPagerComboBox="false"
    MasterTableView-TableLayout="Fixed">
    <MasterTableView>
        <SortExpressions>
            <telerik:GridSortExpressionFieldName="SOLDIER"SortOrder="Ascending"/>
        </SortExpressions>
        <NoRecordsTemplate>
            <asp:LabelID="Label1"Text="No Records Found"runat="server"/>
        </NoRecordsTemplate>
        <Columns>
            <telerik:GridBoundColumnDataField="CaseId"UniqueName="CASEID"Display="false"/>
            <telerik:GridHyperLinkColumnUniqueName="Soldier"HeaderText="Soldier"DataTextField="Soldier"AutoPostBackOnFilter="true"
                DataNavigateUrlFields="CASEID"DataNavigateUrlFormatString="~/CaseAssignment/{0}"ShowFilterIcon="false"  CurrentFilterFunction="Contains"DataType="System.String"/>
            <telerik:GridBoundColumnUniqueName="SSN"HeaderText="SSN"DataField="SSN"ShowFilterIcon="false"
                DataType="System.String"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"/>
            <telerik:GridBoundColumnUniqueName="losingWTU"HeaderText="Losing WTU"DataField="losingWTU"ShowFilterIcon="false"AutoPostBackOnFilter="true"/>
            <telerik:GridBoundColumnUniqueName="GAININGWTU"HeaderText="Gaining WTU"DataField="GAININGWTU"ShowFilterIcon="false"AutoPostBackOnFilter="true"/>
            <telerik:GridBoundColumnUniqueName="GAININGCOMPANY"HeaderText="Gaining Company"DataField="GAININGCOMPANY"ShowFilterIcon="false"AutoPostBackOnFilter="true"/>
            <telerik:GridBoundColumnUniqueName="AcceptedBy"HeaderText="Accepted By"DataField="AcceptedBy"ShowFilterIcon="false"AutoPostBackOnFilter="true"/>
            <telerik:GridDateTimeColumnUniqueName="AcceptedOn"HeaderText="Date Accepted"DataField="AcceptedOn"ShowFilterIcon="false"
                DataFormatString="{0:dd MMM yyyy}"DataType="System.DateTime"AutoPostBackOnFilter="true"/>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

The markup for the second grid that isn't working:

<telerik:RadGridID="rgTransfers"
    runat="server"
    OnItemCreated="rg_popup_ItemCreated"
    OnItemDataBound="rgTransfers_ItemDataBound"
    CssClass="radGridLargest"
    AllowPaging="True"
    AllowSorting="True"
    AutoGenerateColumns="False"
    CellSpacing="0"
    PageSize="25"
    ClientSettings-AllowColumnsReorder="false"ClientSettings-Resizing-AllowColumnResize="true"ClientSettings-Scrolling-UseStaticHeaders="true"
    EnableLinqExpressions="False"
    ExportSettings-ExportOnlyData="false"ExportSettings-IgnorePaging="true"ExportSettings-OpenInNewWindow="true"ExportSettings-HideStructureColumns="true"
    GridLines="None"
    GroupingSettings-CaseSensitive="false"MasterTableView-AllowMultiColumnSorting="false"MasterTableView-AllowNaturalSort="false"AllowFilteringByColumn="true"MasterTableView-CommandItemDisplay="Top"
    MasterTableView-CommandItemSettings-ShowAddNewRecordButton="false"
    MasterTableView-CommandItemSettings-ShowRefreshButton="false"
    MasterTableView-CommandItemSettings-ShowExportToCsvButton="false"
    MasterTableView-CommandItemSettings-ShowExportToExcelButton="true"ExportSettings-Excel-Format="Xlsx"
    MasterTableView-CommandItemSettings-ShowExportToPdfButton="true"ExportSettings-Pdf-AllowCopy="true"ExportSettings-Pdf-AllowPrinting="true"ExportSettings-Pdf-AllowModify="true"
    MasterTableView-CommandItemSettings-ShowExportToWordButton="true"ExportSettings-Word-Format="Docx"
    MasterTableView-PagerStyle-PagerTextFormat="{4} Page {0} of {1}, rows {2} to {3} of {5}"
    MasterTableView-PagerStyle-Position="TopAndBottom"MasterTableView-PagerStyle-PageButtonCount="10"MasterTableView-PagerStyle-EnableAllOptionInPagerComboBox="false"
    MasterTableView-TableLayout="Fixed">
    <MasterTableView>
        <SortExpressions>
            <telerik:GridSortExpressionFieldName="SOLDIER"SortOrder="Ascending"/>
        </SortExpressions>
        <NoRecordsTemplate>
            <asp:LabelID="Label1"Text="No Records Found"runat="server"/>
        </NoRecordsTemplate>
        <Columns>
            <telerik:GridTemplateColumnUniqueName="SELECTACTION"ShowFilterIcon="false"DataField="CASEID"
                SortExpression="CASEID"HeaderText="Select Action"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"
                HeaderStyle-Width="120px">
                <ItemTemplate>
                    <asp:DropDownListID="ddlSelectAction"runat="server">
                        <asp:ListItemText="--Select Action--"Value=""/>
                        <asp:ListItemText="Accept Transfer"Value="ACCEPT"/>
                        <asp:ListItemText="Cancel Transfer"Value="CANCEL"/>
                    </asp:DropDownList>
                    <asp:HiddenFieldID="tranferCaseId"runat="server"Value='<%# Eval("CASEID") %>' />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumnDisplay="false"DataField="CASETRANSFERID"UniqueName="CASETRANSFERID"/>
            <telerik:GridTemplateColumnUniqueName="SOLDIER"ShowFilterIcon="false"DataField="SOLDIER"
                SortExpression="SOLDIER"HeaderText="Soldier"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true">
                <ItemTemplate>
                    <asp:LinkButtonID="lnkBtnName"runat="server"Text='<%# Eval("SOLDIER") %>' CommandArgument='<%# Eval("CaseId") %>' />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumnHeaderText="SSN"DataField="SSN"UniqueName="SSN"ShowFilterIcon="false"
                DataType="System.String"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"HeaderStyle-Width="47px"/>
            <telerik:GridBoundColumnHeaderText="Losing WTU"DataField="LOSINGWTU"UniqueName="LOSINGWTU"ShowFilterIcon="false"
                DataType="System.String"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"/>
            <telerik:GridBoundColumnHeaderText="Losing CO"DataField="LOSINGCO"UniqueName="LOSINGCO"ShowFilterIcon="false"
                DataType="System.String"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"/>
            <telerik:GridBoundColumnHeaderText="Gaining WTU"DataField="GAININGWTU"UniqueName="GAININWTU"ShowFilterIcon="false"
                DataType="System.String"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"/>
            <telerik:GridBoundColumnHeaderText="Gaining CO"DataField="GAININGCO"UniqueName="GAININGCO"ShowFilterIcon="false"
                DataType="System.String"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"/>
            <telerik:GridDateTimeColumnHeaderText="Date Initiated"DataField="DATEINITIATED"UniqueName="DATEINITIATED"DataFormatString="{0:dd MMM yyyy}"ShowFilterIcon="false"
                DataType="System.DateTime"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"HeaderStyle-Width="100px"/>
            <telerik:GridDateTimeColumnHeaderText="Record Start Date"DataField="PROGRAMSTARTDATE"UniqueName="PROGRAMSTARTDATE"DataFormatString="{0:dd MMM yyyy}"ShowFilterIcon="false"
                DataType="System.DateTime"CurrentFilterFunction="Contains"AutoPostBackOnFilter="true"HeaderStyle-Width="115px"/>
        </Columns>
        <CommandItemTemplate>
            <divclass="formRowNoBorder">
                <divclass="floatLeft">
                    <asp:LinkButtonrunat="server"ID="lbCancel"CssClass="silverButton"OnClick="btnCancel_Click"><span>Cancel</span></asp:LinkButton>
                    <asp:LinkButtonrunat="server"ID="lbSave"CssClass="silverButton"CommandName="Save"OnClick="btnSave_Click"><span>Save</span></asp:LinkButton>
                </div>
            </div>
        </CommandItemTemplate>
    </MasterTableView>
</telerik:RadGrid>

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>