Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
79 views
Hi,

I have a page with some controls and the last control which is below all other controls is a TreeList.
This TreeList can contain more data than it could fit on the screen, so it automatically gets bigger than the browser window and the
browser displays scroll bars. This could be ok, but the LoadingPanel image could be outside the viewport if there are too many rows.

So I want to prevent that the TreeList grows bigger than the page. I know I can set AllowScrolling to true, but this seems to work only for fixed heights, not relative ones.
Could you please tell me how I can prevent the TreeList from growing larger than the viewport?

Thanks!
Tsvetina
Telerik team
 answered on 09 Mar 2012
13 answers
222 views

Hi

I am testing a new website with IE8 and Chrome 2.0 and noticed some strange behavior with Telerik TreeView. I'm using Telerik.Web.UI Version 2009.2.701.35. On this Website, I have 2 TreeViews which works great in FireFox without any problems, but if I open the Website in Internet Explorer 8.0 or Chrome 2.0 the left TreeView doesn't work. Screenshots:

Website in IE 8.0: http://bit.ly/cqvc6

Website in Chrome 2.0: http://bit.ly/6YkBU


Both Browsers are installed on Windows Vista SP2 with default Settings (I made no changes to the configuration after installation)

 

In IE 8.0 I receive many of the following JavaScript Errors:

-------------------------------------------------------------------------------------------------------
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Tue, 21 Jul 2009 22:52:07 UTC

Message: 'this._element' is null or not an object
Line: 1931
Char: 1
Code: 0
URI: http://localhost:4500/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3ade-CH%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.701.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3ade-CH%3a7e598a31-3beb-49a1-914c-5f530240f0ea%3a16e4e7cd%3af7645509%3a24ee1bba%3a1e771326%3ae524c98b%3ae330518b%3ac8618e41%3ae4f8f289%3aed16cbdc%3a874f8ea2%3a19620875%3a33108d14%3abd8f85e4

-------------------------------------------------------------------------------------------------------

 

Do you have any suggestions to fix this problem.

Thank you in advanced.


Beste regards

Mike Miller

Plamen
Telerik team
 answered on 09 Mar 2012
1 answer
70 views
I have a question about the groups. I see from the examples in the help about how the groups can be used with the core scripts that most controls use. What about other telerik controls?

I have one particular type of page that has a telerik grid, buttons, textboxes, combo boxes and a window on it. I use this same display page in numerous spots in my web application (but not on every page). Could I combine the scripts for these controls into a group so the script manager will cache these scripts in this combination and then know to get the cache for this page?
 
If so then how would I do that? So in other words when it encounters this page it gets the cached scripts for the control combination but if it encounters another page that say only has a radgrid and buttons on it then it would use the normal script combine method.
Simon
Telerik team
 answered on 09 Mar 2012
1 answer
82 views
When I click the edit button, I will get javascript error for "value of 1/1/0001 12:00:00AM is not valid for selecteddate. should between mInDate and MasDate, parameter name "SelectedDate".
My date field "ProcessedDate" is a read only field, not sure why I got this error and how to solve it?

<telerik:GridBoundColumn DataField="ProcessedDate" FilterControlAltText="Filter ProcessDate column"
                                               HeaderText="ProcessDate0" UniqueName="ProcessDate"  
                                              DataFormatString="{0:d}"  ReadOnly="True">
                                           </telerik:GridBoundColumn>
Thanks
Tsvetina
Telerik team
 answered on 09 Mar 2012
2 answers
148 views
Dear Sir,

I am unable to access controls inside a radmenu dynamic template. I am want to handle radlistbox selectedindexchanged event or access selectedvalue property when the menu item is clicked. Please help 

Private Sub mnuRoom_ItemClick(sender As Object, e As Telerik.Web.UI.RadMenuEventArgs) Handles mnuRoom.ItemClick
        If e.Item.Level = 0 Then
            Response.Redirect("~/Pages/Products.aspx?category=" & e.Item.Value)
        Else
            Dim lstCat As RadListBox = DirectCast(e.Item.FindControl("lstCategories"), RadListBox)
            Response.Redirect("~/Pages/Products.aspx?category=" & lstCat.SelectedValue)
        End If
    End Sub


   Private Sub Page_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender
Using dbContext As New familia.OpenAccess.EntitiesModel
            mnuRoom.Items.Clear()
            Dim room As IQueryable(Of ProductCategory)
            room = From r In dbContext.ProductCategories Where r.IsActive = True And r.ParentCategory = 0 Select r
            For Each r In room
                Dim roomitem As New Telerik.Web.UI.RadMenuItem
                roomitem.DataItem = r
                roomitem.Value = r.CategoryID
                mnuRoom.Items.Add(roomitem)
                Dim mainmenuItemTemplate As New MainMenuItemTemplate()
                mainmenuItemTemplate.InstantiateIn(roomitem)
                Dim childItem As New RadMenuItem()
                childItem.CssClass = "mainmenudropdown"
                childItem.ItemTemplate = New MenuItemTemplate()
 roomitem.Items.Add(childItem)
