Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
161 views
I am trying to change the text on the header columns of the RADGRID.  I have added the relevant code to the ItemDataBound event and it's working fine, when thepage loads the text dynamically changes.  However, when I select the row with the select button the header title revert back to the original.  Do I need to add additional code in the SelectedIndexChanged and if so what?

I have posted the code in the ItemDataBound below:

If Profile.UserCulture = 2 Then  
            If TypeOf e.Item Is GridHeaderItem Then  
                Dim header As GridHeaderItem = DirectCast(e.Item, GridHeaderItem)  
                header("PRN").Text = "购买申请编号" 
                header("RaisedBy").Text = "提出者" 
                header("Supplier").Text = "供应商" 
                header("DeliveryRequired").Text = "要求送货日期" 
                header("PRNotes").Text = "附注及特别说明" 
                header("ReqValue").Text = "价值" 
                header("Status").Text = "状态" 
                header("Level1").Text = "第 1 级授权" 
                header("Level2").Text = "第 2 级授权" 
                header("POSNumber").Text = "采购订单编号" 
            End If  
        End If 

Tony Deo
Top achievements
Rank 1
 answered on 14 Oct 2009
0 answers
94 views
Thought I would share since I didn't see this posted anywhere.

What I wanted to do was to increase the size of the slider, and maximum value as the user dragged the drag handle to the end of the slider.  If it was at the maximum value, it should increase the size of the slider to allow for more valus to be selected.
server side:
slider.Width = 365 
slider.SmallChange = 1 
slider.LargeChange = 1 
slider.IsSelectionRangeEnabled = True 
slider.SelectionStart = 0 
slider.SelectionEnd = 360 
slider.OnClientSlideEnd = "sliderEndSlide" 
client side:
function sliderEndSlide(sender, args) { 
        if (sender.get_selectionEnd() == sender.get_maximumValue()) { 
            sender.set_width(sender.get_maximumValue() + 28); 
            sender.set_maximumValue(sender.get_maximumValue() + 28); 
            sender.redraw(); 
        } 
    } 
this will increase the slider by 28 every time you put the slider handle at the maximum value.


Dave Myers
Top achievements
Rank 1
 asked on 14 Oct 2009
3 answers
97 views
I have a detail page that I popup in a rad window and when I go to add a raddock layout and zone I get this error:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

If I take the Dockzone out the page loads properly, here is the code I am using to put the dock on the page:

 

<telerik:RadDockLayout runat="server" ID="RadDockLayout1" EnableEmbeddedSkins="false"

 

 

Skin="None" OnSaveDockLayout="RadDockLayout1_SaveDockLayout" OnLoadDockLayout="RadDockLayout1_LoadDockLayout">

 

 

<telerik:RadDockZone runat="server" ID="RadDockZone1" Orientation="vertical" Style="border: 0px;

 

 

width: 100%;">

 

 

<telerik:RadDock runat="server" ID="RadDockBio" Title="Bio Line" EnableAnimation="true"

 

 

AutoPostBack="true" CommandsAutoPostBack="true">

 

 

<ContentTemplate>

 

 

</ContentTemplate>

 

 

</telerik:RadDock>

 

 

</telerik:RadDockZone>

 

 

</telerik:RadDockLayout>

 

Jason
Top achievements
Rank 1
 answered on 14 Oct 2009
2 answers
332 views
I have a situation where i would like to present the full set of possible values in a range slider....say 0-20 but would like to be able to limit the selections to where a user cannot select below or above a certain value....say 5-10.  Is this possible?  Would I have to handle this in the OnClientValueChange event?  If handling in the OnClientValueChange, is there a code snipet showing how to stop the handle from moving past a certain value?
Dave Myers
Top achievements
Rank 1
 answered on 14 Oct 2009
