Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views
Hi,
I want to apply the page-flip effect on radgrid. For this I have applied paging on RadGrid and applied 'jflip.js' jquery but its not working. I have to implement the page-flip effect on the RadGrid pages on moving to next records via paging.
To understand the page-flip effect please go to http://www.jquery.info/scripts/jFlip/demo.html

Thanks
Mona Bisht
Dimo
Telerik team
 answered on 14 Sep 2010
1 answer
153 views
I have a .aspx page which has a user control in it. The application is ajax based.

The .aspx page has a RadWindowManager which I've made a public property to access from other user controls.

When I click on a button in my user control to open a radwindow, I don't get any errors and the correct page loads into a RadWindow. However, any styling or properties that I apply to the window are not carried across at all. It opens a RadWindow as if no settings were specified.

Any help is much appreciated!

(I have tested that the created RadWindow is actually added to the RadWindowManager... it is added. I also only have one RadWindowManager on that is on the aspx page throughout the application).

Here is my code in the aspx page for the RadWindowManager and below it is the code behind.
<telerik:RadWindowManager ID="RadWindowManager_Default" runat="server" Skin="Default" Animation="Fade" 
    AnimationDuration="300" DestroyOnClose="True">
    </telerik:RadWindowManager>
  
... code behind ...
  
public RadWindowManager RWM_Default
        {
            get { return RadWindowManager_Default; }
            set { RadWindowManager_Default = value; }
        }

Here is my code in the page_load event in the user control ascx for the new window.
RadWindow Window_FR_View;
  
        protected void Page_Load(object sender, EventArgs e)
        {
            //Add window for popup
            Window_FR_View = new RadWindow();
            Window_FR_View.ID = "RadWindow_FR";
            Window_FR_View.NavigateUrl = "OnTime_Reports/fire_report_view_popup.aspx";
            Window_FR_View.Height = Unit.Pixel(600);
            Window_FR_View.Width = Unit.Pixel(400);
            Window_FR_View.Modal = true;
            Window_FR_View.VisibleStatusbar = false;
            Window_FR_View.Behaviors = Telerik.Web.UI.WindowBehaviors.Close;
  
            ((_Default)Page).RWM_Default.Windows.Add(Window_FR_View);
  
            //Register Javascript for RadWindow
            String script4 = "" +
                "function openRadWindow_FR(Page_To_Open, RadWindow_Control_ID) " +
                "{" +  
                    "radopen(Page_To_Open, RadWindow_Control_ID);" +
                "}";
  
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "FR_LOAD", script4, true);


Here is the code for the onclick event which tries to open the window
protected void Button_Run_Fire_Report_OnClick(object sender, EventArgs e)
        {
            String script5 = "openRadWindow_FR(\"OnTime_Reports/fire_report_view_popup.aspx\", \"" + Window_FR_View.ClientID + "\");";
  
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "FR_LOAD_LIST", script5, true);
        }
Georgi Tunev
Telerik team
 answered on 14 Sep 2010
3 answers
77 views
Hi

I am working with Rad AJAX controls. I am facing some problem regarding ajax panel.

When i press button inside Rad Ajax panel my whole page is shaking. Can you tell me why my page is vibrating. 

Regards
JK
Radoslav
Telerik team
 answered on 14 Sep 2010
7 answers
206 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
107 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
82 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
59 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
109 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
160 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?