Next
        End Using
End Sub



Class MenuItemTemplate
    Implements ITemplate
#Region "ITemplate Members"

    Public Sub InstantiateIn(container As Control) Implements ITemplate.InstantiateIn
        Dim parentItem As RadMenuItem = DirectCast(container.Parent, RadMenuItem)
        Dim room As ProductCategory = DirectCast(parentItem.DataItem, ProductCategory)
        'Dim div As New HtmlGenericControl("div")

        Dim contents As New Panel

       contents.CssClass = "menucontents"
        container.Controls.Add(contents)

        Dim categories As New Panel
        categories.CssClass = "menucategorypanel"

        Dim l As New Label
        l.ForeColor = System.Drawing.ColorTranslator.FromHtml("#1B75BC")
        l.Font.Size = 14
        l.Font.Bold = True
        l.Text = room.CategoryName

        categories.Controls.Add(l)

        Dim cat As New RadListBox

        cat.CssClass = "menucategorylist"
        Using dbContext As New familia.OpenAccess.EntitiesModel
room.RoomID))
            cat.DataSource = From c In dbContext.ProductCategories Where c.IsActive = True And c.ParentCategory = room.CategoryID Select c
            cat.DataTextField = "CategoryName"
            cat.DataValueField = "CategoryID"
            cat.ID = "lstCategories"
            cat.Width = 231
            cat.DataBind()

      End Using
       AddHandler cat.SelectedIndexChanged, New EventHandler(AddressOf lstCategories_SelectedIndexChanged)
        cat.Font.Size = 12
        categories.Controls.Add(cat)

        contents.Controls.Add(categories)

        Dim brands As New Panel
        brands.CssClass = "menubrandpanel"

        Dim b As New Label
        b.ForeColor = System.Drawing.ColorTranslator.FromHtml("#6B6B6B")
        b.Font.Size = 14
        b.Font.Bold = True
        b.Text = "TOP BRANDS"

        brands.Controls.Add(b)

        Dim bnd As New RadListBox
        bnd.CssClass = "menucategorylist"
        Using dbContext As New familia.OpenAccess.EntitiesModel
            bnd.DataSource = dbContext.ProductBrands.Where(Function(c) c.TopBrand = True And c.ProductCategories.Any(Function(r) r.CategoryID = room.CategoryID))

            bnd.DataTextField = "BrandName"
            bnd.DataValueField = "BrandID"
            bnd.Width = 231
            bnd.DataBind()
        End Using

        bnd.Font.Size = 12
        brands.Controls.Add(bnd)

        contents.Controls.Add(brands)

        Dim bottom As New Panel

        bottom.CssClass = "menucategorybottom"

        Dim bimg As New RadBinaryImage
        bimg.ImageUrl = "/images/layout/brand.png"
        bimg.ResizeMode = BinaryImageResizeMode.Fit
        bimg.Width = 20
        bimg.Height = 20
        bimg.CssClass = "buttonimage"
        bottom.Controls.Add(bimg)
        Dim brand As New RadButton
        brand.ButtonType = RadButtonType.LinkButton
        brand.CssClass = "brandbutton"
        brand.Font.Bold = True
        brand.Font.Size = 10
        brand.Text = "All Brands"
        bottom.Controls.Add(brand)

        Dim bdimg As New RadBinaryImage
        bdimg.ImageUrl = "/images/layout/BestDeals.png"
        bdimg.ResizeMode = BinaryImageResizeMode.Fit
        bdimg.Width = 20
        bdimg.Height = 20
        bdimg.CssClass = "buttonimage"

        bottom.Controls.Add(bdimg)

        Dim deals As New RadButton
        deals.ButtonType = RadButtonType.LinkButton

        deals.CssClass = "brandbutton"
        deals.Font.Bold = True
        deals.Font.Size = 10
        deals.Text = "Best Deals"
        bottom.Controls.Add(deals)

        Dim psimg As New RadBinaryImage
        psimg.ImageUrl = "/images/layout/Premimum.png"
        psimg.ResizeMode = BinaryImageResizeMode.Fit
        psimg.Width = 20
        psimg.Height = 20
        psimg.CssClass = "buttonimage"

        bottom.Controls.Add(psimg)

        Dim pre As New RadButton
        pre.ButtonType = RadButtonType.LinkButton
        pre.CssClass = "brandbutton"
        pre.Font.Bold = True
        pre.Font.Size = 10
        pre.Text = "Premium Selections"
        bottom.Controls.Add(pre)

        Dim nimg As New RadBinaryImage
        nimg.ImageUrl = "/images/layout/new.png"
        nimg.ResizeMode = BinaryImageResizeMode.Fit
        nimg.Width = 20
        nimg.Height = 20
        nimg.CssClass = "buttonimage"

        bottom.Controls.Add(nimg)

        Dim ne As New RadButton
        ne.ButtonType = RadButtonType.LinkButton
        ne.CssClass = "brandbutton"
        ne.Font.Bold = True
        ne.Font.Size = 10
        ne.Text = "Recently Added"
        bottom.Controls.Add(ne)
        contents.Controls.Add(bottom)

  End Sub

    Private Sub lstCategories_SelectedIndexChanged(sender As Object, e As System.EventArgs)

    End Sub