4 answers
283 views
I have a snippet that support helped me with to get the RadConfirm window to hold and listen to the user's answer (ok or cancel). It works great, but when trying it in Firefox 3, it always returns false, even if I press ok. Does anyone see why it would do that? It probably has something to do with mozEvent, but don't know much about what that does.

 
        <script type="text/javascript"> 
            //MAKE SURE THAT THE FOLLOWING SCRIPT IS PLACED AFTER THE RADWINDOWMANAGER DECLARATION 
            //Replace old radconfirm with a changed version.    
            var oldConfirm = radconfirm;    
             //TELERIK 
             //window.radconfirm = function(text, mozEvent) 
             //We will change the radconfirm function so it takes all the original radconfirm attributes 
            window.radconfirm = function(text, mozEvent, oWidth, oHeight, callerObj, oTitle)    
            {    
                var ev = mozEvent ? mozEvent : window.event; //Moz support requires passing the event argument manually    
                //Cancel the event    
                ev.cancelBubble = true;    
                ev.returnValue = false;    
                if (ev.stopPropagation) ev.stopPropagation();    
                if (ev.preventDefault) ev.preventDefault();    
                    
                //Determine who is the caller    
                var callerObj = ev.srcElement ? ev.srcElement : ev.target;    
       
                //Call the original radconfirm and pass it all necessary parameters    
                if (callerObj)     
                {    
                    //Show the confirm, then when it is closing, if returned value was true, automatically call the caller's click method again.    
                    var callBackFn = function (arg)    
                    {               
                        if (arg)    
                        {               
                            callerObj["onclick"] = "";              
                            if (callerObj.click) callerObj.click(); //Works fine every time in IE, but does not work for links in Moz    
                            else if (callerObj.tagName == "A") //We assume it is a link button!    
                            {                                                           
                                try   
                                {    
                                    eval(callerObj.href)    
                                }    
                                catch(e){}    
                            }    
                        }    
                    }    
                    //TELERIK 
                    //oldConfirm(text, callBackFn, 300, 100, null, null);        
                    //We will need to modify the oldconfirm as well                 
                    oldConfirm(text, callBackFn, oWidth, oHeight, callerObj, oTitle);  
                }    
                return false;    
            }               
        </script> 

Rodrigo olivares
Top achievements
Rank 1
 answered on 14 Oct 2009
7 answers
500 views
I have a datagrid with the filtering headers turned on. It works great but I need to allow the user the save the filter definition so that the filter can be re-used by other users. Is this possible?

Thanks!
Eric Skaggs
Top achievements
Rank 2
 answered on 14 Oct 2009
2 answers
133 views
Is there a way to get all the RadDocZone objects on the page without knowing their ClientID through Javascript?  I'm essentially trying to store all the RadDock's state as a cookie without requiring an ajax request or server side code.


Thanks,
Stephen
Stephen
Top achievements
Rank 1
 answered on 14 Oct 2009
3 answers
171 views
Hello,

I have two Listboxes on my page which are bound to two different SQLDataSources.  The two tables are close to the same, but not exactly.  Here is what they consist of:

Table1 (Named as Topics):
Topic_ID (key)
TopicName (string)
Category_ID

Table2 (Named as TopicAssignment):
TopicAssignment_ID (key)
Topic_ID (Int)
Role_ID
SortOrder (Int)

Also on the page, above each Listbox are two RadComboBoxes.  One of them is bound to a SQLDataSource with a list of Categories (and ListBox1 filters by the Category_ID of RadCombobox1 to show only topics of the selected category of Combobox1), the other RadCombo is bound to a SQLDataSource of Roles (which is what Listbox2 uses to filter by Role_ID to only show Topics Assigned to the currently selected Role_ID of RadCombo2).  I have everything ajaxified via the Radajaxproxy and Manager.  Everything is working, including the reorder, EXCEPT:

