or

ListTextFormatString="<a href='CustomersEdit.aspx?LIFNR={0}'>{0}</a>"protected void RadGrid1_ExcelMLExportRowCreated(object source, GridExportExcelMLRowCreatedArgs e) { e.Row.Cells.GetCellByName("ItemCreatedWhen").StyleValue = "dateStyle"; } protected void RadGrid1_ExcelMLExportStylesCreated(object source, GridExportExcelMLStyleCreatedArgs e) { foreach (StyleElement style in e.Styles) { switch (style.Id) { case "headerStyle": style.FontStyle.Bold = true; break; case "itemStyle": style.InteriorStyle.Color = System.Drawing.Color.White; style.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid; break; case "alternatingItemStyle": style.InteriorStyle.Color = System.Drawing.Color.LightBlue; style.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid; break; } } StyleElement myStyle = new StyleElement("dateStyle"); myStyle.NumberFormat.FormatType = NumberFormatType.ShortDate; myStyle.FontStyle.Bold = true; e.Styles.Add(myStyle); }
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadControlsWebApp2.Default" %><!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> <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <%--Needed for JavaScript IntelliSense in VS2010--%> <%--For VS2008 replace RadScriptManager with ScriptManager--%> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <script type="text/javascript"> //Put your JavaScript code here. </script> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> </telerik:RadAjaxManager> <div> <telerik:RadGrid ID="RadGrid1" ShowGroupPanel="true" AllowFilteringByColumn="true" ShowStatusBar="True" runat="server" AllowPaging="True" AllowSorting="true" AllowCustomPaging="True" VirtualItemCount="100000" PageSize="25" Height="752px"> <ClientSettings AllowDragToGroup="true" /> <MasterTableView> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> </ExpandCollapseColumn> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn> </EditFormSettings> <PagerStyle AlwaysVisible="True" FirstPageToolTip="Erste Seite" LastPageToolTip="Letzte Seite" NextPagesToolTip="Weitere Seiten" NextPageToolTip="Nächste Seite" PagerTextFormat="Seite wechseln: {4} Seite <strong>{0}</strong> von <strong>{1}</strong>, items <strong>{2}</strong> to <strong>{3}</strong> of <strong>{5}</strong>." PageSizeLabelText="Anzahl je Seite:" PrevPagesToolTip="Vorige Seiten" PrevPageToolTip="Vorige Seite" /> </MasterTableView> <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" BorderStyle="None" FirstPageToolTip="Erste Seite" PagerTextFormat="Zu Seite: {4} Seite <strong>{0}</strong> von <strong>{1}</strong>, items <strong>{2}</strong> to <strong>{3}</strong> of <strong>{5}</strong>." PageSizeLabelText="Anzahl je Seite:" VerticalAlign="Bottom"></PagerStyle> <FilterMenu EnableImageSprites="False"></FilterMenu> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu> </telerik:RadGrid> </div> </form></body></html> namespace RadControlsWebApp2{ public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource); } void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { using (govistasigsDataContext db = new govistasigsDataContext()) { RadGrid1.VirtualItemCount = db.Users.Count(); RadGrid1.DataSource = (from p in db.Users select new { p.ID, p.RegisterDate, p.LastLogin }).Skip(RadGrid1.PageSize * RadGrid1.CurrentPageIndex).Take(RadGrid1.PageSize).ToArray(); } } }}<telerik:GridNumericColumn DataField="Premium" DecimalDigits="2" DataFormatString="{0:c}" DataType="System.Decimal" ColumnEditorID="PremiumEditor" HeaderText="Premium" UniqueName="Premium" SortExpression="Premium" > <HeaderStyle HorizontalAlign="Center"></HeaderStyle> <ItemStyle HorizontalAlign="Left" Font-Names="Verdana" Font-Size="11px"></ItemStyle></telerik:GridNumericColumn><telerik:GridNumericColumnEditor ID="PremiumEditor" runat="server"> <NumericTextBox> <NumberFormat DecimalDigits="2" /> <NumberFormat AllowRounding="true" /> <NumberFormat KeepNotRoundedValue="false" /> </NumericTextBox></telerik:GridNumericColumnEditor><telerik:RadMaskedTextBox ID="edtNumber" runat="server" CssClass="EditBox" Width="300px" Mask="## #### #### #### #### #### ####"
EnableEmbeddedSkins="false"></telerik:RadMaskedTextBox>edtNumber.Mask = null; edtNumber.Mask = string.Empty;<?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="SLSCommunicationPortal.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> </sectionGroup> </configSections> <connectionStrings> <add name="CommonLogconnectionString" connectionString="Data Source=xxxxx;Initial Catalog=xxxx;Integrated Security=SSPI;Connect Timeout=120;Pooling=true; Min Pool Size=5;" providerName="System.Data.SqlClient" /> <add name="xxxx" connectionString="Data Source=xxxxx;Initial Catalog=xxxxx;Integrated Security=SSPI;Connect Timeout=120;Pooling=true; Min Pool Size=5;" providerName="System.Data.SqlClient" /> </connectionStrings> <appSettings> <add key="xxxxx" value="xxxxx"/> <add key="xxxxx" value="xxxxx" /> <add key="LogDir" value="xxxxx"/> <add key="Telerik.Skin" value="Office2010Blue"/> <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled"/> <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled"/> </appSettings> <system.web> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </assemblies> </compilation> <pages> <controls> <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/> </controls> </pages> <httpHandlers> <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/> <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/> <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/> <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/> <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/> </httpHandlers> <httpModules> <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/> <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/> </httpModules> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules runAllManagedModulesForAllRequests="true"> <remove name="RadUploadModule"/> <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode"/> <remove name="RadCompression"/> <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode"/> </modules> <handlers> <remove name="ChartImage_axd"/> <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/> <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/> <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/> <remove name="Telerik_Web_UI_DialogHandler_aspx"/> <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/> <remove name="Telerik_RadUploadProgressHandler_ashx"/> <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/> <remove name="Telerik_Web_UI_WebResource_axd"/> <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/> </handlers> </system.webServer> <applicationSettings> <SLSCommunicationPortal.Properties.Settings> <setting name="xxxxxx" serializeAs="String"> <value>xxxxx</value> </setting> </SLSCommunicationPortal.Properties.Settings> </applicationSettings> </configuration><telerik:RadGrid ID="rgdRefer" runat="server" GridLines="Vertical" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" EnableEmbeddedSkins="false" Skin="CustSkin" PageSize="5" CellSpacing="0" OnItemCommand="rgdRefer_ItemCommand" OnItemDataBound="rgdRefer_ItemDataBound" Width="1020px" OnColumnCreating="rgdRefer_ColumnCreating" AllowFilteringByColumn="true" onneeddatasource="rgdRefer_NeedDataSource"> <GroupingSettings CaseSensitive="false" /> <SortingSettings EnableSkinSortStyles="false" /> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="180px" /> </ClientSettings> <MasterTableView AllowNaturalSort="false" DataKeyNames="Id" Width="100%"> <Columns> <telerik:GridButtonColumn HeaderText="Select" UniqueName="ibtnEdit" ImageUrl="~/App_Themes/BDefault/images/select_icon2.png" ButtonType="ImageButton" Visible="false" CommandName="EditUser" /><telerik:GridBoundColumn HeaderText="Custom Field 12" DataField="CTA_5" UniqueName="CTA_5" SortExpression="CTA_5" Visible="false" /> <telerik:GridBoundColumn HeaderText="Custom Field 13" DataField="CTA_6" UniqueName="CTA_6" SortExpression="CTA_6" Visible="false" /> <telerik:GridBoundColumn HeaderText="Custom Field 14" DataField="CTA_7" UniqueName="CTA_7" SortExpression="CTA_7" Visible="false" /> </Columns> </MasterTableView> </telerik:RadGrid>