#End Region
End Class
Zafar
Top achievements
Rank 1
 answered on 09 Mar 2012
1 answer
77 views
I am having a RadTreeList control in my page. I need to validate that every first hierarchy items(0th Nested Level items) can have only 5 levels of children( not 5 children) i.e., each 0th Nested Level items can have 5 hierarchical levels. I am using both item creation method and drag-drop method. While dragging from some item to an item, I need to validate that the destination item has only 5 hierarchical levels after dropping. If the sum of hierarchical levels is equal or greater than 5, then the dragged item should not be allowed to drop to the destination item.
Can anyone help for this.

Thanks in Advance,
Abilash
Daniel
Telerik team
 answered on 09 Mar 2012
7 answers
112 views
Hi,

I am using Rad Scheduler to show the appointment on daily basis. What i want is, that if there is no appointment for a particular slot then that slot should not be created.
for example i have this on datatable  
9:00 Am to 10:00 Am | Do something
10:00 Am to 11:00 Am | Do nothing
and then
1:00 Pm to 2:00 Pm | Do something Again

so what i did, i have set 9:00 Am as start time and 2:00 Pm as end time
it had also created time slot for 11:00 to 12:00 and 12:00 to 1:00 which are not in Datatable.

i did tried 
 if (e.TimeSlot.Appointments.Count < 1)
        {
            e.TimeSlot.Control.Visible = false;
          }
but still i can see hours on Hours Column and blank space in between the time slot.
is there any way i can stop the time slot from creating or create timeslot according to slot's in Datatable.
Please help.
Thanks 
Prashant Rawat
 
Plamen
Telerik team
 answered on 09 Mar 2012
1 answer
52 views
maybe through vsto
Slav
Telerik team
 answered on 09 Mar 2012
1 answer
209 views
I have the following setup as shown in the markup below. There is an ajaxified panel which contains an imagebutton and a hyperlink. Clicking on either of these opens a rad Window, which has a close handler. The close handler initiates the "click" event of a hidden button in order for me to be able to run some server-side code after the window closes. When I open the radwindow using the hyperlink, everything works as expected. When I do so using the image button, I get the following non-descript javascript error when the hidden button .click event is raised.

Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 405

This error doesn not occur if I don't ajaxify the panel.

I have tried to research this error and track down the cause, but to no avail. When I look at this in Fiddler, I notice the URL that fiddler errors on is .{my path}/javascript:void(0);. I don't know where the javascript:void(0); comes from... but I obviously include that in the Imagebutton PostbackUrl to prevent a postback when the imagebutton is clicked. I also don't know why this piece of the imagebutton declaration would have anything to do with this since the error occurs on the attempt to raise the hidden button's click event.

Any Idea why the image button implementation wouldn't work, while the hyperlink does?

Markup:

<telerik:RadCodeBlock ID="rcb1" runat="server">
          
        <script language="javascript">
  
            function OpenDialog() {
                var oWin = radopen('http://www.yahoo.com', ''); 
                oWin.add_close(Refresh);            
             }
  
            function Refresh() {
                $get('<%= tiReloader.ClientID %>').click();
            }
              
  
        </script>
  
    </telerik:RadCodeBlock>
      
<asp:ScriptManager ID="MyScriptManager" runat="server" AsyncPostBackTimeout="7200"></asp:ScriptManager>
<telerik:RadAjaxLoadingPanel id="lpGlobal" Runat="server" Transparency="18" CssClass="AjaxLoadingProgress"></telerik:RadAjaxLoadingPanel>
<asp:Panel id="pnlT" runat="Server" height="400px">
    <asp:Button ID="tiReloader" runat="server" Text="Button" style="display:none;" />
    <asp:ImageButton id="ib" runat="Server" ImageUrl="~/global/images/icons/edit.png" AlternateText="Open Dialog from Image Button" ImageAlign="AbsMiddle" PostBackUrl="javascript:void(0);" OnClientClick="OpenDialog()" /><br/><br/>
    <asp:Hyperlink id="hl" runat="Server" target="_self" navigateurl="javascript:OpenDialog();" >Open Dialog from Hyperlink</asp:Hyperlink>
