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

Objective:- From the server-side, I need to open a radwindow(defined in javascipt of the aspx page) automatically on an IF condition.

In aspx page, I defined the radwindow as:-
<telerik:RadWindowManager Skin="WBDA" ID="AssetPreviewManager" Modal="true" 
EnableEmbeddedSkins="false" runat="server"  DestroyOnClose="true" Behavior="Close" 
style="z-index:8000"
     <Windows>  
     <telerik:RadWindow ID="DisclaimerAlertWindow" runat="server" Width="720px" Height="220px" 
Modal="true" visibleStatusbar="false" VisibleTitlebar="false" keepInScreenBounds="true" title="Sourav">                                           
     </telerik:RadWindow
     </Windows
     </telerik:RadWindowManager>

In Javascript, a fucntion is defined for opening the radwindow:-
function openRadWindow()
     {
        var oWnd = radopen('DisclaimerAlert.aspx, 'DisclaimerAlertWindow');
        oWnd.set_title('Access Denied !'); 
        oWnd.Center();
        return false;
     }

So on the server side of the aspx page, In the Page Load event an IF condition is checked and then I'm calling 'openRadWindow()' function as:-
protected void Page_Load(object sender, EventArgs e)

{

if (fieldValue == "False")
{
 string xyz = "<script type='text/javascript' lang='Javascript'>myFunction();</script>";
 ClientScript.RegisterStartupScript(this.GetType(), "Window", xyz);
}
}

But on running this, these Javascript errors are coming:-

1. Object doesn't support this property or method.
2. 'undefined' is null or not an object



Please help how to achieve my objective. I am totally stuck.
Waseem
Top achievements
Rank 1
 answered on 14 Oct 2012
2 answers
113 views
I am trying to open a RadWindow in client side after i click the button but it gives the error: object expected
it doesn't calls the javascript method(openWin2()) to open the new RadWindow

Below is my code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Dialog1.aspx.cs" Inherits="Telerik_Sample.Dialog1" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>The Eruption</title>
    <style type="text/css">
        html, body, form
        {
            padding: 0;
            margin: 0;
            height: 100%;
            background: ##797979;
        }
        
        body
        {
            font: normal 11px Arial, Verdana, Sans-serif;
        }
        fieldset
        {
            height: 150px;
        }
    </style>
</head>
<body onload="AdjustRadWidow">
    <form id="form1" runat="server">
    <!--RadScript Manager-->
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>    
        <script type="text/javascript">
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            }

            function AdjustRadWidow() {
                var oWindow = GetRadWindow();
                setTimeout(function () { oWindow.autoSize(true); if ($telerik.isChrome || $telerik.isSafari) ChromeSafariFix(oWindow); }, 500);
            }

            //fix for Chrome/Safari due to absolute positioned popup not counted as part of the content page layout
            function ChromeSafariFix(oWindow) {
                var iframe = oWindow.get_contentFrame();
                var body = iframe.contentWindow.document.body;

                setTimeout(function () {
                    var height = body.scrollHeight;
                    var width = body.scrollWidth;

                    var iframeBounds = $telerik.getBounds(iframe);
                    var heightDelta = height - iframeBounds.height;
                    var widthDelta = width - iframeBounds.width;

                    if (heightDelta > 0) oWindow.set_height(oWindow.get_height() + heightDelta);
                    if (widthDelta > 0) oWindow.set_width(oWindow.get_width() + widthDelta);
                    oWindow.center();

                }, 310);

                function openWin2() {
                    var parentPage = GetRadWindow().BrowserWindow;
                    var parentRadWindowManager = parentPage.GetRadWindowManager();
                    var oWnd2 = parentRadWindowManager.open("Dialog2.aspx", "RadWindow2");
                    window.setTimeout(function () {
                        oWnd2.setActive(true);
                    }, 0);
                }

                function returnToParent() {
                    //create the argument that will be returned to the parent page
                    var oArg = new Object();

                    //get the city's name
                    oArg.cityName = document.getElementById("cityName").value;

                    //get the selected date from RadDatePicker
                    var datePicker = $find("<%= Datepicker1.ClientID %>");
                    oArg.selDate = datePicker.get_selectedDate().toLocaleDateString();

                    //get a reference to the current RadWindow
                    var oWnd = GetRadWindow();

                    //Close the RadWindow and send the argument to the parent page
                    if (oArg.selDate && oArg.cityName) {
                        oWnd.close(oArg);
                    }
                    else {
                        alert("Please fill both fields");
                    }
                }

            }</script>    
    <div>
        <fieldset id="fld1">
            <legend>Travel Plan</legend><span style="margin: 6px 0 0 18px;">Choose date:</span>
            <telerik:RadDatePicker ID="Datepicker1" Skin="Sunset" runat="server" Width="140">
                <ClientEvents OnPopupOpening="AdjustRadWidow" OnPopupClosing="AdjustRadWidow"/>
            </telerik:RadDatePicker>
            <div style="margin: 20px 0 0 0;">
                <div style="float: left; margin: 6px 0 0 18px;">
                    Choose City:</div>
                <input type="text" style="width: 100px;" id="cityName" value="Sofia" />                
               <button onclick="openWin2(); return false;" title="Choose City"> // the error is shown in this line
                    ...</button>
            </div>
        </fieldset>
        <div style="margin-top: 4px; text-align: right;">
            <button title="Submit" onclick="returnToParent(); return false;" >
                Submit</button>
        </div>
    </div>
    </form>
