Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
125 views
Hi,

To sum it up: I am trying to resize an iFrame on a RadPane to fit 100% height.  

The Scenario: My project is based on the Webmail demo, but in the bottom Pane I want to have an iFrame which correctly resizes then the Splitter is dragged.

I tried to add a client side Javascript block of code on the OnClientResized event of the RadPane, but it does not seem to be triggered and thereby resizing the iFrame.  

I don't know if it would be easier to use the ContentURL property to use the RadPane as an iFrame, but do not know how to amend the demo to use a datasource to get the URL as I currently use the same DetailsView as in the demo to effect the iFrame src property.  When I set the ContentURL at design time then the Grid does not render any details.  

Sorry, but this is my first attempt at using the Telerik AJAX controls.

Regards,
Ray
Svetlina Anati
Telerik team
 answered on 25 Feb 2011
1 answer
97 views
Hi, I have a Rad Editor that has the document manager to allow the user to upload documents to the server. Now it only allows files with the extension .txt, .pdf, .doc.   I would like to also allow it to upload files with other extensions such as .ppt, .zip, .xlsm  etc.  Is there a way I can do this?

Thanks!
Rumen
Telerik team
 answered on 25 Feb 2011
3 answers
140 views
Hi Telerik Team

I am facing an issue with Detail table view page size change event. In My design I have one MasterTableView and three detail table view as coded below.

<telerik:RadGrid ID="radGrid"  AllowFilteringByColumn="true" AutoGenerateColumns="false" runat="server" >
    <MasterTableView Name="masterTableView" runat="server" HierarchyLoadMode="ServerOnDemand">     
        <CommandItemTemplate>        
            <table width="100%" cellpadding="3px">
                <tr >
                       <td align="center">
                        <div id="divCommandButtons" runat="server">
                            <asp:LinkButton ID="LinkButton1" Text="Button" Visible="false" CssClass="black-button" runat="server" />
                            <img id="spacer1" f" border="0" heigth="5" width="0" runat="server"/>
                            </div>                                                                
                    </td>
                </tr>                
            </table>               
        </CommandItemTemplate>                  
        <CommandItemStyle HorizontalAlign="Center" Wrap="false" Height="30"/>  
        <PagerStyle CssClass="rgPager" />
        <DetailTables >
            <telerik:GridTableView Name="detailTableL1" Width="100%" runat="server"  HierarchyLoadMode="ServerOnDemand" >
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="" MasterKeyField="" />
                    </ParentTableRelation>                        
                   <CommandItemStyle CssClass="GridCommand" />
                   <CommandItemTemplate>
                        <table width="100%" cellpadding="3px">
                             <tr>                             
                                <td align="center" >                                                                            
                                 </td>
                            </tr>
                        </table>    
                    </CommandItemTemplate>                        
                    <PagerStyle CssClass="rgPager" />
                    <EditFormSettings EditColumn-UpdateText="<span>Save</span>" EditColumn-InsertText="<span>Save</span>" EditColumn-CancelText="<span>Cancel</span>"/>
                  <AlternatingItemStyle BackColor="#F3F6F9" />


and the issue I am facing is with ChanePageSize in Detail Table View. For Master table view when I change its page size its works for me. Also when i tried to move page by page in detail table view it works but when i change page size say 10 to 20 in detail table it not working.

The way i set pager template and size from CS page.

 masterView.SetPaging(GridPagerMode.NextPrevAndNumeric);
 public void SetPaging(GridPagerMode pagerMode, int pageSize)
        {
            this.GridTableView.AllowPaging = true;      
            this.GridTableView.PagerStyle.Mode = pagerMode;
            this.gridTableView.PagerStyle.AlwaysVisible = true;
        }


Thanks..

 
Vikram
Top achievements
Rank 1
 answered on 25 Feb 2011
3 answers
82 views

Been struggling for some time, have tried support, but not getting a clear answer for what I think is a pretty common scenario. The typical response I get is that at least one element needs to have a fixed height in order to use 100% hieght.

Just looking to make a UI that scales with the browser using Telerik controls. Things work ok with individual controls, things work fine, if you combine controls, then things go bad.

So here is the basic example to start where there is a splitter, tool bar, grid, tab strip and multipage.

Having just a splitter with grids with 100% height works great. Then you want to add some tabs or toolbars, and now the grids cannot calculate 100% height properly (does not account for other control height).

