or

We are binding a RadGrid DataSource to a list of objects that contain standard properties and a list of custom properties.
e.g.
Name
JobTitle
Contact
List<string> CustomProperties { customPropertyItem1, customPropertyItem2 ... n}
The custom properties are stored in our db such that one property has many propertyItems, so the column headings would look like this -
Name | Job Title | Contact | Custom Property 1 | Custom Property 2 ... n
What is the best way of binding to these custom properties?
Can we mix declarative code (columns for the standard properties) with programmatic code (columns created dynamically for the custom properties) ?
All properties including custom properties need to be groupable, sortable and filterable.
thanks
<telerik:RadGrid AutoGenerateColumns="false" ID="QualContsGrid" runat="server" Width="800px" OnItemCommand="QualContsGrid_ItemCommand" Height="430px" On AllowSorting="true" AllowFilteringByColumn="true" EnableLinqExpressions="true" OnItemDataBound="QualContsGrid_ItemDataBound" AllowPaging="true" PageSize="15" BorderWidth="1px" BorderColor="#999999" EnableEmbeddedSkins="true" Skin="Default" DataSourceID="SQLDataSource1" ShowFooter="True" GridLines="None" > <StatusBarSettings ReadyText="Ready" LoadingText="Loading..." /> <MasterTableView > <Columns> <telerik:GridBoundColumn HeaderStyle-Width="125px" UniqueName="VoterFirstName" HeaderText="First Name" DataField="FirstName" SortExpression="FirstName" > </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="125px" UniqueName="VoterLastName" HeaderText="Last Name" DataField="LastName" SortExpression="LastName" > </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderStyle-Width="300px" UniqueName="VoterAddress" HeaderText="Address" DataField="Address" SortExpression="Address" > </telerik:GridBoundColumn > <telerik:GridButtonColumn DataTextFormatString="Remove" ButtonType="PushButton" UniqueName="RemoveContribution" HeaderStyle-Width="75px" ConfirmText="Are you certain that you want to remove this contribution?" Text="Remove" HeaderText="Remove" CommandName="RemoveContribution" CommandArgument="VoterQualifyingContributionId" DataTextField="VoterQualifyingContributionId" > </telerik:GridButtonColumn> <telerik:GridBoundColumn HeaderStyle-Width="125px" UniqueName="ContributionStatus" HeaderText="Status" DataField="PaymentDescription" SortExpression="PaymentDescription" > </telerik:GridBoundColumn > <telerik:GridBoundColumn UniqueName="VoterQualifyingContributionId" HeaderText="" DataField="VoterQualifyingContributionId" Visible="false" > </telerik:GridBoundColumn > </Columns> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> </ClientSettings></telerik:RadGrid>protected void QualContsGrid_Init(object sender, System.EventArgs e){ GridFilterMenu menu = QualContsGrid.FilterMenu; int i = 0; string a = ""; while (i < menu.Items.Count) { a = menu.Items[i].Text; if (menu.Items[i].Text == "NoFilter" || menu.Items[i].Text == "Contains" || menu.Items[i].Text == "StartsWith" || menu.Items[i].Text == "EqualTo") { i++; } else { menu.Items.RemoveAt(i); } }}function RadButtonNew_OnClientClicked() { var oManager = GetRadWindowManager(); var windowClientID = "RadWindowTest"; var oWnd = oManager.getWindowById(windowClientID); oWnd.setUrl("./Test.aspx"); oWnd.set_title("New"); oWnd.set_reloadOnShow(true); oWnd.show(); var popupWidth = $telerik.$(window).width() * 0.8; var popupHeight = $telerik.$(window).height() * 0.8; oWnd.setSize(popupWidth, popupHeight); oWnd.center(); return false;}<telerik:RadWindowManager ID="RadWindowManager1" runat="server" AutoSize="false" Modal="false" VisibleTitlebar="true" Width="600" Height="400" MinWidth="600" MinHeight="400" Behaviors="Close, Move, Resize" VisibleStatusbar="false" Skin="Default" ShowContentDuringLoad="false" ReloadOnShow="false" Style="position: absolute; z-index: 7000;" RestrictionZoneID="RadPaneContents" OnClientBeforeClose="RadWindowManager1_OnClientBeforeClose" OnClientClose="RadWindowManager1_OnClientClose" OnClientShow="RadWindowManager1_OnClientShow" OnClientDragEnd="ResizeSplitterWrap"> <Windows> <telerik:RadWindow ID="RadWindowTest" runat="server" /> </Windows> </telerik:RadWindowManager><telerik:RadGrid ID="RadGrid1" runat="server" GridLines="Vertical" Skin="Hay" PageSize="250" AllowSorting="True" AllowPaging="True" ShowGroupPanel="False" AutoGenerateColumns="false" Width="100%" > <PagerStyle Mode="Slider"></PagerStyle> <MasterTableView ShowGroupFooter="true" GroupsDefaultExpanded="False" HeaderStyle-HorizontalAlign="Center" GroupHeaderItemStyle-BackColor="white" GroupHeaderItemStyle-ForeColor="Black" GroupHeaderItemStyle-Font-Size="Medium" DataKeyNames="SkillID"> <GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldName="SkillAreaId" HeaderText=" " /> <telerik:GridGroupByField FieldName="SkillArea" HeaderText=" " /> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="SkillAreaId" HeaderText="" HeaderValueSeparator=" " /> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions> <Columns> <telerik:GridTemplateColumn UniqueName="SkillID"> <ItemTemplate> <b> <%# Eval("SkillID")%> </b> </ItemTemplate> <FooterTemplate> </FooterTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn> <ItemTemplate> <%# Eval("Skill")%> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn> <HeaderTemplate> None<br /> 0</HeaderTemplate> <ItemTemplate> <asp:RadioButton ID="RadioButton1" runat="server" /></ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn> <HeaderTemplate> Basic<br /> 1</HeaderTemplate> <ItemTemplate> <asp:RadioButton ID="RadioButton2" runat="server" /></ItemTemplate> </telerik:GridTemplateColumn>Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid1.ItemDataBoundIf TypeOf e.Item Is GridDataItem Then Dim itm As GridDataItem = CType(e.Item, GridDataItem) itm("SkillId").Controls.Add(New LiteralControl("test"))End IfFailed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request." Is it normal? Is there a way to refresh/rebind the gris after creating the export? Thank you Regis