</body>
</html>

Waseem
Top achievements
Rank 1
 answered on 14 Oct 2012
3 answers
195 views
hi,
i want to implement a small solution for uploading csv files.
i put a radupload inside radwindow - Problem: i need to keep the radwindow open "onclick" the "Submit" button.
I know i need a postback for radupload but Is there any solution to keep the radwindow open after postback.
I triied it with ajax but it doesnt work
Thanks
Waseem
Top achievements
Rank 1
 answered on 14 Oct 2012
0 answers
102 views
Hi all member
I have a RadGrid in RadWindow .when RadWindow Is Maximum size can not write to grid in insert or edit mode
please help to me for solve this problem

main.aspx form is :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="Samfa.Main" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server" lang="fa" >
    <title title="gggg"></title>
     <link href="Styles/main.css" rel="stylesheet" type="text/css" />
      <link href="Styles/global.css" rel="stylesheet" type="text/css" />
    <link href="Styles/global.css" rel="stylesheet" type="text/css" />
    <link href="Styles/TelerikCustom.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.8.2.js" type="text/javascript"></script>
     <script src="Scripts/global.js" type="text/javascript"></script>
    <script src="Scripts/main.js" type="text/javascript"></script>
    <link href="TabStrip.Mys.css" rel="stylesheet" type="text/css" />
 <style>
        
  
  </style>
  
</head>
<body onresize="setdvcontentHeight()">
  <div id="form1" style="height:100%">
     
        <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>
  
    <div id="dvRibion">
        <telerik:RadRibbonBar  ID="RadRibbonBar1"  runat="server"  Width="100%" EnableQuickAccessToolbar="False" OnClientButtonClicked="openNewWindow" 
                        
                        style="max-width: 100%;" Skin="Web20"  
                        RenderInactiveContextualTabGroups="False" OnClientApplicationMenuItemClicked="onAppMenuItemClicked"  
            SelectedTabIndex="0" 
                        
           
  
           
             
                
            <Tabs>
  
            <telerik:RibbonBarTab ID="RibbonBarTab3" runat="server" Text="تجهیزات" Value="mnuContractSystem" Container="" Visible="true" 
                        ParentWebControl="RadRibbonBar1" CssClass="customClassName">
  
      
      
  