Any recommendations on how to use these controls to properly scale with the browser?

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="SS.Test" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head id="Head1" runat="server">
    <title>FullWindow</title>
    <style type="text/css">
        html, body, form
        {
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <telerik:RadScriptBlock runat="server">
        <script type="text/javascript">
   
        </script>
    </telerik:RadScriptBlock>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="sc1" runat="server" ScriptMode="Release">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="ram1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="grid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Width="100%" Orientation="Horizontal" PanesBorderSize="0" BorderSize="0">
        <telerik:RadPane ID="topPane" runat="server" Scrolling="None">
            <telerik:RadToolBar ID="toolbar1" runat="server" Width="100%">
                <Items>
                    <telerik:RadToolBarButton Text="command 1">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Text="command 2">
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton Text="command 3">
                    </telerik:RadToolBarButton>
                </Items>
            </telerik:RadToolBar>
            <telerik:RadGrid ID="grid1" Width="100%" Height="100%" runat="server">
                <ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true" Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                </ClientSettings>
            </telerik:RadGrid>
        </telerik:RadPane>
        <telerik:RadSplitBar runat="server">
        </telerik:RadSplitBar>
        <telerik:RadPane ID="bottomPane" runat="server" Scrolling="None">
            <telerik:RadTabStrip ID="tab1" runat="server" MultiPageID="mp1">
                <Tabs>
                    <telerik:RadTab Text="Tab 1" Selected="true">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Tab 2">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Tab 3">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="mp1" runat="server" SelectedIndex="0">
                <telerik:RadPageView ID="RadPageView1" runat="server">
                    <telerik:RadGrid ID="RadGrid1" Width="100%" Height="100%" runat="server">
                        <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server">
                    <telerik:RadGrid ID="RadGrid2" Width="100%" Height="100%" runat="server">
                        <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3" runat="server">
                    <telerik:RadGrid ID="RadGrid3" Width="100%" Height="100%" runat="server">
                        <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                </telerik:RadPageView>
            </telerik:RadMultiPage>
        </telerik:RadPane>
    </telerik:RadSplitter>
    </form>
</body>
</html>

Imports System.Data.SqlClient
  
Public Class Test
    Inherits System.Web.UI.Page
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
  
        If IsPostBack = False Then
  
            Dim dt As New DataTable
  
            dt.Columns.Add("Data")
  
            Dim row As DataRow
  
            For i = 1 To 100
  
                row = dt.NewRow
                row("Data") = i
                dt.Rows.Add(row)
  
            Next
  
            grid1.DataSource = dt
            grid1.DataBind()
  
        End If
  
  
    End Sub
  
  
  
    Private Sub grid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles grid1.SelectedIndexChanged
  
        Dim dt As New DataTable
  
        dt.Columns.Add("Data")
  
        Dim row As DataRow
  
        For i = 200 To 300
  
            row = dt.NewRow
            row("Data") = i
            dt.Rows.Add(row)
  
        Next
  
        RadGrid1.DataSource = dt
        RadGrid1.DataBind()
  
        dt = New DataTable
  
        dt.Columns.Add("Data")
  
  
  
        For i = 300 To 400
  
            row = dt.NewRow
            row("Data") = i
            dt.Rows.Add(row)
  
        Next
  
        RadGrid2.DataSource = dt
        RadGrid2.DataBind()
  
        dt = New DataTable
  
        dt.Columns.Add("Data")
  
  
        For i = 400 To 500
  
            row = dt.NewRow
            row("Data") = i
            dt.Rows.Add(row)
  
        Next
  
        RadGrid3.DataSource = dt
        RadGrid3.DataBind()
  
  
    End Sub
  
End Class


Pavlina
Telerik team
 answered on 25 Feb 2011
13 answers
249 views
I created the following server control by creating the readonly property:

    public class RadComboBox : Telerik.Web.UI.RadComboBox
    {
        private Label lbl = new Label();
        private bool _readOnly;
        public bool ReadOnly
        {
            get
            {
                return _readOnly;
            }
            set
            {
                _readOnly = value;
            }
        }
protected override void Render(System.Web.UI.HtmlTextWriter writer)
    {
        if (_readOnly)
        {                        
            lbl.Text = this.Text;
            lbl.ReadOnly = true;
            lbl.RenderControl(writer);
        }
        else
        {
            base.Render(writer);
        }
    }
if I use this object with RadGrid in GridTemplateColumn fixed in the ItemTemplate ReadOnly to true cause the following JS error message:

Error 'undefined' is null or not an object

radgrid is into a RadAjaxPanel and uses a masterpage that call the RadScriptManager and RadAjaxManager.

I tried to use ajaxSettings instead of RadAjaxPanel but the same error.

how can I fix it?

thanks for any replies
Vasil
Telerik team
 answered on 25 Feb 2011
2 answers
103 views
Hi All,
          Im using my Login Button inside the RadDock and i can't set the defaultbutton property of my page's form tag.Also i cant get my controls in script which is inside RadDock.I solved it by getting the clientID of btLogin .

  (ie):document.getElementById("<%=btLogin.ClientID %>")

and same problem might have been occured with defaultbutton .Here is my design.

 <form id="form1" runat="server" defaultbutton="btLogin">
<div>
<telerik:RadDockZone ID="rdzLogin" runat="server" Width="100%" Height="350px">
         <telerik:RadDock ID="rdLogin" Title="<b>Login</b>" runat="server" EnableAnimation="true"
             DefaultCommands="None" EnableDrag="false" Skin="Default" EnableRoundedCorners="true">
              <ContentTemplate>
                   <asp:Button ID="btLogin" runat="server" Login" OnClick="btLogin_Click" />
             </ContentTemplate>
        </telerik:RadDock>
    </telerik:RadDockZone> 
       </div>
</form>

I get the following error while setting defaultbutton in form tag itself and when i remove it no problem occurs :

The DefaultButton of 'form1' must be the ID of a control of type IButtonControl.

Can i set defaultbutton from code behind? Please Help me out...

Regards and Thanks,
    Titti.S

TSM
Top achievements
Rank 1
 answered on 25 Feb 2011
6 answers
37 views
I added a RadPanelBar to my project for the first time today. 

It immediately asks that you select "Build RadPanelBar" to begin creating the control.

I go into that, add some test bars, change the text, etc... Then I click OK.  In my design view I see the bars, text, font changes, etc... However, in the source view nothing happens.  Nothing is changed, so if I make any source changes then everything about my bars is lost.  I ended up just editing the RadPanelBar source by hand to add my items and make my font changes.

What am I doing wrong?  Why aren't my modifications made through the editor tool working?  I click "OK" when I finish and the design view changes, but the source remains empty.  It's odd because if I go back into the editor it still has all my settings in there, they just never move over to the Source view.

Is there something I need to do to actually commit the changes made in the RadPanelBar editor to my project?
Greg St.Pierre
Top achievements
Rank 1
 answered on 25 Feb 2011
6 answers
52 views
Hello,

I have a page having a couple of grids

Everything seems working fine, once it is deployed in the server the grids in a specific page is taking life to load if there is no record!

When there is no record, we bind the grid with an object having null reference

Any workarounds?

Thank you

Regards
Raj
Rajz
Top achievements
Rank 1
 answered on 25 Feb 2011
3 answers
56 views
Hi  All,

I am facing weired issue, i have a nested radgrid2 which is placed inside a top level radgrid1.

Radgrid1 has two columns, the 1st one work as primary key for Radgrid2.
Both works fine, but whenever i click the navigation button of Radgrid 2, it loose the data and after that it display
"No Data to display"


Kindly see the inline code as well as attached screen-shots.
-----------------
Code ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Most.ascx.cs"
    Inherits="Most%>
<%@ Register Assembly="Telerik.Web.UI, Version=2010.1.309.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

    <script type="text/javascript" language="javascript">


        //sharepoint postback to work after clicking on telerik export to pdf
        if (typeof (_spBodyOnLoadFunctionNames) != 'undefined' && _spBodyOnLoadFunctionNames != null) {
            _spBodyOnLoadFunctionNames.push("supressSubmitWraper");
        }
        function supressSubmitWraper() {
            _spSuppressFormOnSubmitWrapper = true;

        }
             
        var tableView = null;
        function pageLoad(sender, args) {
            tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
        }

        function RadComboBox1_SelectedIndexChanged(sender, args) {
            tableView.set_pageSize(sender.get_value());
        }

        function changePage(argument) {
            tableView.page(argument);
        }

        function RadNumericTextBox1_ValueChanged(sender, args) {
            tableView.page(sender.get_value());
        }
       
    </script>

</telerik:RadScriptBlock>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<%--/*****************************************/--%>
<table width="980px">
    
    <tr>
        <td valign="top">
            <table width="240px">
                <tr>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                            <ContentTemplate>
                                <table class="xyx-columnwidth">
                                    
                                    <tr >
                                        <td>
                                            <table>
                                                
                                                <tr>
                                                    <td align="right">
                                                       
                                                        <asp:Button ID="BtnLookup" runat="server" CssClass="xyx-sumbitbtn" OnClick="BtnLookup_Click"
                                                            OnClientClick="" Text="Submit" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
          
}


Iana Tsolova
Telerik team
 answered on 25 Feb 2011
10 answers
219 views
I'm working with the Item Drag and Drop sample, and it works very well.  However, I have modified it slightly.  The source datagrid has a different number of columns than the destination datagrid.  I have modified the code so that when the item is dropped, I manually add the row to the grid.  That all works fine, but I really would like to know which column the item was dropped on.  Is there a way to get this information?

Thanks,
Derrick.
Jack
Telerik team
 answered on 25 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?