Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
224 views
Hi - i'm using the latest Radmenu control and was wondering how you might be able to set the background transparency of the menu that opens up after you place the mouse over the top-most level.

So in essence when you move your mouse over the menu, the cascading menu has a nice semi-transparent look.

Thanks

Kamen Bundev
Telerik team
 answered on 14 Sep 2010
1 answer
111 views
Hi,
      I have added a radionButtonList controll to a  RadTreeNode (Part 1). Now when i try to save the values according to the selected value of RadioButtonList , am not able to do that. Its not allowing me to convert that not back to a radiobutton list (part 2). I have added the code i used. Please correct me if am wrong and tell me how to achive it. 
part 1) // adding RadioButtonList to treenode.

 

 

RadTreeNode brandNode1 = new RadTreeNode(Name,Value);  // node

 

RdTree_TeamBrand.Nodes.Add(brandNode1 );     // adding node to the tree -'RdTree_TeamBrand'

 

RadioButtonList radioblist = new RadioButtonList(); //defining a radio btn list 

 

radioblist.Items.Add(

new ListItem("P", "1"));

 

radioblist.Items.Add(

new ListItem("S", "0"));

 

brandNode1.Controls.Add(radioblist); // adding radioblist to controls of brandNode1

part 2) // retriving the selected RadioButtonList value . This part not working. 
RadioButtonList drplst = (RadioButtonList)RdTree_TeamBrand.Nodes[0].Controls[0]; // not working

 

             or

 

 

RadioButtonList drplst  = RdTree_TeamBrand.Nodes[0].Controls[0].FindControl(RdTree_TeamBrand.Nodes[0].Controls[0].ClientID)
//some thing like this also not working

 

 

 

Nikolay Tsenkov
Telerik team
 answered on 14 Sep 2010
2 answers
87 views

Hi,

My Telerik Version is 2009.1.402.35.

I want to access RadioButtonList in RadTreeNode. How to do this?

Here is the sample code in which i'm not able to access the radio control.

public partial class WebUserControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadTreeView1.DataSource = Getdata();
            RadTreeView1.DataTextField = "FirstName";
            RadTreeView1.DataValueField = "ID";
            RadTreeView1.DataBind();
  
            foreach (RadTreeNode node in RadTreeView1.Nodes)
            {
                //Create First Level Node
                RadTreeNode node1 = new RadTreeNode("Test1", node.Value);
  
                //Create Second Level Node and make it checkable false
                RadTreeNode node2 = new RadTreeNode();
                node2.Checkable = false;
  
                RadioButtonList radio = new RadioButtonList(); radio.Items.Add(new ListItem("P", "1")); radio.Items.Add(new ListItem("S", "0"));
                //Add RadioButton to node2
                node2.Controls.Add(radio);
  
                //Add Node2 to Node1
                node1.Nodes.Add(node2);
  
                //Add Node1 to main Node
                node.Nodes.Add(node1);
            }
        }
    }
  
    public DataTable Getdata()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("ID", typeof(string)));
        dt.Columns.Add(new DataColumn("FirstName", typeof(string)));
        dt.Columns.Add(new DataColumn("LastName", typeof(string)));
        dt.Rows.Add("1", "Sudhanva", "G");        
        dt.Rows.Add("3", "Raman", "C V");
        dt.Rows.Add("4", "Hrithik", "Roshan");
        return dt;
  
    }
  
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            foreach (RadTreeNode node in RadTreeView1.Nodes)
            {
                foreach (RadTreeNode node1 in node.Nodes)
                {
                    foreach (RadTreeNode node2 in node1.Nodes)
                    {
                        RadioButtonList radio1 = (RadioButtonList)node2.Controls[0];
                    }
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        //RadioButtonList radio12 = (RadioButtonList)RadTreeView1.Nodes[0].Nodes[0].Controls[0];
  
    }
    
}

.ascx code:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs"
    Inherits="WebUserControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<br />
<br />
<telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="true" >
</telerik:RadTreeView>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Save" />

.aspx code:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %>
  
  
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
     
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
  
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="WebUserControl1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="WebUserControl1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
              <telerik:AjaxSetting AjaxControlID="Button1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="WebUserControl1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
      
    <uc1:WebUserControl ID="WebUserControl1" runat="server" />
</asp:Content>

 

Please help.