<telerik:RibbonBarGroup ID="RibbonBarGroup8" runat="server" Text="Base info" Container="" 
        ParentWebControl="RadRibbonBar1"><Items>
             
  
               
  
            <telerik:RibbonBarButton runat="server" Value="Base.aspx?BaseType=4" 
            ImageUrlLarge="~/Images/Size.png" Size="Large" 
            ImageRenderingMode="Dual" Text="Unit" QuickAccess="Disabled" 
            Container="" ParentWebControl="" Group="" Font-Names="Tahoma" Font-Size="8pt" 
            ID="RibbonBarButton9"></telerik:RibbonBarButton>
  
  
            
  
</Items>
</telerik:RibbonBarGroup>
  
</telerik:RibbonBarTab>
  
  
  
</Tabs>
  
                  
  
  
  
  
  
  
  
        </telerik:RadRibbonBar>
         
       
         <telerik:RadWindowManager ShowOnTopWhenMaximized="false" DestroyOnClose="true" PreserveClientState="false" ReloadOnShow="true" Localization-Close="بستن" Localization-Maximize="بزرگ شدن" Localization-Minimize="Ú©ÙˆÚ†Ú© شدن"   MinHeight="410px" MinWidth="650px"
            OnClientActivate="OnClientActivate" OnClientClose="OnClientClose" 
        Behaviors="Close,Maximize,Minimize,Move,Resize" OnClientCommand="OnClientCommand" RestrictionZoneID="dvcontent"  
        ID="RadWindowManager1"  runat="server" EnableShadow="false" 
            Skin="Office2010Blue">
             <Localization Close="close" Maximize="maximum" Minimize="minimum"  />
    </telerik:RadWindowManager>
  
    </div>
    <div id="dvcontent" ondblclick="autohideribion();" >
        </div>
          
    <div id="taskbarm"  >
        <telerik:RadTabStrip OnClientTabSelected="OnClientTabSelected" EnableEmbeddedSkins="False" 
            ID="RadTabStrip1" Font-Names="Tahoma"
            ScrollChildren="True" ScrollButtonsPosition="Middle" Width="730px" Skin="Mys"
            Orientation="HorizontalBottom" runat="server"  
            SelectedIndex="0" Font-Bold="True" Font-Size="9pt" ForeColor="White">
            <Tabs>
                <telerik:RadTab Style="display: none;" Selected="True" />
            </Tabs>
        </telerik:RadTabStrip>
  
      
    </div>
     
