or
| private bool _contentUpdated = false; |
| private string _editorContent = string.Empty; |
| private string EditorMatchEvaluator(Match m) |
| { |
| _contentUpdated = true; |
| string newContent = m.Groups[1].Value + _editorContent + "</content>"; |
| return newContent; |
| } |
| private void SaveInCurrentFile(RadEditor editor) |
| { |
| try |
| { |
| //read file |
| string physicalFileName = MapPathSecure(this.AppRelativeVirtualPath); |
| FileStream fs = new FileStream(physicalFileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite); |
| StreamReader sr = new StreamReader(fs); |
| string pageContent = sr.ReadToEnd(); |
| //update content |
| _contentUpdated = false; |
| _editorContent = editor.Content; |
| MatchEvaluator mEvaluator = new MatchEvaluator(EditorMatchEvaluator); |
| pageContent = Regex.Replace(pageContent, "(<(\\w+):RadEditor[^>]+?ID\\s*=\\s*['\"]?" + editor.ID + "['\"]?[^>]*>[\\s\\S]*?<content>)[\\s\\S]*?</content>", mEvaluator, RegexOptions.IgnoreCase | RegexOptions.Compiled); |
| //update file |
| if (_contentUpdated) |
| { |
| fs.Seek(0, SeekOrigin.Begin); |
| StreamWriter sw = new StreamWriter(fs); |
| sw.BaseStream.SetLength(0); |
| sw.Write(pageContent); |
| sw.Flush(); |
| sw.Close(); |
| } |
| else |
| { |
| sr.Close(); |
| } |
| } |
| catch (Exception) |
| { |
| //"The File Encoding you have provided is not supported!" |
| //"Refresh the screen and try again!" |
| //"Another process or user is using the resource (ascx/aspx file) you are trying to update." |
| //"Check if the ASPNET user (IIS5) / NETWORK SERVICE account (IIS6) has write privileges for this file." |
| } |
| } |
| } |
| <%@ Page Language="c#" CodeFile="GridTest.aspx.cs" AutoEventWireup="false" Inherits="GridTest" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <body class="BODY"> |
| <form id="Form1" method="post" runat="server"> |
| <asp:ScriptManager ID="ScriptManager" runat="server" /> |
| <%-- |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| --%> |
| <telerik:RadSplitter ID="RadSplitter1" Width="700px" runat="server" Orientation="Horizontal"> |
| <telerik:RadPane ID="gridPane" runat="server" Height="307px" |
| Scrolling="None"> |
| <telerik:RadGrid AllowPaging="true" PageSize="40" Width="100%" Height="100%" Style="border: 0; |
| outline: none" ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"> |
| <MasterTableView AllowPaging="true" TableLayout="Fixed" /> |
| <PagerStyle Mode="NumericPages" /> |
| <ClientSettings EnableRowHoverStyle="true"> |
| <Selecting AllowRowSelect="true" /> |
| <Scrolling AllowScroll="true" UseStaticHeaders="true" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </telerik:RadPane> |
| <telerik:RadSplitBar CollapseMode="Both" ID="RadSplitBar2" runat="server" EnableResize="True"> |
| </telerik:RadSplitBar> |
| <telerik:RadPane ID="listBoxPane" runat="server" BackColor="#d9eeff"> |
| Bottom Pane |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" |
| ConnectionString="<%$ ConnectionStrings:RejusUnderhållningConnectionString %>" |
| SelectCommand="SELECT RecID FROM [Activity]"></asp:SqlDataSource> |
| </form> |
| </body> |
| </html> |

| <asp:objectdatasource ID="objdsRoles" runat="server" |
| selectmethod="GetAllRoles" |
| deletemethod="DeleteRole" |
| insertmethod="InsertRole" |
| oldvaluesparameterformatstring="original_{0}" |
| typename="MyNamespace.Data.Helpers" |
| > |
| <insertparameters> |
| <asp:controlparameter controlid="txtRoleName" type="String" name="RoleName" /> |
| </insertparameters> |
| <deleteparameters> |
| <asp:parameter name="Role" type="String" /> |
| </deleteparameters> |
| </asp:objectdatasource> |
| <telerik:radgrid id="rgRoles" runat="server" |
| mastertableview-editmode="InPlace" |
| allowautomaticupdates="True" |
| datasourceid="objdsRoles" |
| gridlines="None" |
| autogenerateeditcolumn="True" |
| autogeneratedeletecolumn="true" |
| ondeletecommand="rgRoles_OnDeleteCommand"> |
| <headercontextmenu enabletheming="True"> |
| <collapseanimation duration="200" type="OutQuint" /> |
| </headercontextmenu> |
| <mastertableview datakeynames="Role"> |
| </mastertableview> |
| </telerik:radgrid> |
| //Code Behind stuffs.... |
| void rgRoles_OnDeleteCommand(object source, GridCommandEventArgs e) |
| { |
| objdsRoles.Delete(); |
| } |
| //Code to delete the roll that is showing the null value |
| public void DeleteRole( string Role ) |
| { |
| try |
| { |
| Roles.DeleteRole(Role, true); |
| } |
| catch( Exception ex ) |
| { |
| throw new Exception( "Failed to delete role.", ex ); |
| } |
| } |
For a webapplication i am working on i need to extend the LinkManager with some new functionality. What i would like is to add a new asp.net databound dropdownlist. To bind the datasource to the dropdownlist control i need to have some kind of code behind, since that part is compiled into the Telerik.Web.UI.dll library i guess it is not possible??
The other 2 options that came to my mind is filling the HTML combobox using ajax by calling a webservice or just create an new custom dialog. Are there any other options??
Thanks in advance

| Protected Sub tooltipAdd_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles tooltipAdd.Load |
| ' txtTitle.Focus() |
| Dim s As RadScriptManager |
| s = DirectCast(Me.Master.FindControl("RadAjaxManager1"), RadScriptManager) |
| s.SetFocus(txtTitle) |