or
<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();
}
}
