<
radG:RadGrid ID="dgrdResults" runat="server" Width="100%" AllowSorting="true"
RadControlsDir="../Assets/RadControls/" GridLines="None" SkinsPath="../Assets/RadControls/Grid/Skins"
EnableAJAX="true" AutoGenerateColumns="false" >
<ExportSettings ExportOnlyData="false" IgnorePaging="true" OpenInNewWindow="true" />
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView DataKeyNames="RecipientId">
<ExpandCollapseColumn Visible="false">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<RowIndicatorColumn Visible="false">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<NoRecordsTemplate>
<asp:Label ID="lblNoRecordsFound" runat="server" Text="No records bind">
</asp:Label>
</NoRecordsTemplate>
<DetailTables >
<radG:GridTableView DataKeyNames ="ID" runat="server">
<ParentTableRelation >
<radG:GridRelationFields DetailKeyField="ID" MasterKeyField ="RecipientId" />
</ParentTableRelation>
<NoRecordsTemplate>
<asp:Label runat="server" ID="lblNorecord" Text="No records bind">
</asp:Label>
</NoRecordsTemplate>
<Columns>
<radG:GridBoundColumn HeaderText="Name" DataField="Name">
</radG:GridBoundColumn>
</Columns>
</radG:GridTableView>
</DetailTables>
<Columns>
<radG:GridTemplateColumn >
<Headerstyle width="20px" />
<Headertemplate>
<asp:CheckBox runat="server" ID="All" OnCheckedChanged="SelectAllContacts" Autopostback="True" />
</Headertemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="Contact" />
</ItemTemplate>
</radG:GridTemplateColumn>
<radG:GridBoundColumn DataField ="Email" HeaderText="<%$ Resources:ToolTextEmail, Recipient_Email %>" UniqueName="Email"></radG:GridBoundColumn>
<radG:GridBoundColumn DataField="FirstName" HeaderText="<%$ Resources:ToolTextEmail, Recipient_FirstName %>" UniqueName="First Name"></radG:GridBoundColumn>
<radG:GridBoundColumn DataField="LastName" HeaderText="<%$Resources:ToolTextEmail, Recipient_LastName %>" UniqueName="Lase Name"></radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Address1" HeaderText="<%$Resources:ToolTextEmail, Recipient_Address1 %>" UniqueName="Address1"></radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Company" HeaderText="<%$Resources:ToolTextEmail, Recipient_Company %>" UniqueName="Company"></radG:GridBoundColumn>
<radG:GridBoundColumn DataField="City" HeaderText="<%$Resources:ToolTextEmail, Recipient_City %>" UniqueName="City"></radG:GridBoundColumn>
<radG:GridBoundColumn DataField="State" HeaderText="<%$Resources:ToolTextEmail, Recipient_State %>" UniqueName="State"></radG:GridBoundColumn>
</Columns>
</MasterTableView>
</radG:RadGrid>
and the source code is
Private Sub dgrdResults_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.WebControls.GridDetailTableDataBindEventArgs) Handles dgrdResults.DetailTableDataBind
Dim db As Database
Dim dataset As DataSet = Nothing
Dim dbCommandWrapper As DbCommand = Nothing
Try
db = DatabaseFactory.CreateDatabase()
dbCommandWrapper = db.GetStoredProcCommand(
"spListGetByRecipient")
db.AddInParameter(dbCommandWrapper,
"@recipientId", DbType.Int32, 100125)
dataset = db.ExecuteDataSet(dbCommandWrapper)
e.DetailTableView.DataSource = dataset
dataset.Dispose()
dbCommandWrapper.Dispose()
Catch ex As Exception
Throw ex
Finally
If (Not dbCommandWrapper Is Nothing) Then
dbCommandWrapper.Dispose()
End If
If (Not dataset Is Nothing) Then
dataset.Dispose()
End If
End Try
End Sub
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.hide
{
overflow: hidden;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="overflow: hidden;">
<table cellspacing="0" border="0" style="table-layout: auto;">
<tbody>
<tr>
<th style="width: 100px;">
Column 1
</th>
<th style="width: 100px;">
Column 2
</th>
</tr>
<tr>
<td>
a
</td>
<td>
a
</td>
</tr>
<tr>
<td>
b
</td>
<td>
b
</td>
</tr>
<tr>
<td>
c
</td>
<td>
c
</td>
</tr>
</tbody>
</table>
</div>
<br />
<br />
<br />
<br />
<telerik:RadScriptManager ID="scriptManager" runat="server" />
<telerik:RadButton ID="btnOpen" runat="server" Text="Open" OnClick="btnOpen_Click" />
<br />
<telerik:RadWindow ID="TestDialog" runat="server" Title="Select Order Services" VisibleStatusbar="false"
AutoSize="true" AutoSizeBehaviors="Height" Width="400px" Modal="true" VisibleOnPageLoad="false" Behaviors="Close, Move"
EnableShadow="true" CssClass="hide">
<ContentTemplate>
<div>
<table cellspacing="0" border="0" style="table-layout: auto;">
<tbody>
<tr>
<th style="width: 100px;">
Column 1
</th>
<th style="width: 100px;">
Column 2
</th>
</tr>
<tr>
<td>
a
</td>
<td>
a
</td>
</tr>
<tr>
<td>
b
</td>
<td>
b
</td>
</tr>
<tr>
<td>
c
</td>
<td>
c
</td>
</tr>
</tbody>
</table>
</div>
</ContentTemplate>
</telerik:RadWindow>
</form>
</body>
</html>
function OnClientLoad(editor, args) {
//set the editor size
editor.setSize(
"100%", document.body.offsetHeight - 90);
window.onresize = ResizeEditor(editor);
}
var resizeFlag = true;
function ResizeEditor(editor)
{
if (resizeFlag) {
editor.setSize(
"100%", document.body.offsetHeight - 90);
resizeFlag = false;
window.setTimeout(function()
{
resizeFlag = true;
},100);
}
}
Thanks in advance
Sasireka

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