<table style="width:100%;"> <tr style="height:100%;vertical-align:top;overflow:auto"> <td colspan="2"> <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" Width="100%" Height="100%"> <Tabs> <telerik:RadTab runat="server" Text="Tab1" Selected="True"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Tab2"> </telerik:RadTab> </Tabs> </telerik:RadTabStrip> <telerik:RadMultiPage ID="RadMultiPage1" runat="server" Width="100%" SelectedIndex="0" Height="100%"> <telerik:RadPageView ID="RadPageView1" runat="server" Height="100%" style="border: 1px solid grey"> <telerik:RadTreeView ID="RadTreeView1" runat="server"></telerik:RadTreeView> </telerik:RadPageView> <telerik:RadPageView ID="RadPageView2" runat="server" Height="100%" style="border: 1px solid grey"> <telerik:RadTreeView ID="RadTreeView2" runat="server"></telerik:RadTreeView> </telerik:RadPageView> </telerik:RadMultiPage> </td> </tr> <tr> <td style="font: normal 12px arial; text-align: left;"> <asp:CheckBox ID="CheckBox1" runat="server" Text="Do something when checked." AutoPostBack="true" /> </td> <td style="text-align: right"> <telerik:RadButton ID="CancelButton" runat="server" Text="Cancel" OnClientClicked="windowClose" UseSubmitBehavior="false"> </telerik:RadButton> </td> </tr></table><script type="text/javascript"> function OnClientEntryAdded(sender, eventArgs) { var newEntry = eventArgs.get_entry().get_text(); if (validateEmail(newEntry)) { // If New Custom Entry is an Emeail Do Nothing } else {
// ELSE
// If New Custom Entry is Not an Email and It Does Not Exist in the
// DataSource/Items then I want the New Added Entry to have a RED
// Background Color so that it indicates that the Entry is incorrect.
// IF newEntry does NOT exist in the EntryCollection THEN
// Change the Background COlor of the New ENtry to Red } } function validateEmail(email) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } </script>
I also need to know how to use the remove() entry function within that event.protected void OnSortCommand(object sender, GridSortCommandEventArgs e){ SortDirection direction = (e.NewSortOrder == GridSortOrder.Descending) ? SortDirection.Descending : SortDirection.Ascending; Sort = new SortBy(e.SortExpression, direction); GridSortExpression newSortExpression = new GridSortExpression(); newSortExpression.FieldName = e.SortExpression; newSortExpression.SortOrder = e.NewSortOrder; MasterTableView.SortExpressions.Clear(); MasterTableView.SortExpressions.Add(newSortExpression); e.Canceled = true; this.PageInfo = new GridPageInfo(1, this.PageSize); this.Rebind();}Protected Sub ResultsGrid_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles ResultsGrid.NeedDataSource Dim results As EvidenceEntryGridItemResultsEnvelope = AppDomain.Instance.DI.Get(Of IEvidenceEntryGridItemRepository)().GetForUserByUniqueId(_searchValue, UserId, ResultsGrid.PageInfo, ResultsGrid.Sort, ResultsGrid.Filter) ResultsGrid.VirtualItemCount = results.TotalCount ResultsGrid.DataSource = results.Records End Sub<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"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel> <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0" GridLines="None" Width="800px" AllowFilteringByColumn="true" EnableLinqExpressions="false" AutoGenerateColumns="false" OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender" ShowFooter="True"> <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True" ShowFooter="True" TableLayout="Auto"> <Columns> <telerik:GridTemplateColumn HeaderText="Ship Name" SortExpression="ShipName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"> <ItemTemplate> <asp:LinkButton ID="lbl_name" runat="server" Text='<%#Eval("ShipName")%>' Visible="true"/> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Ship Country" SortExpression="ShipCountry" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"> <ItemTemplate> <asp:LinkButton ID="lbl_country" runat="server" Text='<%#Eval("ShipCountry")%>' Visible="true"/> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid> </form> </body> protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { LoadData(); } private void LoadData() { RadGrid1.DataSource = GetDataTable("SELECT OrderID, OrderDate, Freight, ShipName, ShipCountry FROM Orders"); } public DataTable GetDataTable(string query) { String ConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection conn = new SqlConnection(ConnString); SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = new SqlCommand(query, conn); DataTable myDataTable = new DataTable(); conn.Open(); try { adapter.Fill(myDataTable); } finally { conn.Close(); } return myDataTable; } protected void RadGrid1_PreRender(object sender, EventArgs e) { //RadGrid1.Columns[0].CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains; //RadGrid1.Columns[1].CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains; } Q1 2013 (released Feb 20, 2013) brings a significant performance improvement to Telerik’s Grid for ASP.NET AJAX . Till Q1 2013, every hidden column (Visible=”false”) from the control used to store its cell data into the ViewState of the grid. However, in scenarios with many hidden columns or one hidden column bound to a large database this might have negatively impacted the performance of RadGrid.
We improved this behavior, so that the ViewState of RadGrid holds only the visible column data. However, if somewhere into the code you depend on the hidden column’s cell text which now will be empty (set to “ ”), this performance improvement will introduce a breaking change for you.
To resolve the issue for individual columns, you can replace the Visible property of the column with Display in order to get the corresponding value of the hidden column’s cell.
<appSettings> <add key="BindGridInvisibleColumns" value="true"/></appSettings> Hello,
I am having a simple requirement, I have JavaScript function to detect if a control is 'changed' (I am using telerik and .net controls). Where as I am 'binding' the JavaScript function on runtime to all controls (attributes.add for .net controls and setting the properties for the telerik controls)
Now this function does work as expected ... until a post-back. As we know, we are going to loose our changes after post-back, So I just wanted to know if there is a way where ...
I am emphasising more on getting it done rather emphasising on getting in done correctly. I have had given a thought to add a custom attribute or so, but again I am afraid that I might loose them as soon as the page makes a trip for post-back.
I did spend few hours doing some research but most scenarios yield
using hidden variables, I am not feeling it useful for my purpose
explained above, but you can correct me.
Another problem was for asp:DropDownList ... I applied styles using JavaScript and nothing happened, I disabled the form decorator and styles were applies properly as expected