</div>
   
    <script>
        $(document).ready(setdvcontentHeight());
    </script>
        
      <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            // <![CDATA[
  
            var manager = null;
            var tabStrip = null;
  
            function pageLoad() {
                //get a reference to the needed controls - 
                manager = $find("<%=RadWindowManager1.ClientID %>");
                tabStrip = $find("<%=RadTabStrip1.ClientID %>");
                
  
                  
            }
  
            //opening the window
            function openNewWindow(sender, args) {
                             // var item = args.get_item();
                var itemUrl = args.get_button()._value;//  item.get_value();
                 
                var ribbonbar = $find("RadRibbonBar1");
                var button0 = ribbonbar.findButtonByValue(itemUrl);
                var itemText = itemText = button0.get_text();
  
                 
                var imgurl= args.get_button()._imageUrlLarge;
                if (itemUrl) {
  
                    var newtab = $telerik.toTabStrip(tabStrip).findTabByValue(itemUrl);
                    if (newtab != null) {
                        return;
                    }
                    var windowURL = itemUrl;
                    var oWnd = radopen(itemUrl, null);
                    oWnd.set_title(itemText);
  
                    $telerik.toWindow(oWnd).set_autoSize(true);
                    $telerik.toWindow(oWnd).set_visibleStatusbar(false);
                    $telerik.toWindow(oWnd).set_iconUrl(imgurl);
                    oWnd.center();
                    tabStrip.trackChanges();
                    //create a new tab
                    var tab = new Telerik.Web.UI.RadTab();
                    //set the text of the tab
                    tab.set_text(itemText);
                    tab.set_value(itemUrl);
   
                    oWnd.correspondingTab = tab;
      
                    //add the tab to the tabstrip
                    tabStrip.get_tabs().add(tab);
                    tabStrip.repaint();
                    tab.correspondingWnd = oWnd;
//                    tab.set_imageUrl(item.get_imageUrl());
                    tabStrip.commitChanges();
  
                    //Select this tab
                    tab.select();
                }
            }
  
            function OnClientCommand(sender, args) {
                //because we don't want to show the minimized RadWindow, we hide it after minimizing
                //and raise the _Maximized flag (used in OnClientTabSelected)
                if (args.get_commandName() == "Minimize") {
                    if (sender.isMaximized()) {
                        sender._Maximized = true;
                    }
  
                    sender.hide();
                    //raise the _toMinimize flag (used in OnClientActivate)
                    sender._toMinimize = true;
                    var tab = sender.correspondingTab;
                    if (tab) {
                        tab.set_selected(false);
                    }
                }
            }
  
            function OnClientTabSelected(sender, args) {
                //get a reference to the corresponding window
                var win = args.get_tab().correspondingWnd;
  
                if (!win) return;
  
                if (!win.isVisible()) {
                    win.show();
                    win.restore();
                    //if the window was maximized before client minimizes it, we need to restore
                    //its maximized state
                    if (win._Maximized) {
                        win.maximize();
                        win._Maximized = null;
                    }
  
                }
  
                //ensure that the currently active RadWindow will have the highest z-Index.
                var popupElem = win.get_popupElement();
                var oldZindex = parseInt(popupElem.style.zIndex);
                var styleZIndex = win.get_stylezindex();
                var newZIndex = (styleZIndex) ? styleZIndex : Telerik.Web.UI.RadWindowUtils.get_newZindex(oldZindex);
                popupElem.style.zIndex = "" + newZIndex;
                win.setActive(true);
  
  
  
            }
  
            function OnClientActivate(sender, args) {
                var tab = sender.correspondingTab;
                if (tab && !sender._toMinimize) {
                    tab.set_selected(true);
                }
                sender._toMinimize = false;
            }
            function OnClientClose(oWnd) {
  
                //remove the corresponding tab from the tabstrip
                var tab = oWnd.correspondingTab;
                if (tab) {
                    tabStrip.trackChanges();
                    tabStrip.get_tabs().remove(tab);
                    tabStrip.commitChanges();
                }
  
            }
  
             
            // ]]>
  
            function onAppMenuItemClicked(sender, args) {
                switch (args.get_item()._text.toString().toLowerCase()) {
                    case "عدم نمایش":
                        showtaskbarm();
                        hideRibion();
                        setdvcontentHeight();
  
                        break;
                    case "ورود مجدد":
                        window.location = "login.aspx";
                        break;
                    case "تغییر کلمه عبور":
                        alert(' به شما مجوز تغییر کلمه عبور داده نشده است');
                        break;
  
                }
  
            }
  
            $("#taskbarm").click(function () {
                $telerik.toWindowManager(manager).cascade();
            });
             
        </script>
    </telerik:RadCodeBlock>
</body>
</html>