Thanks in advance,
Sudhanva

Nikolay Tsenkov
Telerik team
 answered on 14 Sep 2010
0 answers
66 views
Hey,

I am creating a search criteria screen based on dataset from DB. This screen generally contains 10 labels, 15 combobox and 5 textbox / checbox or may be more.

Now based on datatype of each datarow, I dynamically create either a combo or textbox or required control. The probelm is that I don't like the time taken to load this screen via this method.

Can you suggest a better method to build similar screens ? So that I don't have to create new instance of combobox for every datarow. 

Another Idea
Build a combo with common properties ( height, width, etc) and for each datarow just keep cloning the same combo and load values to it. I have not tried above idea and don't know that will it improve performance or not.

Are there other methods to get better performance while creating radcontrols dynamically ?

Please let me know if you need any other information.

Thanks
ankool
Top achievements
Rank 1
 asked on 14 Sep 2010
1 answer
91 views
Hi all,

I was wondering if anyone knows if there is a fallback by default in TreeView? Or has ever done something like that and which is the easiest way to make it.

/D
Nikolay Tsenkov
Telerik team
 answered on 14 Sep 2010
0 answers
112 views
Hey,

I am creating a search criteria screen based on dataset from DB. This screen generally contains 10 labels, 15 combobox and 5 textbox / checbox or may be more.

Now based on datatype of each datarow, I dynamically create either a combo or textbox or required control. The probelm is that I don't like the time taken to load this screen via this method.

Can you suggest a better method to build similar screens ? So that I don't have to create new instance of combobox for every datarow. 

Another Idea
Build a combo with common properties ( height, width, etc) and for each datarow just keep cloning the same combo and load values to it. I have not tried above idea and don't know that will it improve performance or not.

Are there other methods to get better performance while creating radcontrols dynamically ?

Please let me know if you need any other information.

Thanks

ankool
Top achievements
Rank 1
 asked on 14 Sep 2010
1 answer
172 views
I have setup an ajax masterpage which has a skinmanager and a radformdecorator on it.

I only have one aspx page which dynamically loads in user controls into the content placeholder based on the tab selected.

Below are two questions I am currently stuck on if anyone can help me.

  1. Inside MyAccount.ascx I have a combo box which allows the user to select a skin to use which is working fine for the skin manager, but I keep receiving an error when trying to hook up the radformdecorator.
  2. Inside Header.ascx I am dynamically adding the following tabs 'home' and 'contact us' on the first page load and not on any postback. This stops the tabs from repeating everytime the page is posted back. However depending on who logs in, i need to add another two tabs to the radtabstrip, 'My Account' if a user logs in and 'Admin' if an admin logs in. Also they need to be removed when they log out. Can this be done?

Master Page HTML:

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<%@ Register TagPrefix="UC" TagName="Header" Src="~/Header.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="ScriptManager" runat="server" />        
        <telerik:RadSkinManager runat="server" ID="RadSkinManager" Enabled="true" ></telerik:RadSkinManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager" runat="server" />  
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="1000"  Skin="Vista" IsSticky="true">
        <asp:Image ID="Image1" runat="server" ImageUrl="~/loading.gif" AlternateText="Loading.." /></telerik:RadAjaxLoadingPanel>
        <telerik:RadFormDecorator runat="server" ID="RadFormDecorator" EnableAjaxSkinRendering="true" DecoratedControls="All" Enabled="true" /> 
  
        <div>
         <UC:Header ID="Header" runat="server" />  <br />
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">        
            </asp:ContentPlaceHolder>
        </div>
    </form>
</body>
</html>

Header.ascx HTML:

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Header.ascx.vb" Inherits="Header" %>
<asp:Panel runat="server" ID="PanelHeader">
    <table>
        <tr>
            <td>
                <telerik:RadTabStrip ID="HeaderTabStrip" runat="server" SelectedIndex="0" EnableAjaxSkinRendering="true"></telerik:RadTabStrip>
            </td>
        </tr>
    </table>
</asp:Panel>
  
