or
<div style="width: 80%"> <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1"> <div style="float: left; height: 100%; width: 55px; background: #E3EFFF; text-align: center; border-right: 1px solid #6593CF;"> <img src="images/tasks.gif" alt="" /></div> <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" GridLines="None" Width="585px"> <MasterTableView AllowMultiColumnSorting="true" /> <SortingSettings SortedBackColor="Azure" EnableSkinSortStyles="false" /> <HeaderStyle Width="100px" /> </telerik:RadGrid> </telerik:RadAjaxPanel> </div>protected void PRate_Load(object sender, EventArgs e) { LoadData(); } protected void LoadData() { var Person = TypeCreator.TypeGenerator(new[]{ new {ID=1, PackageName="1 Week", Duration="1 Week", Rate=29, Price=100}, new {ID=2, PackageName="1 Month(s)", Duration="1 Week", Rate=29, Price=100}, new {ID=3, PackageName="3 Month(s)", Duration="1 Week" , Rate=29, Price=100}, new {ID=4, PackageName="6 Month(s)", Duration="1 Week", Rate=29, Price=100}, new {ID=5, PackageName="9 Month(s)", Duration="1 Week", Rate=29, Price=100}, new {ID=6, PackageName="12 Month(s)", Duration="1 Week", Rate=29, Price=100} }); //none of the method is working, var dt = new System.Data.DataTable(); dt.Columns.Add(new System.Data.DataColumn("ID", typeof(System.Int16))); dt.Columns.Add(new System.Data.DataColumn("PackageName", typeof(System.String))); dt.Columns.Add(new System.Data.DataColumn("Duration", typeof(System.String))); System.Data.DataRow dr; for (int i = 0; i < 100; i++) { dr = dt.NewRow(); dr[0] = i; dr[1] = "Package" + i; dr[2] = i * 10; dt.Rows.Add(dr); } RadGrid1.DataSource = dt; RadGrid1.DataBind(); } static class TypeCreator { public static List<T> TypeGenerator<T>(this T[] t) { return new List<T>(t); } }<telerik:RadChart runat="server" ID = "chartTransactions" AutoLayout="true" DataSourceID="datTransactions" DefaultType="Line" DataGroupColumn = "Store" Width="800" > <ChartTitle><TextBlock Text = "Transactions - Store"></TextBlock></ChartTitle> <PlotArea> <XAxis DataLabelsColumn = "AppRejDate" > <Appearance ValueFormat="ShortDate"> <LabelAppearance RotationAngle="270"> </LabelAppearance> </Appearance> </XAxis> </PlotArea> </telerik:RadChart><asp:SqlDataSource ID = "datTransactions" runat="server" ConnectionString="<%$ ConnectionStrings:DBString %>" SelectCommand = "Select tblStore_Ref.Description, CAST(DATEADD(Day, DATEDIFF(Day, 0, AppRejDateTime), 0) AS Float) + 2 AS AppRejDate, Count(*) as Transactions From tblTransactionHistory INNER JOIN tblTransactionItems ON tblTransactionHistory.TransactionID = tblTransactionItems.TransactionID INNER JOIN tblStore_Ref ON tblTransactionItems.Store = tblStore_Ref.Store Where Status = 'A' AND AppRejDateTime Between @dateBegin AND @dateEnd Group By DATEADD(Day, DATEDIFF(Day, 0, AppRejDateTime), 0), tblStore_Ref.Description Order By AppRejDate, tblStore_Ref.Description"> <SelectParameters> <asp:ControlParameter ControlID = "dateBegin" Name = "dateBegin" PropertyName="SelectedDate" /> <asp:ControlParameter ControlID = "dateEnd" Name = "dateEnd" PropertyName="SelectedDate" /> </SelectParameters> </asp:SqlDataSource>if (e.Item is GridEditFormItem && e.Item.IsInEditMode) { GridEditFormItem dataItem = e.Item as GridEditFormItem; TableCell cell = dataItem["InspectionDate"]; RadDatePicker rdp = cell.Controls[0] as RadDatePicker; rdp.Calendar.UseColumnHeadersAsSelectors = false; rdp.Calendar.UseRowHeadersAsSelectors = false; rdp.MaxDate = DateTime.Now; }
<telerik:RadGrid ID="radGridForms" runat="server" AutoGenerateColumns="false"
GridLines="None" Skin="Windows7" AllowFilteringByColumn="True" AllowPaging="True"
AllowSorting="True" EnableLinqExpressions="False" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Size="Small" Font-Strikeout="False" Font-Underline="False"
OnItemDataBound="radGridForms_ItemDataBound" OnNeedDataSource="radGridForms_NeedDataSource">
<ClientSettings Selecting-AllowRowSelect="false" EnableRowHoverStyle="true">
<ClientEvents />
</ClientSettings>
<PagerStyle Position="Top" />
<MasterTableView PageSize="10" AllowSorting="true" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true"
Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Size="Small"
Font-Strikeout="False" Font-Underline="False" DataKeyNames="FormID" >
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="FormID" UniqueName="FormID" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridHyperLinkColumn DataNavigateUrlFields="PDFLink"
DataNavigateUrlFormatString="http://webcms/{0}" UniqueName="PDFLink"
AllowFiltering="false" HeaderText="Download" ItemStyle-HorizontalAlign="Center">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</telerik:GridHyperLinkColumn>
<telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ItemStyle-Font-Size="XX-Small"
AllowSorting="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="State" HeaderText="State" UniqueName="State"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ItemStyle-Font-Size="XX-Small"
AllowSorting="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Constituents" HeaderText="Constituents" UniqueName="Constituents"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ItemStyle-Font-Size="XX-Small"
AllowSorting="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Keywords" HeaderText="Keywords" UniqueName="Keywords"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ItemStyle-Font-Size="XX-Small"
AllowSorting="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Version" AllowFiltering="false" ItemStyle-Font-Size="XX-Small"
HeaderText="Ver" UniqueName="Version" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Type" AllowFiltering="false" ItemStyle-Font-Size="XX-Small"
HeaderText="Type" UniqueName="Type" AllowSorting="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Secure" UniqueName="Secure" Visible="false">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
protected void Page_Init(object sender, EventArgs e)
{
radGridForms.FilterMenu.Items.Clear();
GridFilterMenu filterMenu = radGridForms.FilterMenu;
RadMenuItem onlyEmployerMenuItem = new RadMenuItem();
RadMenuItem onlyProducerMenuItem = new RadMenuItem();
RadMenuItem onlyIndividualsMenuItem = new RadMenuItem();
radGridForms.FilterMenu.Items.Add(onlyEmployerMenuItem);
radGridForms.FilterMenu.Items.Add(onlyProducerMenuItem);
radGridForms.FilterMenu.Items.Add(onlyIndividualsMenuItem);
onlyEmployerMenuItem.Text = "Show Only Employers";
onlyEmployerMenuItem.Value = "Employers";
onlyProducerMenuItem.Text = "Show Only Producers";
onlyProducerMenuItem.Value = "Producers";
onlyIndividualsMenuItem.Text = "Show Only Individuals";
onlyIndividualsMenuItem.Value = "Individuals";
filterMenu.ItemClick += new RadMenuEventHandler(filterMenu_ItemClick);
}
protected void filterMenu_ItemClick(object sender, RadMenuEventArgs e)
{
if (e.Item.Value.ToString() == "Employers")
{
radGridForms.MasterTableView.FilterExpression = "([Constituents] = 'Employers') ";
GridColumn column = radGridForms.MasterTableView.GetColumnSafe("Constituents");
column.CurrentFilterFunction = GridKnownFunction.Contains;
radGridForms.DataSource = null;
radGridForms.Rebind();
}
else if(e.Item.Value.ToString() == "Producers")
{
radGridForms.MasterTableView.FilterExpression = "([Constituents] = 'Producers') ";
GridColumn column = radGridForms.MasterTableView.GetColumnSafe("Constituents");
column.CurrentFilterFunction = GridKnownFunction.Contains;
radGridForms.DataSource = null;
radGridForms.Rebind();
}
else if (e.Item.Value.ToString() == "Individuals")
{
radGridForms.MasterTableView.FilterExpression = "([Constituents] = 'Individuals') ";
GridColumn column = radGridForms.MasterTableView.GetColumnSafe("Constituents");
column.CurrentFilterFunction = GridKnownFunction.Contains;
radGridForms.DataSource = null;
radGridForms.Rebind();
}
}