and Base.aspx is :
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Base.aspx.cs" Inherits="Samfa.Base" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
  
    <table align="center" cellpadding="0" cellspacing="0" dir="rtl" 
           style="width: 100%">
             
        <tr>
            <td>
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                          
                        <telerik:AjaxSetting AjaxControlID="dgdBase">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="dgdBase" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                    <ClientEvents OnRequestStart="RequestStart" />
                </telerik:RadAjaxManager>
                </td>
        </tr>
        <tr>
            <td align="center">
              
                <telerik:RadGrid ID="dgdBase" runat="server"  
                                 AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                 AutoGenerateHierarchy="True" CellSpacing="0" GridLines="None" 
                                 MasterTableView-Dir="RTL" 
                                 ShowStatusBar="True" Skin="Outlook" Width="100%" 
                                 onneeddatasource="dgdBase_NeedDataSource" 
                    oninsertcommand="dgdBase_InsertCommand" 
                    ondeletecommand="dgdBase_DeleteCommand" 
                    onupdatecommand="dgdBase_UpdateCommand" >
                   
                    <ExportSettings FileName="SamfaGridExport">
                    </ExportSettings>
                    <ClientSettings EnableRowHoverStyle="true">
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="True"  />
                     
                    </ClientSettings>
                     
                    <MasterTableView CommandItemDisplay="Top" Dir="RTL" EditMode="EditForms" 
                                     Font-Names="Tahoma" HierarchyLoadMode="Client" 
                                    >
                        <PagerStyle AlwaysVisible="True" Font-Names="Tahoma" Font-Size="9pt" 
                                    Mode="NumericPages"  PageButtonCount="15" 
                                   PageSizeLabelText="9pt" 
                                    />
                        <CommandItemTemplate>
                            <table>
                                <tr>
  
                                    <td align="center" valign="top">
                                        <telerik:RadButton ID="btnSave" runat="server" CommandName="UpdateEdited" 
                                                           Font-Names="tahoma" Font-Size="8.5pt" Text="ذخیره" Skin="Hay" 
                                                           Visible="<%# dgdBase.EditIndexes.Count > 0 %>" Width="80px">
                                            <Icon SecondaryIconBottom="3" SecondaryIconHeight="25px" SecondaryIconLeft="0" 
                                                  SecondaryIconRight="0" SecondaryIconTop="5" 
                                                  SecondaryIconUrl="Images/Ok.png"
                                                  SecondaryIconWidth="25px" />
                                        </telerik:RadButton>
                                    </td>
                                    <td align="center" valign="top">
                                        <telerik:RadButton ID="btnNew" runat="server" CommandName="InitInsert" 
                                                           Font-Names="tahoma" Font-Size="8.5pt" Text="New" skin="Hay"
                                                           Visible="<%# !(dgdBase.EditIndexes.Count > 0 || dgdBase.MasterTableView.IsItemInserted) %>" Width="80px">
                                            <Icon SecondaryIconBottom="3" SecondaryIconHeight="25px" SecondaryIconLeft="0" 
                                                  SecondaryIconRight="0" SecondaryIconTop="5" 
                                                  SecondaryIconUrl="Images/add.png"
                                                  SecondaryIconWidth="25px" />
                                        </telerik:RadButton>
                                    </td>
                                    <td align="center" valign="top">
  
                                        <telerik:RadButton ID="btnEdit" runat="server" CommandName="EditSelected" 
                                                           Font-Names="tahoma" Font-Size="8.5pt"  Text="Edit"  Skin="Hay"
                                                           Visible="<%# !(dgdBase.EditIndexes.Count > 0 || dgdBase.MasterTableView.IsItemInserted) %>"  Width="80px">
                                            <Icon SecondaryIconBottom="3" SecondaryIconHeight="25px" SecondaryIconLeft="0" 
                                                  SecondaryIconRight="0" SecondaryIconTop="5" 
                                                  SecondaryIconUrl="Images/edit.png"
                                                  SecondaryIconWidth="25px" />
                                        </telerik:RadButton>
                                    </td>
                                    <td align="center" valign="top">
                                        <telerik:RadButton ID="btnSaveNewItem" runat="server" 
                                                           CommandName="PerformInsert" Font-Names="tahoma" Font-Size="8.5pt" Skin="Hay" 
                                                           Text="Save" 
                                                           Visible="<%# dgdBase.MasterTableView.IsItemInserted %>" Width="100px">
                                            <Icon SecondaryIconBottom="3" SecondaryIconHeight="25px" SecondaryIconLeft="0" 
                                                  SecondaryIconRight="0" SecondaryIconTop="5" 
                                                  SecondaryIconUrl="Images/Ok.png"
                                                  SecondaryIconWidth="25px" />
                                        </telerik:RadButton>
                                    </td>
                                    <td align="center" valign="top">
                                        <telerik:RadButton ID="btnCancel" runat="server" CausesValidation="false" 
                                                           CommandName="CancelAll" Font-Names="tahoma" Font-Size="8.5pt" skiin="Hay"
                                                           Text="Cancel" 
                                                           Visible="<%# dgdBase.EditIndexes.Count > 0 || dgdBase.MasterTableView.IsItemInserted %>" 
                                                           Width="80px">
  
                                            <Icon SecondaryIconBottom="3" SecondaryIconHeight="25px" SecondaryIconLeft="0" 
                                                  SecondaryIconRight="0" SecondaryIconTop="5" 
                                                  SecondaryIconUrl="Images/cancel.png"
                                                  SecondaryIconWidth="25px" />
                                        </telerik:RadButton>
                                    </td>
                                    <td align="center" valign="top">
                                        <telerik:RadButton ID="btnDelete" runat="server" CommandName="DeleteSelected" 
                                                           Font-Names="tahoma" Font-Size="8.5pt"  Text="Delete" Skin="Hay"   Visible="<%# !(dgdBase.EditIndexes.Count > 0 || dgdBase.MasterTableView.IsItemInserted) %>"  
                                                           Width="80px">
  
                                            <Icon SecondaryIconBottom="3" SecondaryIconHeight="25px" SecondaryIconLeft="0" 
                                                  SecondaryIconRight="0" SecondaryIconTop="5" 
                                                  SecondaryIconUrl="Images/delete.png"
                                                  SecondaryIconWidth="25px" />
                                        </telerik:RadButton>
                                    </td>
  
                                    <%--  <td align="center"  valign="top">
                                    <telerik:RadButton ID="btnExportEx" runat="server" CausesValidation="false" Skin="Hay" 
                                    Font-Names="tahoma" Font-Size="8.5pt" 
                                    Text="تبدیل به Excel" Width="110px">
                                    <Icon SecondaryIconBottom="3" SecondaryIconHeight="25px" SecondaryIconLeft="0" 
                                    SecondaryIconRight="0" SecondaryIconTop="5" 
                                    SecondaryIconUrl="Images/excel.png"
                                    SecondaryIconWidth="25px" />
                                    </telerik:RadButton>
                                         
                                    </td>--%>
                                    <td align="left" style="width: 100%;" valign="top">
                                        <table>
                                            <tr>
                                                <td style="font-family:Tahoma">
                                                    <span style="font:Tahoma">Search : </span>
                                                </td>
                                                <td>
                                                    <telerik:RadTextBox ID="txtSearch" ClientIDMode="Static"    Font-Names="tahoma" runat="server">
                                                    </telerik:RadTextBox>
                                                </td>
                                                <td>
                                                      
                                                    <asp:ImageButton ID="img" ImageUrl="Images/Search.png" Height="16px" OnClick="btnSearch_Click" runat="server" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                
                            </table>
                        </CommandItemTemplate>
                        <CommandItemSettings ExportToPdfText="Export to PDF"  
                                             ShowExportToExcelButton="True" ShowExportToPdfButton="True" />
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" 
                                            Visible="True">
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                                              Visible="True">
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridTemplateColumn DataField="strName" 
                                                        FilterControlAltText="Filter strName column" 
                                                        GroupByExpression="strName Group By strName" HeaderText="Subject" 
                                                        SortExpression="strName" UniqueName="strName">
                                <EditItemTemplate>
                                    <telerik:RadTextBox ID="strNameTextBox" runat="server" Font-Names="Tahoma" 
                                                        Skin="Office2010Blue" Text='<%# Bind("strName") %>'>
                                    </telerik:RadTextBox>
                                      
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="strNameLabel" runat="server" Text='<%# Eval("strName") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="iNumber" 
                                                     FilterControlAltText="Filter iNumber column" ForceExtractValue="Always" 
                                                     ReadOnly="True" UniqueName="iNumber" Visible="False">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn ButtonType="PushButton" CancelText="Cancel" InsertText="Save" 
                                        UniqueName="EditCommandColumn1" UpdateText="Save" Visible="false">
                            </EditColumn>
                            <FormMainTableStyle Font-Names="tahoma" Font-Size="9pt" />
                            <FormTableStyle Font-Names="tahoma" Font-Size="9pt" />
                            <FormTableStyle Font-Names="tahoma" Font-Size="9pt" />
                            <FormMainTableStyle Font-Names="tahoma" Font-Size="9pt" />
                        </EditFormSettings>
                        <EditItemStyle Font-Names="Tahoma" />
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                    <FilterMenu OnClientShowing="MenuShowing">
                        <WebServiceSettings>
                            <ODataSettings InitialContainerName="">
                            </ODataSettings>
                        </WebServiceSettings>
                    </FilterMenu>
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        <WebServiceSettings>
                            <ODataSettings InitialContainerName="">
                            </ODataSettings>
                        </WebServiceSettings>
                    </HeaderContextMenu>
                </telerik:RadGrid>
             
                 
            </td>
        </tr>
    </table>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
      <script>
          function GetRadWindow() {
              var oWindow = null;
              if (window.radWindow) oWindow = window.radWindow;
              else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
              return oWindow;
          }
          function setsize(sender, eventArgs) {
              
              GetRadWindow().set_autoSize(true);
          }
