When attempting to filter a nullable column, we are seeing a crash when the grid encounters a null value.
When will this be fixed?
--Details--
System.NullReferenceException: Object reference not set to an instance of an object.
Generated: Tue, 20 May 2008 22:07:26 GMT
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledExcept ion' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(ExecutionScope , VwPortalUser )
at System.Linq.Enumerable.<WhereIterator>d__0`1.MoveNext ()
at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
at lambda_method(ExecutionScope )
at System.Linq.EnumerableExecutor`1.Execute()
at System.Linq.EnumerableExecutor`1.ExecuteBoxed()
at System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider .Execute(Expression expression)
at Telerik.Web.UI.GridDynamicQueryable.Count(IQueryable source)
at Telerik.Web.UI.GridDataTableFromEnumerable.FillData35()
at Telerik.Web.UI.GridDataTableFromEnumerable.FillData()
at Telerik.Web.UI.GridResolveEnumerable.Initialize()
at Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized()
at Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
at Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable (GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
at Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource (GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
at Telerik.Web.UI.GridTableView.get_ResolvedDataSource()
at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerabl e dataSource, Boolean useDataSource)
at System.Web.UI.WebControls.CompositeDataBoundControl .PerformDataBinding(IEnumerable data)
at System.Web.UI.WebControls.DataBoundControl.OnDataSourceV iewSelectCallback(IEnumerable data)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArgumen ts arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect ()
at Telerik.Web.UI.GridTableView.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind ()
at Telerik.Web.UI.GridTableView.DataBind()
at Telerik.Web.UI.GridTableView.Rebind()
at Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand (Object source)
at Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
at Telerik.Web.UI.GridColumn.filterTextBox_TextChanged (Object sender, EventArgs e)
at System.Web.UI.WebControls.TextBox.OnTextChanged(EventArg s e)
at System.Web.UI.WebControls.TextBox.RaisePostDataChangedEv ent()
at System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBac kDataHandler.RaisePostDataChang edEvent()
at System.Web.UI.Page.RaiseChangedEvents()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
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.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.portal_tools_searchusers_aspx.ProcessRequest(HttpContex t context) in c:\WINDOWS\Microsoft.NET \Framework\v2.0.50727\Temporary ASP.NET Files\edis.web.ui\d024371a \2a80559\App_Web_yjh-qi6p.16 .cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep .System.Web.HttpApplication .IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
14 Answers, 1 is accepted
Hi to all,
I have the same problem but only occurs when I select the "contains" filter.
With other filters (equal, etc) works fine
Greetings.
Santiago.
More information about the error...
The datasource is a LinqDataSource.
If I add a RadAjaxManager on page for update the grid when I choose the "Contains" filter the execution stops in the following function:
function Sys$WebForms$PageRequestManager$_endPostBack(error, response) {
// DevDiv Bugs 130268: There could have been a 2nd request that started while this one was being
// processed. Detect this by comparing the request for the current response to the _request field,
// which stores the latest request that has begun. If they are different, do not clear the state
// data that will be required by the 2nd request's response.
if (this._request === response.get_webRequest()) {
this._processingRequest = false;
this._additionalInput = null;
this._request = null;
}
var handler = this._get_eventHandlerList().getHandler("endRequest");
var errorHandled = false;
if (handler) {
var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, this._dataItems, response);
handler(this, eventArgs);
errorHandled = eventArgs.get_errorHandled();
}
// DevDiv Bugs 130268: See above
if (!this._processingRequest) {
this._dataItems = null;
}
if (error && !errorHandled) {
// DevDiv 89485: throw, don't alert()
throw error; <-------STOPS HERE
}
}
Please set EnableLinqExpressions to false and let me know about the result.
Regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I have the same problem. But I'm binding to a linq data source with DataSourceID. Is there a solution that works with Linq?
Thank you,
Jurjen
Can you please elaborate little more on your case? If you can provide us with your RadGrid declaration or if possible a small runnable project (attached to a formal ticket)? Did setting EnableLinqExpressions to false make any difference?
Sincerely yours,
Rosen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Here is the declaration of my grid. Like I already said I'm binding to a LinqDataSource, so to set EnableLinqExpressions to false is not an option for me. I hope you can help me.
Regards,
Jurjen
<
telerik:RadGrid ID="RadGrid_Tasks" runat="server" OnItemDataBound="RadGrid_Tasks_ItemDataBound" Height="100%" Width="100%"
Skin="Office2007" ShowGroupPanel="True" AutoGenerateColumns="False" AllowPaging="true"
AllowSorting="True" GridLines="None" DataSourceID="ObjectDataSource_Tasks"
SelectedItemStyle-BackColor="CornflowerBlue" AllowFilteringByColumn="true">
<GroupingSettings CaseSensitive="false" />
<MasterTableView DataKeyNames="id" CommandItemDisplay="None" PageSize="100"
AllowCustomSorting="true" GroupLoadMode="Server" TableLayout="Fixed">
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<SortExpressions>
<telerik:GridSortExpression FieldName="LateStart" SortOrder="Ascending" />
</SortExpressions>
<Columns>
<telerik:GridTemplateColumn Display="true" HeaderStyle-Width="25px" ItemStyle-HorizontalAlign="Center"
AllowFiltering="false">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkFinished" AutoPostBack="true" OnCheckedChanged="chkFinished_CheckedChanged" /><br />
<asp:Image runat="server" ID="imgImportant" ImageUrl="~/Images/Important.png" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Project.Name" AllowFiltering="true" ItemStyle-HorizontalAlign="Left"
HeaderText="Projectnaam" UniqueName="ProjectName" HeaderStyle-Width="35%" GroupByExpression="ProjectName[Projectnaam] Group By ProjectName">
<ItemTemplate>
<asp:HyperLink ID="lnkProject" Text='<%# Eval("Project.Name")%>' runat="server" Target="_blank">
</asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Name" AllowFiltering="true" ItemStyle-HorizontalAlign="Left"
HeaderText="Taak" UniqueName="TaskName" HeaderStyle-Width="35%" GroupByExpression="Name[Taak] Group By Name">
<ItemTemplate>
<asp:LinkButton ID="LinkButton_Task" Text='<%# Eval("Name")%>' runat="server" OnClick="Button_Select_Clicked"
CommandArgument='<%# Eval("ID")%>'>
</asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="ExecutiveNameDB" HeaderText="Uitvoerende" SortExpression="ExecutiveNameDB"
UniqueName="ExecutiveNameDB" HeaderStyle-Width="120px" />
<telerik:GridBoundColumn DataField="Project.MrtTeam" HeaderText="Mrt Team" UniqueName="MrtTeam" HeaderStyle-Width="120px"
GroupByExpression="Project.MrtTeam[Mrt Team] Group By Project.MrtTeam" AllowFiltering="true" Display="false" DataType="System.String"/>
<telerik:GridBoundColumn DataField="GroupTypeName" Visible="false" AllowFiltering="true"
HeaderText="Taak type" SortExpression="GroupTypeName" UniqueName="GroupTypeName"
HeaderStyle-Width="100px" />
<telerik:GridBoundColumn DataField="CategoryName" HeaderText="Taakcategorie" SortExpression="CategoryName"
UniqueName="CategoryName" HeaderStyle-Width="100px" AllowFiltering="false" />
<telerik:GridTemplateColumn DataField="LateStart" AllowFiltering="true" ItemStyle-HorizontalAlign="Left" DataType="System.DateTime"
HeaderText="WFM Deadline" UniqueName="LateStart" HeaderStyle-Width="100px" GroupByExpression="LateStart[WFM Deadline] Group By LateStart">
<ItemTemplate>
<asp:HyperLink ID="lnkDate" Text='<%# GetFormattedDate(Eval("LateStart"))%>' runat="server"
Target="_blank">
</asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="ExternalDeadLine" HeaderText="Datum"
DataFormatString="{0:d MMM yyyy}" SortExpression="ExternalDeadLine" UniqueName="ExternalDeadLine"
AllowFiltering="false" HeaderStyle-Width="75px" ItemStyle-HorizontalAlign="Center" />
</Columns>
<NoRecordsTemplate>
<p>Geen taken gevonden</p>
</NoRecordsTemplate>
<EditFormSettings>
<PopUpSettings ScrollBars="None" />
</EditFormSettings>
</MasterTableView>
<PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true"></PagerStyle>
<ClientSettings EnablePostBackOnRowClick="False" AllowDragToGroup="True">
<Selecting AllowRowSelect="False" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" />
</ClientSettings>
<GroupPanel ID="GroupPanel" Style="width: 100%;" Visible="True" />
</telerik:RadGrid>
Can you post the LinqDataSource declaration also?
Kind regards,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Here is the LinqDataSource declaration.
Regards,
Jurjen
<asp:LinqDataSource ID="ObjectDataSource_Tasks" runat="server" Where="(IsAutoCompleteTask == @IsAutoCompleteTask)">
<WhereParameters>
<asp:Parameter DefaultValue="false" Name="IsAutoCompleteTask" Type="Boolean" />
</WhereParameters>
</asp:LinqDataSource>
I have examined the code you have sent us and as it is none runnable I have mock few of the resources. But unfortunately I'm unable to recreate the described behavior. Can you please send us a small runnable project which we will be able to debug locally. Thus we will be able to gather more details about your scenario and provide you with more to-the-point answer.
Regards,
Rosen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks
Do you use the latest version 2009.2.826 of RadControls for ASP.NET AJAX? In this version the single quote should be escaped automatically along with:
" LIKE ", " AND ", " OR ", "\"", ">", "<", "<>", " NULL ", " IS "
Other special characters which are part of the entered filter criterion should escaped manually intercepting the filter command as explained here.
Kind regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Please sugeste me
