| function dateSelected(sender, e) { |
| var dateString = e.get_newValue(); |
| var maxdate = new Date(dateString); |
| var postmarkdate = $find("<%= PostMarkDate.ClientID %>"); |
| postmarkdate.set_maxDate(maxdate); |
| } |
<telerik:RadGrid ID="ReportRadGrid" runat="server" OnNeedDataSource="ReportsRadGrid_NeedDataSource" Skin="Sunset">
<MasterTableView TableLayout="Auto" CommandItemDisplay="Top" AllowPaging="true" AutoGenerateColumns="false" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true">
<CommandItemSettings ExportToExcelText="Export to Excel" ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
<CommandItemTemplate>
<div style="text-align:right">
<telerik:RadButton ID="ExportRadButton" Text="Export to Excel" runat="server" Skin="Sunset" OnClick="ExportRadButton_Click" />
</div>
</CommandItemTemplate>
<Columns>
<telerik:GridBoundColumn DataField="Project_x0020_Name" HeaderText="Project Name" />
<telerik:GridBoundColumn DataField="Performing_x0020_Organization" HeaderText="Performing Organization" />
<telerik:GridBoundColumn DataField="Project_x0020_Sponser" HeaderText="Project Sponser" />
<telerik:GridBoundColumn DataField="Status" HeaderText="Status" />
<telerik:GridBoundColumn DataField="Status_x0020_Comments" HeaderText="Status Comments" />
<telerik:GridBoundColumn DataField="Risk_x0020_to_x0020_Project" HeaderText="Risk to Project" />
<telerik:GridBoundColumn DataField="Risk_x0020_Level" HeaderText="Risk Level" />
<telerik:GridBoundColumn DataField="Export_x0020_Date" HeaderText="Publish Date" DataFormatString="{0:MM/dd/yyyy}"/>
</Columns>
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
<ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" />
</telerik:RadGrid>
protected void ExportRadButton_Click(object sender, EventArgs e)
{
this.ReportRadGrid.MasterTableView.ExportToExcel();
}
Please let me know if you need more details.
Thanks,
Bharath
for (int a = 0; a < allAudit.GetLength(0); a++){ // ....... int auditID = int.Parse(allAudit[a, 0]); double percent = ((double)countTotalAuditable/(double)countTotal) * 100.0; TableRow row = new TableRow() { BackColor = Color.FromArgb(215, 230, 247) }; TableCell cell_processName = new TableCell() { HorizontalAlign = HorizontalAlign.Left,VerticalAlign = VerticalAlign.Middle }; TableCell cell_date = new TableCell() { HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle }; TableCell cell_progression = new TableCell() { HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle }; TableCell cell_responsable = new TableCell() { HorizontalAlign = HorizontalAlign.Center,VerticalAlign = VerticalAlign.Middle }; Label lblProcessName = new Label() { Text = allAudit[a, 1] }; Label lblDate = new Label() { Text = DateTime.Parse(allAudit[a, 3]).ToLongDateString() }; Label lblProgressionAudit = new Label() { Text = percent+" %" }; RadDropDownList droopDownResponsable = new RadDropDownList(); droopDownResponsable.EnableEmbeddedScripts = false; droopDownResponsable.ID = "droopDownResponsable"; droopDownResponsable.ClientIDMode = System.Web.UI.ClientIDMode.Static; droopDownResponsable.OnClientSelectedIndexChanged = "cbx_responsible_SelectedIndexChanged("+auditID+");"; SqlDataSource sourceUserList = new SqlDataSource(ConfigurationManager.ConnectionStrings["SCI2ConnectionString"].ToString(), "SELECT [tblUser].[userID], [UserName] FROM [aspnet_Users] INNER JOIN [tblUser] ON [aspnet_Users].[UserId] = [tblUser].[membershipID]"); droopDownResponsable.DataValueField = "UserID"; droopDownResponsable.DataTextField = "UserName"; droopDownResponsable.DataSource = sourceUserList; droopDownResponsable.DataBind(); foreach (DropDownListItem item in droopDownResponsable.Items) { if (item.Text == allAudit[a, 2]) { item.Selected = true; } } cell_processName.Controls.Add(lblProcessName); cell_date.Controls.Add(lblDate); cell_progression.Controls.Add(lblProgressionAudit); cell_responsable.Controls.Add(droopDownResponsable); row.Cells.Add(cell_processName); row.Cells.Add(new TableCell() { Text = " ", Width = 20 }); row.Cells.Add(cell_date); row.Cells.Add(new TableCell() { Text = " ", Width = 20 }); row.Cells.Add(cell_progression); row.Cells.Add(new TableCell() { Text = " ", Width = 20 }); row.Cells.Add(cell_responsable); tableAuditAdministration.Rows.Add(row); // .......}

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <asp:ScriptManager runat="server" ID="ScriptManager"></asp:ScriptManager> <telerik:RadAjaxManager runat="server" ID="RadAjaxManager"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="btnTest"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlAll" LoadingPanelID="LoadingPanel" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel" BackColor="Black" Transparency="50"></telerik:RadAjaxLoadingPanel> <asp:Panel runat="server" ID="pnlAll"> This is the test page. <br /><br /><br /><br /> <asp:Button runat="server" ID="btnTest" Text="Test Me" /> </asp:Panel> <telerik:RadFormDecorator Enabled="true" runat="server" ID="RadFormDecorator1" Skin="Default" DecoratedControls="Buttons" /> </form></body></html>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace WebApplication2{ public partial class WebForm1 : System.Web.UI.Page { public WebForm1() { this.Init += WebForm1_Init; } void WebForm1_Init(object sender, EventArgs e) { btnTest.Click += btnTest_Click; } void btnTest_Click(object sender, EventArgs e) { throw new Exception("THis is a test") ; } }}