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

GroupFooter : Column does not belong to table

7 Answers 164 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 1
Veteran
Morten asked on 01 Sep 2008, 11:02 PM
I'm trying to add values in the to a grid's GroupFooter (http://www.telerik.com/help/aspnet-ajax/gridgroupfooters.html), but the the following javascript error message: "Column '[Life sciences]' does not belong to table".

My grid:
<MasterTableView ShowGroupFooter="true">
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldAlias="Region" FieldName="Region"></telerik:GridGroupByField>
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="Region"></telerik:GridGroupByField>
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
<Columns>
<telerik:GridBoundColumn DataField="[Life sciences]" HeaderText="Life sciences" UniqueName="[Life sciences]">

I get the error message when I add the Aggregate property:
<telerik:GridBoundColumn DataField="[Life sciences]" HeaderText="Life sciences" UniqueName="[Life sciences]" Aggregate="Sum">

I suspect the error message has to do with the naming of the column "[Life sciences]".

What am I missing?

7 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 02 Sep 2008, 06:38 AM
Hello Morten,

We don't support empty spaces neither in the data field, nor in the unique name. You can change your column name using aliases in your select statement or another approach.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Morten
Top achievements
Rank 1
Veteran
answered on 02 Sep 2008, 08:15 AM
Hi Daniel
the grid supports column names containing spaces when the column names are enclosed with hard brackets [Column A].

Everything (I've tried) but the GroupFooter is supported.Would be nice if you included this in a future release.

I can't find any examples of how to manipulate the GroupFooter in the ItemDataBound event. Are there any?
0
Princy
Top achievements
Rank 1
answered on 02 Sep 2008, 01:10 PM
Hello Morten,

You can access the GroupFooterItem in the ItemDataBound as shown below.
cs:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridGroupFooterItem) 
        { 
            GridGroupFooterItem footerItem = (GridGroupFooterItem)e.Item; 
           footerItem.Cells[4].Text = "Custom TEXT for agregate count: "
        } 
    } 

Princy.
0
Daniel
Telerik team
answered on 03 Sep 2008, 12:09 PM
Hello Morten,

RadGrid itself behaves like Microsoft GridView control. Thus functions like paging and sorting will be working as expected. On the contrary filtering, grouping and aggregates are not intended to work when having empty spaces.

It is easy to avoid the empty spaces by using aliases for the SELECT query, for example:
SelectCommand="SELECT [First Name] As [FirstName], [Last Name] As [LastName], [Phone], [Address] FROM [PhoneBook]" 

Best wishes,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Morten
Top achievements
Rank 1
Veteran
answered on 04 Sep 2008, 08:18 PM
thanks for the info.

My trouble is that I'm pivoting a rows content into a column name to create a cross-table and therefore is forced to live with spaces in column names.
0
Morten
Top achievements
Rank 1
Veteran
answered on 05 Sep 2008, 09:18 AM
When adding the aggregate "SUM" to a GridBoundColumn: <telerik:GridBoundColumn DataField="x" HeaderText="x" UniqueName="x" Aggregate="SUM"  > the group footer displays: Sum : x. Is it possible to have the group footer column only display the value and not the aggregate (= remove the "Sum : " part)?
0
Morten
Top achievements
Rank 1
Veteran
answered on 05 Sep 2008, 10:37 AM
FooterAggregateFormatString="{0}" 
Tags
Grid
Asked by
Morten
Top achievements
Rank 1
Veteran
Answers by
Daniel
Telerik team
Morten
Top achievements
Rank 1
Veteran
Princy
Top achievements
Rank 1
Share this question
or