.RadPanelBar .rpRootGroup, .RadPanelBar .rpRootGroup .rpLink { border: none !important; background-color: #FFFFFF !important; font-family:Verdana !important; text-decoration: none; border-bottom-width: 0px !important; } .RadPanelBar .rpOut { border-bottom-width: 0px !important; }<label class="CMS40FaqContentArea001" id="CMS40FaqContentArea001" style="padding-right: 5px; padding-left: 20px; font-weight: bold; background: url(../images/widgets_sml/faqcontentarea.png) #cccccc no-repeat left center; height: 20px; text-align: right;border: #000000 1px dotted;" runat="server" name="FaqContentArea">FAQ CONTROL</label><label style="padding-right:
5px; padding-left: 20px; font-weight: bold; background:
url(../images/widgets_sml/faqcontentarea.png) #cccccc no-repeat left
center; height: 20px; text-align: right;border: #000000 1px dotted;" class="CMS40FaqContentArea001" name="FaqContentArea" id="CMS40FaqContentArea001">FAQ CONTROL</label>//Gives Error
<telerik:GridNumericColumn Aggregate="Sum" DataField="SubDetails.Value" HeaderText="Mon" UniqueName="Mon"
ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" HeaderStyle-Wrap="true" />
//Working perfectly
<telerik:GridNumericColumn Aggregate="Sum" DataField="Units" HeaderText="Tue" UniqueName="Tue"
ItemStyle-HorizontalAlign="Center" HeaderStyle-Wrap="true" />
It gives me the following error
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotSupportedException: Average is not supported for type "System.Object" at Telerik.Web.UI.GridBoundColumn.GetAggregateByType[T](IQueryable queryable, String fieldName, GridAggregateFunction func)
public Class Details1
{
public int Value { get; set }
}
public Class Details2
{
public int ID{ get; set }
public Details1 SubDetails { get; set }
}
Kindly guide me to solve this problem.
Thanks
Katte
Hi,
I'm trying to use a grid to bind to an object data source that receives tis data from EF4.
I run into problems when I try to edit a column that is an associated entity.
I have the following two entities:
Register_App and
App
Register_App is associated to App. Thus Register_App has a property App which in turn has an ID.
I would like to display a dropdown combo so I can select the appropriate App and this infpo is persisted to the
object data source.
I made the following grid column:
<telerik:GridDropDownColumn ListTextField="Name" ListValueField="Id" DataSourceID="odsApps" HeaderText="App" DataField="App.ID" DropDownControlType="RadComboBox"></telerik:GridDropDownColumn>
It works fine in display mode. The App is bound based on the DataField App.ID, and the correct Name is displayed.
When I turn to edit mode, all is wel again. A combobox is displayed with all the Apps and the correct one is
displayed. When I try to save the data I get the following error:
System.InvalidOperationException: Could not find a property named 'App.ID' on the type specified by theDataObjectTypeName property in ObjectDataSource 'odsRegApps'. atSystem.Web.UI.WebControls.ObjectDataSourceView.BuildDataObject(Type dataObjectType, IDictionary inputParameters) atSystem.Web.UI.WebControls.ObjectDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionaryoldValues) at System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues,DataSourceViewOperationCallback callback) at Telerik.Web.UI.GridTableView.PerformUpdate(GridEditableItemeditedItem, Boolean suppressRebind) at Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source)I am surprised that the property App.ID is resolved in Display mode and Edit mode but not during save. Do you know
what I'm doing wrong?
Any help is greatly appreciated,
best regards,
Chris Vrolijk
P.S. Below I included my entire control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AdminApps.ascx.cs" Inherits="ActuIT.Futurama.ManagementSite.RegisterAdminAppsControl" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><asp:ObjectDataSource ID="odsRegApps" runat="server"DataObjectTypeName="ActuIT.Futurama_Vision.EFDataLayer.Register_App" SelectMethod="GetRegisterApps" TypeName="ActuIT.Futurama_Vision.Business.Register" UpdateMethod="UpdateApp" DeleteMethod="DeleteApp" InsertMethod="InsertApp" > </asp:ObjectDataSource><asp:ObjectDataSource ID="odsPAs" runat="server"DataObjectTypeName="ActuIT.Futurama_Vision.EFDataLayer.Register_PA" SelectMethod="GetPAs" TypeName="ActuIT.Futurama_Vision.Business.Register" ></asp:ObjectDataSource><asp:ObjectDataSource ID="odsPUVs" runat="server"DataObjectTypeName="ActuIT.Futurama_Vision.EFDataLayer.Register_PUV" SelectMethod="GetPUVs" TypeName="ActuIT.Futurama_Vision.Business.Register"></asp:ObjectDataSource><asp:ObjectDataSource ID="odsApps" runat="server" DataObjectTypeName="ActuIT.Futurama_Vision.EFDataLayer.App" SelectMethod="GetApps" TypeName="ActuIT.Futurama_Vision.Business.Vision" ></asp:ObjectDataSource><telerik:RadGrid ID="gridApps" runat="server" AllowAutomaticDeletes="True" AllowPaging="True" AutoGenerateColumns="True" AllowAutomaticUpdates ="true" AllowAutomaticInserts = "true" DataSourceID="odsRegApps" > <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False" DataKeyNames="Id"DataSourceID="odsRegApps"> <RowIndicatorColumn> <HeaderStyle Width="20px" /> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px" /> </ExpandCollapseColumn> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"HeaderText="Edit" > </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" UniqueName="DeleteColumn"ConfirmText="Are you sure you want to delete this application?" ConfirmTitle="Confirm Delete"ConfirmDialogType="Classic" HeaderText="Delete"> </telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="Id" UniqueName="Id" HeaderText="Register ID" Visible="true"ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Name" UniqueName="Name" HeaderText="Naam"> </telerik:GridBoundColumn> <telerik:GridCheckBoxColumn UniqueName="UseXMLData" DataField="UseXMLData" HeaderText="UseXMLData" /> <telerik:GridBoundColumn ColumnEditorID="txtDocument" DataField="Document" UniqueName="Document"HeaderText="Document"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Folder" UniqueName="Folder" HeaderText="Folder"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="WebService" UniqueName="WebService" HeaderText="WebService"> </telerik:GridBoundColumn> <telerik:GridDropDownColumn ListTextField="Name" ListValueField="Id" DataSourceID="odsApps" HeaderText="App" DataField="App.ID" DropDownControlType="RadComboBox"></telerik:GridDropDownColumn> <telerik:GridDropDownColumn ListTextField="Code" ListValueField="Id" DataSourceID="odsPAs" HeaderText="PA" DataField="Register_PA.Id" DropDownControlType="RadComboBox"></telerik:GridDropDownColumn> <telerik:GridDropDownColumn ListTextField="Code" ListValueField="Id" DataSourceID="odsPUVs" HeaderText="PUV" DataField="Register_PUV.Id" DropDownControlType="RadComboBox"></telerik:GridDropDownColumn> </Columns> <EditFormSettings ColumnNumber="2" CaptionDataField="Name" InsertCaption="Voeg register applicatie toe"EditFormType="AutoGenerated"> <EditColumn InsertText="Insert" EditText="Edit application id #:" EditFormColumnIndex="0"UpdateText="Application updated" UniqueName="InsertCommandColumn1" CancelText="Cancel"ButtonType="ImageButton"></EditColumn> </EditFormSettings> </MasterTableView></telerik:RadGrid>