//            function ApplyGreaterThanFilter() {
//                var masterTable = $find("<%= dgdBase.ClientID %>").get_masterTableView();
//                var val = document.getElementById('txtSearch');
//                masterTable.filter("strName", val.value, Telerik.Web.UI.GridFilterFunction.Contains);
//                document.getElementById('txtSearch').value = val;
//                $('#img').click(ApplyGreaterThanFilter);
//            }
  
//            $('#img').click(ApplyGreaterThanFilter);
             
             
        </script>
          
<style type="text/css">  
    HTML  
    {  
        overflow-x: hidden;  
    }  
</style>
  
    </telerik:RadCodeBlock>
  
</asp:Content>


 
Salman
Top achievements
Rank 1
 asked on 13 Oct 2012
0 answers
92 views
Hi.

I like to apply from my code behind a style attribute that can change with every postback,
sadly the TableItemStyle class doesnt have a property of Type CssStyleCollection.
(I would like to recommend this property with the next versions)

Since this property is missing and "max-width" isnt a property aswell, i tried to make my one TemplateColumn override the HeaderStyle Property with a CustomTableItemStyle class and finally there override the AddAttributesToRender Methode... but this fails and nothing gets renderd.

Hope you can help me solve this problem.
Random
Top achievements
Rank 1
 asked on 13 Oct 2012
