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

Grouping on Header Error

2 Answers 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 17 Apr 2009, 12:43 PM
I have a RadGrid with serveral columns.  The columns that are not GridBoundColumns group fine.  However, my GridTemplateColumns are throwing errors when a user tries to group by them.

I am using Telerick Web.UI version 2008.3.1105.35

Sample code which is breaking
<telerik:GridTemplateColumn DataField="STATUS" HeaderText="Status" 
                        ItemStyle-HorizontalAlign="center" SortExpression="STATUS">  
    <ItemTemplate> 
        <asp:Label ID="LabelStatus" runat="server" /> 
    </ItemTemplate> 
</telerik:GridTemplateColumn> 

I have two rows to test and neither column has empty data but it still throws this alert.

JS Error:
Sys.WebForms.PageRequestManagerServerErrorException: Expression cannot be null or empty

.NET Error:
cannot be null or empty at Telerik.Web.UI.GridGroupByExpression.SetExpression(String expression) at Telerik.Web.UI.GridGroupByExpression..ctor(GridColumn column) at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) 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.status_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

2 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 17 Apr 2009, 01:03 PM
FIX: I added the following and it fixed the problem.

GroupByExpression

 

="Status Group By Status"

 

0
Dave
Top achievements
Rank 1
answered on 18 May 2011, 08:52 PM
This solution worked for me too.  Thx!  :)
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Dave
Top achievements
Rank 1
Share this question
or