The transfer from Table1 to Table2 inserts null data into the Topic_ID and Role_ID columns of the TopicAssignment table.  The SortOrder is assigned a value of 0 (which I guess is fine since they can reorder it after the transfer).  How can I control which data is inserted into TopicAssignments (Listbox2) from Topics (Listbox1)?  I want to bring over the Topic_ID (which is in the datasource) and the Role_ID (which I can grab from RadComboBox2.SelectedValue when I transfer from table1 to table2.  I'm not moving from one to the other or back, and I have transfer mode of table1 set to copy not move.  You can only reorder and delete on table2.  You can only transfer on table1 (as the settings I have chosen so far).  Here is my source so far:

<%@ Page Title="" Language="C#" MasterPageFile="~/Mentor.Master" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Mentor.Test" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
    <style type="text/css">  
        .style4  
        {  
            border-bottom: 1px solid #d0d7e5;  
            font-weight: bold;  
            color: #274c89;  
            background-color: #dde8fe;  
            width: 113px;  
        }  
        .style5  
        {  
            border-bottom: 1px solid #d0d7e5;  
            font-weight: bold;  
            color: #274c89;  
            background-color: #dde8fe;  
            width: 404px;  
        }  
        .style6  
        {  
            border-bottom: 1px solid #d0d7e5;  
            font-weight: bold;  
            color: #274c89;  
            background-color: #dde8fe;  
            width: 82px;  
        }  
    </style> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">  
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadComboBox2">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox2"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox2"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadListBox1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox2"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadListBox2">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadListBox2"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
    <asp:SqlDataSource ID="dsCategory" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        SelectCommand="SELECT [Category_ID], [CategoryName], [Client_ID] FROM [Categories] WHERE ([Client_ID] = @Client_ID) ORDER BY [CategoryName]">  
        <SelectParameters> 
            <asp:Parameter DefaultValue="1" Name="Client_ID" Type="Int32" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
        <asp:SqlDataSource ID="dsRole" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        SelectCommand="SELECT [Role_ID], [Client_ID], [RoleName] FROM [Roles] WHERE ([Client_ID] = @Client_ID) ORDER BY [RoleName]">  
            <SelectParameters> 
                <asp:Parameter DefaultValue="1" Name="Client_ID" Type="Int32" /> 
            </SelectParameters> 
    </asp:SqlDataSource> 
        <asp:SqlDataSource ID="dsTopics" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        InsertCommand="INSERT INTO [TopicAssignment] ([Topic_ID], [Role_ID], [SortOrder]) VALUES (@Topic_ID, @Role_ID, @SortOrder)"   
        SelectCommand="SELECT Topic_ID, TopicName, Category_ID, SortOrder FROM Topics WHERE (Category_ID = @Category_ID) AND (NOT EXISTS (SELECT Topic_ID, Role_ID FROM TopicAssignment WHERE (Topic_ID = Topics.Topic_ID) AND (Role_ID = @Role_ID))) ORDER BY TopicName">  
            <SelectParameters> 
                <asp:ControlParameter ControlID="RadComboBox1" DefaultValue="1"   
                    Name="Category_ID" PropertyName="SelectedValue" /> 
                <asp:ControlParameter ControlID="RadComboBox2" DefaultValue="1" Name="Role_ID"   
                    PropertyName="SelectedValue" /> 
            </SelectParameters> 
            <InsertParameters> 
                <asp:Parameter Name="Topic_ID" /> 
                <asp:Parameter Name="Role_ID" /> 
                <asp:Parameter Name="SortOrder" /> 
            </InsertParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="rsAssignedTopics" runat="server"   
        ConnectionString="<%$ ConnectionStrings:MentorDBConnectionString %>"   
        DeleteCommand="DELETE FROM [TopicAssignment] WHERE [TopicAssign_ID] = @TopicAssign_ID"   
        InsertCommand="INSERT INTO [TopicAssignment] ([Topic_ID], [Role_ID], [SortOrder]) VALUES (@Topic_ID, @Role_ID, @SortOrder)"   
        SelectCommand="SELECT [TopicAssign_ID], [Topic_ID], [Role_ID], [SortOrder] FROM [TopicAssignment] WHERE ([Role_ID] = @Role_ID) ORDER BY SortOrder"   
        UpdateCommand="UPDATE [TopicAssignment] SET [Topic_ID] = @Topic_ID, [Role_ID] = @Role_ID, [SortOrder] = @SortOrder WHERE [TopicAssign_ID] = @TopicAssign_ID">  
        <SelectParameters> 
            <asp:ControlParameter ControlID="RadComboBox2" DefaultValue="1" Name="Role_ID"   
                PropertyName="SelectedValue" Type="Int32" /> 
        </SelectParameters> 
        <DeleteParameters> 
            <asp:Parameter Name="TopicAssign_ID" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="Topic_ID" Type="Int32" /> 
            <asp:Parameter Name="Role_ID" Type="Int32" /> 
            <asp:Parameter Name="SortOrder" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="Topic_ID" Type="Int32" /> 
            <asp:Parameter Name="Role_ID" Type="Int32" /> 
            <asp:Parameter Name="SortOrder" Type="Int32" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="panelBorders">  
        <tr> 
            <td height="24" class="headerCell">  
                <table border="0" cellspacing="2"   
                        cellpadding="2" style="width: 100%">  
                    <tr> 
                        <td width="2%" align="center">  
                            <img src="images/assignpositions.png" width="16"   
                            height="16" /></td>  
                        <td width="100%" class="headerText">  
                            Build Curriculum</td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td class="panelContent" valign="top">  
                <table border="0" cellspacing="3"   
                        cellpadding="3" style="width: 100%">  
                    <tr> 
                        <td class="style5">  
                            Instructions go here</td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
    </table> 
    <table width="100%" border="0" cellspacing="0" cellpadding="0">  
                <tr> 
                  <td><img src="images/shim.gif" width="100"   
                          height="6" /></td>  
                </tr> 
            </table> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">  
      <tr> 
        <td width="485" valign="top">  
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="panelBorders">  
        <tr> 
            <td height="24" class="headerCell">  
                <table border="0" cellspacing="2"   
                        cellpadding="2" style="width: 100%">  
                    <tr> 
                        <td width="2%" align="center">  
                            <img src="images/assignpositions.png" width="16"   
                            height="16" /></td>  
                        <td width="100%" class="headerText">  
                            Available Topics</td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td class="panelContent" valign="top">  
            <table width="100%" border="0" cellspacing="0" cellpadding="0">  
        <tr> 
          <td height="28" valign="middle" class="style4" align="center">Select Category:</td> 
          <td valign="middle" class="comborowBackground">  
          <telerik:RadComboBox ID="RadComboBox1" Runat="server" AutoPostBack="True"   
                                DataSourceID="dsCategory" DataTextField="CategoryName"   
                                DataValueField="Category_ID" EmptyMessage="Select Category"   
                  Skin="Office2007" Width="100%">  
                            </telerik:RadComboBox> 
          </td> 
        </tr> 
    </table> 
    <table width="100%" border="0" cellspacing="2" cellpadding="2">  
        <tr> 
          <td height="23" valign="middle">  
              <telerik:RadListBox ID="RadListBox1" runat="server" AllowTransfer="True"   
                  DataKeyField="Topic_ID" DataSourceID="dsTopics" DataTextField="TopicName"   
                  DataValueField="Topic_ID" Height="500px" Skin="Office2007"   
                  style="top: 0px; left: 0px" TransferToID="RadListBox2" Width="100%"   
                  AllowAutomaticUpdates="True" AutoPostBackOnTransfer="True" TransferMode="Copy">  
              </telerik:RadListBox> 
            </td> 
        </tr> 
    </table> 
            </td> 
        </tr> 
    </table> 
          </td> 
        <td width="6">&nbsp;</td> 
        <td width="485" valign="top">  
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="panelBorders">  
        <tr> 
            <td height="24" class="headerCell">  
                <table border="0" cellspacing="2"   
                        cellpadding="2" style="width: 100%">  
                    <tr> 
                        <td width="2%" align="center">  
                            <img src="images/assignpositions.png" width="16"   
                            height="16" /></td>  
                        <td width="100%" class="headerText">  
                            Topics For</td> 
                    </tr> 
                </table> 
            </td> 
        </tr> 
        <tr> 
            <td class="panelContent" valign="top">  
            <table width="100%" border="0" cellspacing="0" cellpadding="0">  
        <tr> 
          <td height="28" valign="middle" class="style6" align="center">Select Role:</td> 
          <td height="28" valign="middle" class="comborowBackground">  
          <telerik:RadComboBox ID="RadComboBox2" Runat="server" DataSourceID="dsRole"   
                                DataTextField="RoleName" DataValueField="Role_ID" EmptyMessage="Select Role"   
                                Skin="Office2007" AutoPostBack="True" Width="100%">  
                            </telerik:RadComboBox> 
          </td> 
        </tr> 
    </table> 
            <table width="100%" border="0" cellspacing="2" cellpadding="2">  
        <tr> 
          <td height="23" valign="middle">  
              <telerik:RadListBox ID="RadListBox2" runat="server"   
                  AllowAutomaticUpdates="True" AllowDelete="True" AllowReorder="True"   
                  AutoPostBackOnDelete="True" AutoPostBackOnReorder="True"   
                  DataKeyField="TopicAssign_ID" DataSortField="SortOrder"   
                  DataSourceID="rsAssignedTopics" DataTextField="Topic_ID"   
                  DataValueField="TopicAssign_ID" Height="500px" Skin="Office2007"   
                  style="top: 0px; left: 0px" TransferToID="RadListBox1" Width="100%" TransferMode="Copy">  
              </telerik:RadListBox> 
            </td> 
        </tr> 
    </table> 
            </td> 
        </tr> 
    </table> 
          </td> 
      </tr> 
    </table> 
       <table width="100%" border="0" cellspacing="0" cellpadding="0">  
                <tr> 
                  <td><img src="images/shim.gif" width="100"   
                          height="6" /></td>  
                </tr> 
            </table> 
</asp:Content> 
 

Any help is appreciated!  One last thing to mention.  The select statement on table1 checks to see if the topic is already in table2 and won't display the topic in the table1 listbox if it exists already in table2 (preventing duplicates from being selected).
Heath Brown
Top achievements
Rank 1
 answered on 14 Oct 2009
2 answers
324 views
Hi Telerik team,

WE are writting an internal project to handle our databases for us, we are currently testing to see if RadGrid would be good enougth to use to display the data given a SQL data source.  This is all fine and the datagrid creates the columns and rows for the sql datasource it is given.

The only exception is that in some of our database tables we have BLOB fields, these basically store byte data.  It could essentially be anything from an image to a zip file.  Since the datagrid does not recognise the BLOB field when using something like below:

<asp:SqlDataSource ID="DS" runat="server"   
    ConnectionString="Provider=SQLOLEDB.1;Data Source=evolve;Persist Security Info=True;User ID=sa;Initial Catalog=nvis"   
    DeleteCommand="DELETE FROM [images] WHERE [ref] = ? AND [Typ] = ?"   
    InsertCommand="INSERT INTO images (ref, Typ, ext, added, modified) VALUES (?, ?, ?, ?, ?)"   
    ProviderName="System.Data.OleDb" SelectCommand="SELECT * FROM [images]"   
    UpdateCommand="UPDATE [images] SET [img] = ?, [ext] = ?, [added] = ?, [modified] = ? WHERE [ref] = ? AND [Typ] = ?">  
    <DeleteParameters> 
        <asp:Parameter Name="ref" Type="String" /> 
        <asp:Parameter Name="Typ" Type="String" /> 
    </DeleteParameters> 
    <UpdateParameters> 
        <asp:Parameter Name="ext" Type="String" /> 
        <asp:Parameter Name="added" Type="DateTime" /> 
        <asp:Parameter Name="modified" Type="DateTime" /> 
        <asp:Parameter Name="ref" Type="String" /> 
        <asp:Parameter Name="Typ" Type="String" /> 
    </UpdateParameters> 
    <InsertParameters> 
        <asp:Parameter Name="ref" Type="String" /> 
        <asp:Parameter Name="Typ" Type="String" /> 
        <asp:Parameter Name="ext" Type="String" /> 
        <asp:Parameter Name="added" Type="DateTime" /> 
        <asp:Parameter Name="modified" Type="DateTime" /> 
    </InsertParameters> 
</asp:SqlDataSource> 

there is a field in that table called img.  This is a blob field, it will serve the image if i used a

<telerik:GridBinaryImageColumn DataField="img"></telerik:GridBinaryImageColumn> 

The only problem is like i said since we are swapping datasources depending on the connection string and table selected the blob field may not be an image it could be anything.  Is there anyway to get the grid to create the column for these blob fields, and if necessary just let the user know its a blob field.  We can move onto displaying the data at a later date (i.e. if its an image display it, if its a zip then just display the binary data/string of bytes.)

I hope i have explained that correctly...

Regards

Ian Ramsay
Programmer
Imagered Ltd
www.imagered.co.uk
Ian
Top achievements
Rank 1
 answered on 14 Oct 2009
2 answers
193 views
I'm trying to use the RadFileManager tool to enable the user to display, upload, and set their avatar picture in the profile.  I'm able to get it to display and I set the value of the filename into a textbox (which is working just fine), but when I go to save the information to the profile, it references the original value that was in the textbox.  My code is below.  Please help.

Thanks.

Laurie

ASPX File:
<%@ Page Language="C#" MasterPageFile="~/CFFMFeedback.master" AutoEventWireup="true" CodeFile="ManageProfile.aspx.cs" Inherits="webadmin_ManageProfile" Title="CFFMFeedback Admin: Manage Profile" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ MasterType VirtualPath="~/CFFMFeedback.master" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">  
    <telerik:RadCodeBlock ID="codeBlock1" runat="server">  
        <script type="text/javascript">  
            //<![CDATA[
            function OnClientItemSelected(sender, args)
            {
                var pvwImage = $get("<%= imgAvatar.ClientID %>");
                var tbAvatarFileName = $get("<%= tbAvatar.ClientID %>");
                var imageSrc = args.get_path();
                var imgFileName = args.get_item().get_name();
                if (imageSrc.match(/\.(gif|jpg)$/gi))
                {
                    pvwImage.src = imageSrc;
                    pvwImage.style.display = "";
                    tbAvatarFileName.value = imgFileName;
                }
                else
                {
                    pvwImage.src = imageSrc;
                    pvwImage.style.display = "none";
                    tbAvatarFileName.value = imgFileName;
                }
            }
            //]]> 
        </script> 
    </telerik:RadCodeBlock> 
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
<h2> 
    Manage Profile</h2> 
<p>Please update the information below so it is current.  This information will be displayed in any feedback responses you post.</p> 
Name:<br /> 
<asp:TextBox id="tbName" runat="server" MaxLength="256" Width="400px"></asp:TextBox><br /> 
Position:<br /> 
<asp:TextBox id="tbPosition" runat="server" MaxLength="256" Width="400px"></asp:TextBox><br /> 
Email:<br /> 
<asp:TextBox id="tbEmail" runat="server" MaxLength="256" Width="400px"></asp:TextBox><br /> 
Phone:<br /> 
<asp:TextBox id="tbPhone" runat="server" MaxLength="256" Width="400px"></asp:TextBox><br /> 
Avatar:<br /> 
 
    <table><tr><td><telerik:RadFileExplorer ID="rfeAvatars" runat="server" EnableCreateNewFolder="False" 
        Height="200px" Width="300px" OnClientItemSelected="OnClientItemSelected" VisibleControls="Grid, Toolbar, AddressBox, ContextMenus">  
        <Configuration SearchPatterns="*.*" ViewPaths="~/images/avatars" UploadPaths="~/images/avatars" DeletePaths="~/images/avatars" /> 
    </telerik:RadFileExplorer></td><td> 
        <asp:Image ID="imgAvatar" runat="server" AlternateText="Avatar" style="display:block;  
                        margin: 10px; width: 100px; height: 100px; vertical-align: middle;" /><asp:TextBox ID="tbAvatar" runat="server" MaxLength="256" Width="150px" ReadOnly="true"></asp:TextBox></td></tr></table>  
    <br /> 
    &nbsp;<asp:Button ID="btnSaveProfile" runat="server"   
            Text="Save" OnClick="btnSaveProfile_Click" /> 
</asp:Content> 
 
 

.cs File:
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
 
public partial class webadmin_ManageProfile : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        Master.SetMessage("");  
        if (!IsPostBack)  
            BindProfileData();  
    }  
    protected void BindProfileData()  
    {  
        tbName.Text = Profile.Name;  
        tbPosition.Text = Profile.Position;  
        tbEmail.Text = Profile.Email;  
        tbPhone.Text = Profile.Phone;  
        tbAvatar.Text = Profile.AvatarPicFileName;  
        imgAvatar.ImageUrl = "~/images/avatars/" + Profile.AvatarPicFileName;  
        rfeAvatars.ExplorerMode = Telerik.Web.UI.FileExplorer.FileExplorerMode.Default;  
    }  
    protected void btnSaveProfile_Click(object sender, EventArgs e)  
    {  
        Profile.Name = tbName.Text;  
        Profile.Position = tbPosition.Text;  
        Profile.Email = tbEmail.Text;  
        Profile.Phone = tbPhone.Text;  
        Profile.AvatarPicFileName = tbAvatar.Text;  
    }  
}  
 
Laurie
Top achievements
Rank 2
 answered on 14 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?