2 answers
57 views
Hi Team,
I'm new to Telerik controls and have few questions about RadGrid.
  1. RadGrid and MasterTableView have duplicate properties like AllowFilteringByColumn, AllowSorting, AllowPaging, etc. So what is purpose of this duplicacy and what should be set in order to get required functionality.
  2. MasterTableView have property AllowCustomSorting. What is its use as i havent found any documentation (may be i missed it)?
  3. If i set EnableHeaderContextMenu="true" and EnableHeaderContextFilterMenu="true", then how to disable it for a particular Column.
  4. I have set function on OnRowDataBound of RadGrid using ClientEvents but when i Sort/Filter using ContextMenu, function doesn't get fired. Actually i want to know how to sort/filter at client-side using ContextMenu.
  5. On HeaderContextMenu how to remove Grouping options, using property at Grid level instead of column level.
Abhijit Shetty
Top achievements
Rank 2
 answered on 13 Oct 2012
0 answers
109 views
I am currently working a web application using Telerik  Web UI

When I try to build up the solution , the following exception occurs
http://dl.dropbox.com/u/15324785/asas.JPG

I have known hat designer.cs under master page is automatically built it simply not functions well . 

When i try to run the project , RadHttpUpload Module cannot upload.
But when comparing with the web.comnfig for prototype which is the same, can run smoothly
http://dl.dropbox.com/u/15324785/untitled.JPG


Woould you please tell me how to resolve it /
Larry
Top achievements
Rank 1
 asked on 13 Oct 2012