</asp:Panel>


In code-behind, I ajaxify the panel using an ajaxmanager which is part of my page base class:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SetAjaxManagerSettings()
    End Sub
  
    Private Sub SetAjaxManagerSettings()
        Me.AddAjaxSetting(pnlT, pnlT, lpGlobal, Unit.Percentage(100), Web.UI.UpdatePanelRenderMode.Block )
    End Sub
  
    Private Sub tiReloader_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles tiReloader.Click
        Threading.Thread.Sleep(500)
    End Sub
  
Public Sub AddAjaxSetting(ByVal initiatorControl As Control, ByVal updatedControl As Control, ByVal loadingPanel As RadAjaxLoadingPanel, ByVal updatePanelHeight As Unit, ByVal updatePanelRenderMode As UpdatePanelRenderMode)
  
            Dim ajaxManager As RadAjaxManager = Telerik.Web.UI.RadAjaxManager.GetCurrent(Me)
  
            If ajaxManager IsNot Nothing Then
  
                If initiatorControl IsNot Nothing And updatedControl IsNot Nothing Then
  
                    Dim setting As AjaxSetting = New AjaxSetting
  
                    ajaxManager.AjaxSettings.Add(setting)
  
                    setting.AjaxControlID = initiatorControl.ID
  
                    Dim ajxUpdatedControl As New AjaxUpdatedControl()
  
                    ajxUpdatedControl.ControlID = updatedControl.ID
  
                    If loadingPanel IsNot Nothing Then
  
                        ajxUpdatedControl.LoadingPanelID = loadingPanel.ID
  
                    End If
  
                    setting.UpdatedControls.Add(ajxUpdatedControl)
  
                    ajxUpdatedControl.UpdatePanelRenderMode = updatePanelRenderMode
  
                    If Not updatePanelHeight.IsEmpty Then
  
                        ajxUpdatedControl.UpdatePanelHeight = updatePanelHeight
  
                    End If
  
                Else
  
                    Throw New Exception("The initiatorControl or updatedControl is NULL. Cannot add AjaxSetting.")
  
                End If
  
            Else
  
                Throw New Exception("Telerik RadAjaxManager not found on page. Set UseSharedAjaxManager property to True in Page_Init event or add a Telerik RadAjaxManager control to the page.")
  
            End If
  
        End Sub
Maria Ilieva
Telerik team
 answered on 09 Mar 2012
2 answers
103 views
We use the RAD Tab strip to divide the form under various sections and noticed that when we try to set a textbox value of one tab with value entered in another tab, we get an overlapping style in the target textbox.

This happens if the target textbox has a empty message set. I've attached the markup code below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!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>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <script type="text/javascript" id="telerikClientEvents1">
//<![CDATA[
 
        function txtTab1Title_ClientOnBlur(sender, args) {
            //Add JavaScript handler code here
            var ctrl1 = $("input[id$='txtTab2Title']");
            var txtTab2Title = $find(ctrl1.get(0).id);
            txtTab2Title.set_value(sender.get_value());
        }
 
        function txtTab2Title_ClientOnBlur(sender, args) {
            //Add JavaScript handler code here
            var ctrl1 = $("input[id$='txtTab1Title']");
            var txtTab1Title = $find(ctrl1.get(0).id);
            txtTab1Title.set_value(sender.get_value());
        }
//]]>
    </script>
</head>
<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>
    <div class="MasterContainer">
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
            SelectedIndex="0" Skin="Hay" Width="100%">
            <Tabs>
                <telerik:RadTab runat="server" Text="Tab1" Value="Tab1" Owner="RadTabStrip1"
                    Selected="True" PageViewID="rpvTab1" />
                <telerik:RadTab runat="server" Text="Tab2" Value="Tab2" Owner="RadTabStrip1" PageViewID="rpvTab2" />
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
            <telerik:RadPageView ID="rpvTab1" runat="server" Selected="true" Width="100%">
                <h4>
                    Tab1 Tab Contents</h4>
                <div class="FormContainer">
                    <telerik:RadTextBox ID="txtTab1Title" runat="server" EmptyMessage="Tab1 Title"
                        Label="Title:" Width="400px">
                        <ClientEvents OnBlur="txtTab1Title_ClientOnBlur" />
                    </telerik:RadTextBox>
                </div>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rpvTab2" runat="server" Width="100%">
                <h4>
                    Tab2 Tab Contents</h4>
                <div class="FormContainer">
                    <telerik:RadTextBox ID="txtTab2Title" runat="server" EmptyMessage="Tab2 Tab Title"
                        Label="Title:" Width="400px">
                        <ClientEvents OnBlur="txtTab2Title_ClientOnBlur" />
                    </telerik:RadTextBox>
                </div>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
    </div>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    </form>
</body>
</html>


Vasil
Telerik team
 answered on 09 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?