<script type="text/javascript">
// the code below will allow the tab to be reselected
Telerik.Web.UI.RadTab.prototype.select = function (e)
{   
    var parent = this.get_parent();
    if (!parent)
    {
        this._cachedSelected = true;
        return true;
    }
       
    var shouldNavigate = this._shouldNavigate();
    var selectedTab = parent.get_selectedTab();
    var tabStrip = this.get_tabStrip();
       
//these lines are commented so the tabstrip postbacks even if you click on the selected tab
//      if (!shouldNavigate && selectedTab == this && !tabStrip.get_clickSelectedTab())
//          return false;
           
    if (tabStrip._raiseCancelEvent("tabSelecting", this, e)) 
        return false;
   
    var suppressVisualUpdate = this._shouldPostBack() || (shouldNavigate && (!this.get_target() || this.get_target() == "_self"));
       
    if (!e)
        suppressVisualUpdate = false;
           
    if (selectedTab && selectedTab != this)
        selectedTab.unselect(suppressVisualUpdate, e);
           
    parent._setSelectedIndex(this.get_index());
    tabStrip._registerSelectedTab(this);
   
    if (!suppressVisualUpdate)
    {
        this._updateAppearance(true);
        this._updateSiblings(true);
        this._setChildListDisplay("");
           
        if (this._scroller)
        {
            this._scroller._showArrows();
        }
        else
        {
            tabStrip._scrollInitInProgress = true;
            this._initScrolling();
            tabStrip._scrollInitInProgress = false;
        }
        if (tabStrip._reorderTabsOnSelect)
            Telerik.Web.UI.RadTabStrip._reorderTabs(parent.get_childListElement(), this.get_element());
    }       
       
    if (tabStrip.get_multiPage())
        this._selectPageView(suppressVisualUpdate);
       
    tabStrip._raiseEvent("tabSelected", this, e);
    return true;
}
</script>

Header.ascx Code behind:

Imports Telerik.Web.UI
  
Partial Class Header
    Inherits System.Web.UI.UserControl
  
    Protected Sub HeaderTabStrip_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles HeaderTabStrip.TabClick
        Dim ctrlID As String = Nothing
        Select Case e.Tab.Value
            Case 0
                ctrlID = "Home.ascx"
                Exit Select
            Case 1
                ctrlID = "MyAccount.ascx"
                Exit Select
            Case 2
                ctrlID = "Admin.ascx"
                Exit Select
            Case 3
                ctrlID = "ContactUs.ascx"
                Exit Select
        End Select
  
        If TypeOf (Page) Is BasePage Then
            Dim CPage As BasePage = CType(Page, BasePage)
            Dim PanelContent As Panel = DirectCast(CPage.Content("ContentPlaceHolder1").FindControl("PanelContent"), Panel)
            If (PanelContent IsNot Nothing) Then
                CPage.LoadUserControl(ctrlID, PanelContent)
            Else
                ' load an error message here
            End If
        End If
  
    End Sub
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
        If (Not Page.IsPostBack) Then
            ' make these tabs DB driven based on user role!
            ' I want My Account and Admin tabs to only appear if user is logged in and based on their role.
            AddTab("Home", 0, True)
            AddTab("My Account", 1, True)
            AddTab("Admin", 2, True)
            AddTab("Contact Us", 3, True)
        End If
  
        Dim AjaxManager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
        Dim panel As Panel = DirectCast(Me.Page.Master.FindControl("ContentPlaceHolder1").FindControl("PanelContent"), Panel)
        If (panel IsNot Nothing) Then
            AjaxManager.AjaxSettings.AddAjaxSetting(HeaderTabStrip, panel)
        End If
        AjaxManager.AjaxSettings.AddAjaxSetting(HeaderTabStrip, PanelHeader)
          
    End Sub
  
    ' adds the tab to the tab strip
    Private Sub AddTab(ByVal ID As String, ByVal val As Integer, ByVal bVisible As Boolean)
        Dim tab As RadTab = New RadTab()
        tab.Value = val
        tab.Text = ID.Replace(" ", "")
        tab.Visible = bVisible
        HeaderTabStrip.Tabs.Add(tab)
    End Sub
End Class

MyAccount.ascx html

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="MyAccount.ascx.vb" Inherits="MyAccount" %>
My Account UC<br /><br />
  
Skin: 
  