4 answers
237 views
If I want a menu to open only when someone clicks on the menu, how do I access what is clicked on inside the menu?  When I try to use both of the properties OnItemClick is fired which causes a postback and ClickToOpen does not work properly.

Thank you.
Toan
Top achievements
Rank 1
 answered on 12 Oct 2012
1 answer
142 views

This is going to be a bit of odd one but here s what I am trying to do.  I have a aps.net page and on this page is  a radgrid.  The radgrid uses a Template for the Edit Form.  In this template I have a radtab strip.  On one tab is all the detail information for the record and the user can edit and save changes.  On the other table is a fileExplorer.  Now depending on which record is being entered the file paths need to be different, but for some reason when I am setting the ViewPath and UploadPaths in code it does not work, but if I set a static page in the html write up it work fine.

I am trying to set the folder on the Radgrid databound event.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridEditableItem && e.Item.IsInEditMode)
           {
               RadFileExplorer marketingFiles = (RadFileExplorer)formItem.FindControl("FileExplorer1");
 
               string clientID = Session["AdvisorClientID"].ToString();
               string id = ((RadTextBox)editItem.FindControl("MarketingCode")).Text;
 
               if (!Directory.Exists(Server.MapPath("~/FileManager/") + clientID + "\\marketing\\" + id + "\\"))
                         Directory.CreateDirectory(Server.MapPath("~/FileManager/") + clientID + "\\marketing\\" + id + "\\");
               string[] folder = new string[] { Server.MapPath("~/FileManager/") + clientID + "\\marketing\\" + id + "\\"};
 
               marketingFiles.Configuration.ViewPaths = folder;
               marketingFiles.Configuration.UploadPaths = folder;
           }

It will create the folder if it does not exist.
 and this is the pageview html
<telerik:RadPageView ID="RadPageView2" runat="server" BorderStyle="Inset" BorderWidth="1px" BorderColor="LightBlue">                                        
   <telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="600px" Height="250px" AllowPaging="true" PageSize="20" Skin="WebBlue">
         <Configuration EnableAsyncUpload="true" /></telerik:RadFileExplorer></telerik:RadPageView>

the screen is also ajaxed, so I am not sure if that is the issue.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
       EnablePageHeadUpdate="False" OnAjaxRequestquest="RadAjaxManager1_AjaxRequest"
       OnAjaxRequest="RadAjaxManager1_AjaxRequest">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="FilterButton">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="RemoveFilterButton">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                   <telerik:AjaxUpdatedControl ControlID="TypeListBox" />
                   <telerik:AjaxUpdatedControl ControlID="StatusListBox" />
                   <telerik:AjaxUpdatedControl ControlID="DescriptionTxt" />
                   <telerik:AjaxUpdatedControl ControlID="StartDate" />
                   <telerik:AjaxUpdatedControl ControlID="EndDate" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="RadGrid1">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>

thanks,
Eric
Eric Klein
Top achievements
Rank 1
 answered on 12 Oct 2012
6 answers
180 views

So, I am unable to assign a MultiLine Message as my Confirmation Text for a Delete ImageButton.

The below code, when not REM'd out, does not throw an error but when I hit Delete, the confirmation does not appear at all and it merely Deletes the record.  If I use a single Line of text, it appears and prompts for confirmation.

Not a deal breaker for me but I thought I would mention it.

Private Sub RecipientsGrid_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RecipientsGrid.ItemCreated
If TypeOf e.Item Is GridDataItem Then
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim DeleteBtn As GridButtonColumn = TryCast(RecipientsGrid.MasterTableView.GetColumn("DeleteOrganization"), GridButtonColumn)
Dim DeleteMsg As New StringBuilder
'DeleteMsg.Append("Delete this Organization?")
'DeleteMsg.Append(ControlChars.NewLine)
'DeleteMsg.Append("Note: This will DELETE all Contacts for this Organization!")
'DeleteBtn.ConfirmText = DeleteMsg.toString
DeleteBtn.ConfirmText = "DELETE ME!"
End If
End Sub
Tim
Top achievements
Rank 1
 answered on 12 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?