<telerik:RadComboBox ID="DDLSkinChooser" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DDLSkinChooser_SelectedIndexChanged" EnableAjaxSkinRendering="true" >
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="WebBlue" Value="WebBlue" />
        <telerik:RadComboBoxItem runat="server" Text="Vista" Value="Vista" />
        <telerik:RadComboBoxItem runat="server" Text="Black" Value="Black" />
        <telerik:RadComboBoxItem runat="server" Text="Outlook" Value="Outlook" />
        <telerik:RadComboBoxItem runat="server" Text="Hay" Value="Hay" />
    </Items>
</telerik:RadComboBox><br /><br />
  
<asp:Button runat="server" ID="btnTest" Text="My Test" />

MyAccount.ascx code behind:

Imports Telerik.Web.UI
  
Partial Class MyAccount
    Inherits System.Web.UI.UserControl
  
    Protected Sub DDLSkinChooser_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles DDLSkinChooser.SelectedIndexChanged
        RadSkinManager.GetCurrent(Page).Skin = e.Text
        Dim RadFormDecorator As RadFormDecorator = DirectCast(Page.Master.FindControl("RadFormDecorator"), RadFormDecorator)
        If (RadFormDecorator IsNot Nothing) Then
            RadFormDecorator.Skin = e.Text
            RadFormDecorator.EnableAjaxSkinRendering = True
        End If
        DDLSkinChooser.EnableAjaxSkinRendering = True
        Dim radtab As RadTabStrip = CType(Me.Page.Master.FindControl("Header").FindControl("HeaderTabStrip"), RadTabStrip)
        If (radtab IsNot Nothing) Then
            radtab.EnableAjaxSkinRendering = True
        End If
    End Sub
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim AjaxManager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
        Dim panel As Panel = CType(Me.Page.Master.FindControl("ContentPlaceHolder1").FindControl("PanelContent"), Panel)
  
        If (panel IsNot Nothing) Then
            AjaxManager.AjaxSettings.AddAjaxSetting(DDLSkinChooser, panel)
        End If
  
        ' Adding this in for radformdecorator produces an error
        'Dim RadFormDecorator As RadFormDecorator = DirectCast(Page.Master.FindControl("RadFormDecorator"), RadFormDecorator)
        'If (RadFormDecorator IsNot Nothing) Then
        'AjaxManager.AjaxSettings.AddAjaxSetting(DDLSkinChooser, RadFormDecorator)
        'End If
  
  
        Dim PanelHeader As Panel = CType(Me.Page.Master.FindControl("Header").FindControl("PanelHeader"), Panel)
        If (PanelHeader IsNot Nothing) Then
            AjaxManager.AjaxSettings.AddAjaxSetting(DDLSkinChooser, PanelHeader)
        End If
  
    End Sub
End Class

Any help would be greatly appreciated.

Thank you.
Iana Tsolova
Telerik team
 answered on 14 Sep 2010
1 answer
147 views
Hello Sir,

I am using RadWindow in My Application.

All works Fine with IIS6.

But When I Configure with IIS7 it's Give me Error and Not Close window and nothing do in the form.

It's Give me Cryptography Error. I think it's a Viewstate Cryptography Error.

Please Give me proper solution for that.

I attached a Screenshot of Error.

Thanks.

Kishor Dalwadi.
Georgi Tunev
Telerik team
 answered on 14 Sep 2010
1 answer
173 views
I visited the captcha demo on your site and listened to the audio example and it had a nice female voice.

When I started developing with it locally, I thought my version had a "weird" male voice (all browsers), but then when I deployed it, it had the nice female voice again.

If I play a .wav file directly from the local resource (C:\Program Files\Telerik\RadControls for ASP.NET AJAX Q1 2010\App_Data\RadCaptcha) it's the nice female voice.

Any idea why my local deploy sounds like a strange male voice when played through any browser?

Also, this is a heads-up for developers who might have the same problem.  I was trying to find a Voice="Male" or Voice="Female" type of setting and there isn't one!  lol!  :-)
Pero
Telerik team
 answered on 14 Sep 2010
1 answer
156 views
Hi,

We open some screen into RadWindow, but we would like to avoid the horizontal scrollbar because it's very unconfortable for users, so we would like to use AutoSize property but only for Width, I've try to set a fixed Height, but this property is ignored when AutoSize is set.

may be we could have a client API method like :
setSize(300, 'auto');
setSize('auto', 300);

and something smarter in server side, if Height and AutoSize is set : Autosize only Width.

Thanks
Shinu
Top achievements
Rank 2
 answered on 14 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?