Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
275 views
Hi,
I can't make a RadUpload work inside a RadGrid. I tried in at least two different ways:

In the first try I just added my RadUpload with a MaxCountofInputFiles = 1. Then, in the behind code, I just tried to find the radUpload control

RadUpload upload = (RadUpload)e.Item.FindControl("UploadControl");

and tried to use the upload.UploadedFiles collection. However, the UploadedFiles collection is ALWAYS empty using this approach.

The other approach is the one used in the image example, but it didn't work. The UploadedFiles collection is still empty anyway. Below are the grid and the code behind.

<script type="text/javascript">   
            //<![CDATA[
       
            function conditionalPostback(e, sender) {
               
                var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                if (sender.get_eventTarget().match(theRegexp)) {
                    var upload = $find(window['UploadControl']);
                    //AJAX is disabled only if file is selected for upload
                    if (upload.getFileInputs()[0].value != "") {
                        sender.set_enableAjax(false);
                    }
                }
            }
            function validateRadUpload(source, e) {
                alert("true");
                e.IsValid = false;
                alert("Entro al metodo culero");
                var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);
                var inputs = upload.getFileInputs();
                for (var i = 0; i < inputs.length; i++) {
                    //check for empty string or invalid extension
                    if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {
                        alert(inputs[i].value);
                        e.IsValid = true;
                        break;
                    }
                }
            }
            //]]> 
     </script>  
      
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">   
            <AjaxSettings>  
                <telerik:AjaxSetting AjaxControlID="DefaultMasterScriptManager">   
                    <UpdatedControls>  
                        <telerik:AjaxUpdatedControl ControlID="dgFileUploader" />  
                    </UpdatedControls>  
                </telerik:AjaxSetting>  
            </AjaxSettings>  
        </telerik:RadAjaxManager>  
         
           <h2>File Uploader</h2><br /> 
                <telerik:RadAjaxPanel ID="FileUploaderPanel" runat="server" ClientEvents-OnRequestStart="conditionalPostback"
                <telerik:RadInputManager ID="RadInputManager2" runat="server"
                    <telerik:RegExpTextBoxSetting BehaviorID="RegExpItemName" InitializeOnClient="false" 
                        ErrorMessage="Invalid format" InvalidCssClass="invalid" 
                        ValidationExpression="([A-Za-z]([A-Za-z0-9])*)"
                    <Validation IsRequired="true" />  
                    </telerik:RegExpTextBoxSetting>                      
                </telerik:RadInputManager> 
                <telerik:RadGrid ID="dgFileUploader" DataSourceID="FileUploaderDataSource" runat="server"  
                    AutoGenerateColumns="False" GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="False"  
                    Skin="Outlook"  
                    onitemcommand="dgFileUploader_ItemCommand"  
                    onitemcreated="dgFileUploader_ItemCreated"                      
                    OnItemDataBound="dgFileUploader_ItemDataBound"                      
                    > 
                <HeaderContextMenu EnableTheming="True"
                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                </HeaderContextMenu> 
 
                <MasterTableView CommandItemDisplay="Top" DataKeyNames ="Id" DataSourceID="FileUploaderDataSource"
                    <CommandItemTemplate>   
                      <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !dgFileUploader.MasterTableView.IsItemInserted %>'
                        Add New Record 
                      </asp:LinkButton><br /> 
                    </CommandItemTemplate> 
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
         
                <Columns> 
                    <telerik:GridBoundColumn DataField="ItemName" HeaderText="Item Name" SortExpression="ItemName"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="UploadDate" HeaderText="Upload Date(mm/dd/yyyy)" SortExpression="UploadDate" DataType="System.DateTime"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="OriginalFileName" HeaderText="Original File Name" SortExpression="OriginalFileName"
                    </telerik:GridBoundColumn> 
                     <telerik:GridButtonColumn UniqueName="Delete" ButtonType="LinkButton" CommandName="Delete" Text="Remove"
                    </telerik:GridButtonColumn> 
                </Columns> 
     
                <EditFormSettings EditFormType="Template"
                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
                    <FormTemplate> 
                        <table cellspacing="2" cellpadding="1" width="100%" border="0"
                            <tr> 
                                <td> 
                                    Item Name: 
                                <asp:TextBox Width="200px" ID="ItemNameTextBox" runat="server" EnableViewState="true" Text=""></asp:TextBox> 
                                <%--asp:requiredfieldvalidator id="ReqTextBox1" runat="server" ErrorMessage="Item Name is required field" 
                                    EnableClientScript="False" ControlToValidate="TextBox1" Display="Static"></asp:requiredfieldvalidator--%> 
                                    <br /> 
                                    <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />  
                                    <telerik:RadUpload InputSize="100" CssClass="content" ID="UploadControl" EnableViewState="true" runat="server" AllowedFileExtensions=".doc,.docx" ControlObjectsVisibility="None" OverwriteExistingFiles="True" MaxFileInputsCount="1"
                                    </telerik:RadUpload> 
                                    <telerik:RadProgressArea ID="ProgressArea" runat="server" />  
                                 </td> 
                            </tr>                    
                            <tr> 
                                <td> 
                                    <asp:LinkButton ID="Button3" runat="server" Text='<%# (Container is GridEditFormItem) ? "Save" : "Update" %>' 
                                        CommandName='<%# (Container is GridEditFormItem) ? "PerformInsert" : "Update" %>'></asp:LinkButton> 
                                    <asp:LinkButton ID="Button4" runat="server" Text="Cancel" CausesValidation="false" 
                                        CommandName="Cancel"></asp:LinkButton> 
                                </td> 
                            </tr> 
                        </table> 
                    </FormTemplate> 
                </EditFormSettings> 
            </MasterTableView> 
             
            <FilterMenu EnableTheming="True"
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </FilterMenu> 
        </telerik:RadGrid> 
        <pp:ObjectContainerDataSource ID="FileUploaderDataSource" runat="server"  
            DataObjectTypeName = "FacultyPortalService.BusinessEntities.FileUploader" runat="server"  
            OnDeleted="FileUploader_Deleted"  
            /> 
        </telerik:RadAjaxPanel> 

As you can see, I'm taking the Script manager from a Master page. That script manager is an asp:scriptmanager.

Below are the Page_load, the Item Data Bound and the itemcommand and created.

 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!this.IsPostBack) 
            { 
                this._presenter.OnViewInitialized(); 
            } 
 
            profileVitaeTab.Visible = !_presenter.ProfileApprovalInReview(); 
 
            this._presenter.OnViewLoaded(); 
 
            if (!IsPostBack) 
            { 
                this.dgFileUploader.DataBind(); 
                this.DataBind(); 
            } 
 
        } 
 
        protected void dgFileUploader_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
           
         if (e.Item is GridEditableItem && e.Item.IsInEditMode ) 
         { 
             RadUpload upload = (RadUpload)e.Item.FindControl("UploadControl"); 
            FreelanceItemPanel.ResponseScripts.Add(String.Format("window['UploadControl'] = '{0}';", upload.ClientID));  
 
         } 
        } 
         
               protected void dgFileUploader_ItemCommand(object source, GridCommandEventArgs e) 
        { 
            if (e.CommandName == RadGrid.InitInsertCommandName) //"Add new" button clicked 
            { 
                e.Canceled = true
                e.Item.OwnerTableView.InsertItem(); 
                GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem(); 
            } 
 
            if (e.Item.ItemType == GridItemType.EditFormItem)  
            { 
                if (e.CommandName == RadGrid.PerformInsertCommandName) 
                { 
                    //e.Canceled = false; 
                    //BindInvalidFiles(); 
                    var itemNameTextBox = (TextBox)e.Item.FindControl("ItemNameTextBox"); 
                    var radUploadControl = (RadUpload)e.Item.FindControl("UploadControl"); 
 
                    if (itemNameTextBox == null || radUploadControl == null
                    { 
                        return
                    } 
                     
                    ParseFile(radUploadControl.UploadedFiles, itemNameTextBox.Text, 1); 
                } 
            } 
        } 
 
        protected void dgFileUploader_ItemCreated(object sender, GridItemEventArgs e) 
        { 
            if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                GridEditFormItem editedItem = e.Item as GridEditFormItem; 
 
                TextBox txt1 = editedItem.FindControl("ItemNameTextBox"as TextBox; 
                RegExpTextBoxSetting regExpSetting = (RegExpTextBoxSetting)RadInputManager2.GetSettingByBehaviorID("RegExpItemName"); 
                regExpSetting.TargetControls.Add(new TargetInput(txt1.UniqueID, true)); 
            } 
 
            if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                GridEditableItem editItem = (GridEditableItem)e.Item; 
                RadUpload upload = (RadUpload)e.Item.FindControl("UploadControl"); 
                CustomValidator validator = new CustomValidator(); 
                validator.ErrorMessage = "Please select file to be uploaded"
                validator.ClientValidationFunction = "validateRadUpload"
                validator.Display = ValidatorDisplay.Dynamic; 
 
                ((WebControl)upload.Parent).Controls.Add(validator); 
 
            } 
        } 

Warmest Regards

Genady Sergeev
Telerik team
 answered on 24 Sep 2010
1 answer
126 views
Dear Telerik-Team,

THere is an issue with the RestrictedZone in combination with the RadWIndow. This issue you can also see in your online demo:
http://demos.telerik.com/aspnet-ajax/window/examples/radwindowandmdi/defaultcs.aspx

FIrst half size the Browser window.

If you place a RadWindow in the left upper corner and then resize the browser window by maximize then the RadWInow is out ot the restricted zone!

Kind regards
Christian
Georgi Tunev
Telerik team
 answered on 24 Sep 2010
1 answer
119 views
Error Message: Script controls may not be registered after PreRender.

When I include 
<telerik:RadFormDecorator ID="rfd" runat="server" DecoratedControls="All" 
        EnableRoundedCorners="False"  />
I get this error when I remove it everything works fine.

I have other pages that work just fine and they are setup the same.  When I remove all columns of the grid everything works fine.  I have removed the code behind and left the columns and the error still persists.  When I remove the datasource everything works fine but then there are no columns which caused me to remove all the columns and see if this is the issue.

Not sure what is going on when the form decorator is on this page.

EDIT: This only happened when I upgraded to the latest version of RadConrols the previous version worked fine.

Any suggestions?

Here is my Page
<%@ Page Language="C#"  AutoEventWireup="true" CodeBehind="EditContacts.aspx.cs" Inherits="AFPI.Inventory.Web.EditContacts" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head1" runat="server">
    <title>Inventory Admin</title>
    <telerik:RadStyleSheetManager id="rssm" runat="server" OutputCompression="Forced" />
    <script type="text/javascript" language="javascript">
        function RowDeleted(sender, eventArgs) {
            PageMethods.MarkRecordDeleted(eventArgs.getDataKeyValue("ContactRecId"));
        }
    </script>
</head>
<form id="form1" runat="server">
    <telerik:RadScriptManager ID="rsm" runat="server" EnablePageMethods="true"
        EnableHistory="True"
        EnableScriptLocalization="False" OutputCompression="Forced"
        ScriptMode="Release">
        <Scripts>
            <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 Path="~/Resources/JS/jquery.cookie.js" />
            <asp:ScriptReference Path="~/Resources/JS/Globals.js" />
        </Scripts>
        <Services>
            <asp:ServiceReference Path="~/WebService/Ledger.asmx" />
        </Services>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        window.$ = $telerik.$;
    </script>
    <telerik:RadFormDecorator ID="rfd" runat="server" DecoratedControls="All"
        EnableRoundedCorners="False"  />
    <telerik:RadSkinManager ID="rsknm" runat="server" Skin="WebBlue" />
    <telerik:RadAjaxManager ID="ram" runat="server" />
     
     
    <div>
        <div style="background-color:#577486; width:100%; border:solid 1px #577486; margin-bottom:2px;">
        <asp:Image ID="imgHeader" style="float:left;" runat="server" ImageUrl="~/Resources/Images/HeaderLogo.png" />
        <div style="float:Right; width:300px;font-size:30px;color:White; font-weight:bold; text-transform:capitalize; vertical-align:middle; line-height:55px; margin-right:50px;">Inventory Management</div>
        <div style="clear:both;"></div>
        </div>
         
        <telerik:RadMenu style="z-index:600" Width="100%" ID="RadMenu1" runat="server" DataNavigateUrlField="Url"
            DataSourceID="SiteMapDataSource1" DataTextField="Title" >
             
            </telerik:RadMenu>
        <div style="clear:both;"></div>
        <h4>
            <asp:SiteMapPath ID="SiteMapPath1" runat="server" Font-Names="Verdana"  ParentLevelsDisplayed="0"
                Font-Size="0.8em" PathSeparator=" : ">
                <PathSeparatorStyle Font-Bold="True" ForeColor="#5D7B9D" />
                <CurrentNodeStyle ForeColor="#333333" />
                <NodeStyle Font-Bold="True" ForeColor="#7C6F57" />
                <RootNodeStyle Font-Bold="True" ForeColor="#5D7B9D" />
                 
            </asp:SiteMapPath>
        </h4>
     
    <label>Type of contact</label>
       <telerik:RadComboBox ID="ddlContactTypes" AutoPostBack="true" runat="server"
        EmptyMessage="Select Contact Type" DataSourceID="LLBLGenProDataSource2"
        ondatabound="ddlContactTypes_DataBound" DataTextField="ContactType"
        DataValueField="ContactTypeRecId">
    </telerik:RadComboBox>
    <br />
    <br />
    <div id="TagInstructions" style="width:90%;font-family:Trebuchet MS, Arial, MS Sans Serif; font-size:smaller;color:#666666;">
        Email Body Tags:<br />
        {0} = Quantity Needed, {1} = Product ID, {2} = Available Inventory, {3} = Reserved Amount, {4} = Reorder Point, {5} = Total Inventory<br />
        {6} = Product Name, {7} = Ordered by First Name, {8} = Ordered By Last Name, {9} = Order date, {10} = Order ID, {11} = Quantity Multipler</div>
    <br />
 
    <telerik:RadGrid ID="RadGrid1" runat="server" OnItemCreated="RadGrid1_ItemCreated"
        AllowPaging="True" AllowSorting="True" DataSourceID="LLBLGenProDataSource1"
        GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
        AllowAutomaticUpdates="True" AutoGenerateDeleteColumn="False"
        MasterTableView-CommandItemDisplay="Top" >
        <ClientSettings>
        <ClientEvents OnRowDeleted="RowDeleted"></ClientEvents>
        </ClientSettings>
<MasterTableView AutoGenerateColumns="False" DataKeyNames="ContactRecId"  ClientDataKeyNames="ContactRecId"
            DataSourceID="LLBLGenProDataSource1" EditMode="EditForms" EditFormSettings-ColumnNumber="3" CommandItemSettings-AddNewRecordText="Add new contact">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
    <telerik:GridEditCommandColumn ItemStyle-Width="20px" ButtonType="LinkButton"></telerik:GridEditCommandColumn>
        <telerik:GridBoundColumn DataField="ContactRecId" DataType="System.Int32"
            HeaderText="ContactRecId" ReadOnly="True" Display="false" SortExpression="ContactRecId"
            UniqueName="ContactRecId">
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn EditFormColumnIndex="0" EditFormHeaderTextFormat="" Display="false">
            <EditItemTemplate>
                <b>Contact Details</b>
            </EditItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="Name" HeaderText="Name"  ColumnEditorID="txteditor"
            SortExpression="Name" UniqueName="Name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Address1" HeaderText="Address 1"  ColumnEditorID="txteditor"
            SortExpression="Address1" UniqueName="Address1">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Address2" HeaderText="Address 2"  ColumnEditorID="txteditor"
            SortExpression="Address2" UniqueName="Address2">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Address3" HeaderText="Address 3"  ColumnEditorID="txteditor"
            SortExpression="Address3" UniqueName="Address3">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="City" HeaderText="City"  ColumnEditorID="txteditor"
            SortExpression="City" UniqueName="City">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="State" HeaderText="State"  ColumnEditorID="txteditor"
            SortExpression="State" UniqueName="State">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="PostalCode" HeaderText="Postal Code"  ColumnEditorID="txteditor"
            SortExpression="PostalCode" UniqueName="PostalCode">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Country" HeaderText="Country"  ColumnEditorID="txteditor"
            SortExpression="Country" UniqueName="Country">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone"  ColumnEditorID="txteditor"
            SortExpression="Phone" UniqueName="Phone">
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn EditFormHeaderTextFormat="" Display="false">
            <EditItemTemplate>
                <br /><a href="EditProductEmailTargets2.aspx?c=<%# Eval("ContactRecId") %>">Assign Specific EMail Targets</a>
            </EditItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn EditFormColumnIndex="1" EditFormHeaderTextFormat="" Display="false">
            <EditItemTemplate>
                <b>Below Reorder Point Email</b>
            </EditItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="ReorderTo" HeaderText="To"
            SortExpression="ReorderTo" UniqueName="ReorderTo" EditFormColumnIndex="1" ColumnEditorID="txteditor" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReorderCc" HeaderText="CC"
            SortExpression="ReorderCc" UniqueName="ReorderCc" EditFormColumnIndex="1" ColumnEditorID="txteditor" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReorderBcc" HeaderText="BCC"
            SortExpression="ReorderBcc" UniqueName="ReorderBcc" EditFormColumnIndex="1" ColumnEditorID="txteditor" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReorderFrom" HeaderText="From"
            SortExpression="ReorderFrom" UniqueName="ReorderFrom" EditFormColumnIndex="1" ColumnEditorID="txteditor" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ReorderSubject" HeaderText="Subject"
            SortExpression="ReorderSubject" UniqueName="ReorderSubject" EditFormColumnIndex="1" ColumnEditorID="txteditor" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridHTMLEditorColumn HeaderText="Body" DataField="ReorderBody" SortExpression="ReorderBody" UniqueName="ReorderBody" EditFormColumnIndex="1" Display="false"></telerik:GridHTMLEditorColumn>
        <telerik:GridTemplateColumn Visible="false" ReadOnly="true" HeaderText="Reorder Body" SortExpression="ReorderBody" UniqueName="ReorderBody" EditFormColumnIndex="1" Display="false">
            <EditItemTemplate>
            <asp:TextBox ID="txtReorderBody" runat="server" Width="300px" TextMode="MultiLine" Height="150px" Text='<%# Bind("ReorderBody")%>'></asp:TextBox>
            </EditItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn EditFormColumnIndex="2" EditFormHeaderTextFormat="" Display="false">
            <EditItemTemplate>
                <b>Below Zero Inventory Email</b>
            </EditItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="ZeroInventoryTo" HeaderText="To" ColumnEditorID="txteditor"
            SortExpression="ZeroInventoryTo" UniqueName="ZeroInventoryTo" EditFormColumnIndex="2" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ZeroInventoryCc" HeaderText="CC"  ColumnEditorID="txteditor"
            SortExpression="ZeroInventoryCc" UniqueName="ZeroInventoryCc" EditFormColumnIndex="2" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ZeroInventoryBcc" HeaderText="BCC"  ColumnEditorID="txteditor"
            SortExpression="ZeroInventoryBcc" UniqueName="ZeroInventoryBcc" EditFormColumnIndex="2" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ZeroInventoryFrom" HeaderText="From"  ColumnEditorID="txteditor"
            SortExpression="ZeroInventoryFrom" UniqueName="ZeroInventoryFrom" EditFormColumnIndex="2" Display="false">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ZeroInventorySubject" HeaderText="Subject"  ColumnEditorID="txteditor"
            SortExpression="ZeroInventorySubject" UniqueName="ZeroInventorySubject" EditFormColumnIndex="2" Display="false">
        </telerik:GridBoundColumn>
         
        <telerik:GridHTMLEditorColumn HeaderText="Body" DataField="ZeroInventoryBody" ColumnEditorID="htmleditor1"  SortExpression="ZeroInventoryBody" UniqueName="ZeroInventoryBody" EditFormColumnIndex="2" Display="false"></telerik:GridHTMLEditorColumn>
         
        <telerik:GridClientDeleteColumn ItemStyle-Width="20px" ConfirmText="Are you sure you want to delete this contact?" HeaderStyle-Width="35px" ButtonType="ImageButton" />
    </Columns>
 
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
</EditFormSettings>
</MasterTableView>
    </telerik:RadGrid>
         
    <telerik:GridTextBoxColumnEditor ID="txteditor" runat="server" TextBoxStyle-Width="300px"></telerik:GridTextBoxColumnEditor>
     
     
    <llblgenpro:LLBLGenProDataSource ID="LLBLGenProDataSource1" runat="server"
        DataContainerType="EntityCollection"
         
        EntityCollectionTypeName="AFPI.Inventory.DAL.CollectionClasses.ContactCollection, AFPI.Inventory.DAL">
        <InsertParameters>
            <asp:ControlParameter ControlID="ddlContactTypes" Name="ContactTypeRecId"
                PropertyName="SelectedValue" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlContactTypes" DefaultValue=""
                Name="ContactTypeRecId" PropertyName="SelectedValue" />
            <asp:Parameter DefaultValue="" Name="DeletedDate" ConvertEmptyStringToNull="true" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="ddlContactTypes" Name="ContactTypeRecId"
                PropertyName="SelectedValue" />
        </UpdateParameters>
    </llblgenpro:LLBLGenProDataSource>
     
     
    <llblgenpro:LLBLGenProDataSource ID="LLBLGenProDataSource2" runat="server"
        DataContainerType="EntityCollection"
        EntityCollectionTypeName="AFPI.Inventory.DAL.CollectionClasses.ContactTypeCollection, AFPI.Inventory.DAL">
         
    </llblgenpro:LLBLGenProDataSource>
     
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" SiteMapProvider="secureProvider" ShowStartingNode="false" />
    </div>
    </form>
</body>
</html>

Here is my Code behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Web.Services;
using AFPI.Inventory.DAL.EntityClasses;
using System.Web.Security;
using AFPI.Inventory.BAL;
namespace AFPI.Inventory.Web
{
    public partial class EditContacts : System.Web.UI.Page
    {
        protected void ddlContactTypes_DataBound(object sender, EventArgs e)
        {
            ddlContactTypes.Items.Remove(1);
            if (Request.QueryString["ct"] != null)
            {
 
                if (ddlContactTypes.Items.FindItemByValue(Request.QueryString["ct"].ToString()) != null)
                {
                    ddlContactTypes.Items.FindItemByValue(Request.QueryString["ct"].ToString()).Selected = true;
                }
            }
        }
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = (GridEditableItem)e.Item;
                RadEditor ReorderBody = (RadEditor)item["ReorderBody"].Controls[0];
                ReorderBody.Height = Unit.Pixel(200);
                ReorderBody.Width = Unit.Pixel(300);
                ReorderBody.AutoResizeHeight = false;
 
 
                RadEditor ZeroInventoryBody = (RadEditor)item["ZeroInventoryBody"].Controls[0];
                ZeroInventoryBody.Height = Unit.Pixel(200);
                ZeroInventoryBody.Width = Unit.Pixel(300);
                ZeroInventoryBody.AutoResizeHeight = false;
            }
        
 
 
        [WebMethod]
        public static void MarkRecordDeleted(int RecId)
        {
            Guid? userGuid = UserUtil.getCurrentUserGuid(Membership.GetUser());
 
            ContactEntity ent = new ContactEntity(RecId);
            ent.DeletedBy = userGuid;
            ent.DeletedDate = DateTime.Now;
            ent.Save();
        }
    }
}
Georgi Tunev
Telerik team
 answered on 24 Sep 2010
1 answer
210 views
I have a RadEditor that is used as part of a FormTemplate inside of a RadGrid. This is all inside of a telerik:RadAjaxPanel. For some reason, the Content property is always an empty string when I try to save to a database.

Here is my RadGrid:
<telerik:RadGrid  runat="server" ID="NewsAndViewsGrid" AutoGenerateColumns="False"
    AllowPaging="True" DataSourceID="NewsAndViewsDataSource" OnUpdateCommand="Items_UpdateCommand"
    OnInsertCommand="Items_InsertCommand" OnDeleteCommand="Items_DeleteCommand" 
        AllowSorting="True" GridLines="None" Skin="Windows7">
        <ClientSettings>
            <ClientEvents OnPopUpShowing="PopUpShowing" />
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
    <MasterTableView DataKeyNames="ID" DataSourceID="NewsAndViewsDataSource" CommandItemDisplay="TopAndBottom" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="PopUp">
        <Columns>
            <telerik:GridEditCommandColumn><ItemStyle Width="60px" /></telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" ConfirmText="Are you sure you want to delete this record?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Delete" UniqueName="column">
                <ItemStyle Width="60px" />
            </telerik:GridButtonColumn>
            <telerik:GridDateTimeColumn DataFormatString="{0:MM/dd/yyyy}" DataField="Date" HeaderText="Date" SortExpression="Date" UniqueName="Date"></telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="Title" HeaderText="Title" SortExpression="Title" UniqueName="Title"></telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataFormatString="{0:MM/dd/yyyy}" DataField="PublicationDate" HeaderText="Publication Date" SortExpression="PublicationDate" UniqueName="PublicationDate"></telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn DataFormatString="{0:MM/dd/yyyy}" DataField="ExpirationDate" HeaderText="Expires On" SortExpression="ExpirationDate" UniqueName="ExpirationDate"></telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="Summary" HeaderText="Summary" SortExpression="Summary" UniqueName="Summary"></telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings EditFormType="Template" PopUpSettings-Width="775">
            <FormTemplate>
                <table cellspacing="2" cellpadding="1" width="100%">
                    <tr>
                        <td valign="top">
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td valign="top"><strong>Date: </strong><asp:RequiredFieldValidator ControlToValidate="Date" ID="RequiredFieldValidator1" runat="server" Font-Bold="true" ForeColor="Red" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator></td>
                                    <td valign="top">
                                    <telerik:RadDatePicker DbSelectedDate='<%# Bind("Date") %>' Skin="Windows7" ID="Date" runat="server" MinDate="1900-01-01">
                                    </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top"><strong>Title: </strong><asp:RequiredFieldValidator ControlToValidate="Title" ID="RequiredFieldValidator2" runat="server" Font-Bold="true" ForeColor="Red" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator></td>
                                    <td valign="top">
                                        <asp:TextBox ID="Title" MaxLength="100" runat="server" Text='<%# Bind( "Title" ) %>'></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top"><strong>Summary: </strong><asp:RequiredFieldValidator ControlToValidate="Summary" ID="RequiredFieldValidator5" runat="server" Font-Bold="true" ForeColor="Red" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator></td>
                                    <td valign="top">
                                        <asp:TextBox ID="Summary" TextMode="MultiLine" Rows="4" Columns="30" MaxLength="255" runat="server" Text='<%# Bind( "Summary" ) %>'></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top"><strong>Publish Date: </strong><asp:RequiredFieldValidator ControlToValidate="PublicationDate" ID="RequiredFieldValidator6" runat="server" Font-Bold="true" ForeColor="Red" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator></td>
                                    <td valign="top">
                                    <telerik:RadDatePicker DbSelectedDate='<%# Bind("PublicationDate") %>' Skin="Windows7" ID="PublicationDate" runat="server" MinDate="1900-01-01">
                                        <Calendar Skin="Windows7" ID="Calendar2" RangeMinDate="1900-01-01" runat="server">
                                        </Calendar>
                                    </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top"><strong>Expires On: </strong><asp:RequiredFieldValidator ControlToValidate="ExpirationDate" ID="RequiredFieldValidator4" runat="server" Font-Bold="true" ForeColor="Red" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator></td>
                                    <td valign="top">
                                    <telerik:RadDatePicker DbSelectedDate='<%# Bind("ExpirationDate") %>' Skin="Windows7" ID="ExpirationDate" runat="server" MinDate="1900-01-01">
                                        <Calendar Skin="Windows7" ID="Calendar3" RangeMinDate="1900-01-01" runat="server">
                                        </Calendar>
                                    </telerik:RadDatePicker>
                                    </td>
                                </tr>
                            </table>
                        </td>

                        <td valign="top">
                            <strong>Body: </strong><br />
                            <telerik:RadEditor Width="350" Height="300" ToolsFile="~/Scripts/ToolsFile.xml" ContentAreaCssFile="~/Styles/EditorContentAreaStyles.css" Skin="Windows7" ID="Body" runat="server" Content='<%# Bind( "Body" ) %>'></telerik:RadEditor>
                        </td>
                    </tr>

                    <tr>
                        <td align="right" colspan="2" valign="top">
                            <br />
                            <asp:Button UseSubmitBehavior="false"  ID="btnUpdate" Text="Save" runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button>&nbsp;
                            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
                        </td>
                    </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
    <PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>

And here are my insert and update methods:

protected void Items_UpdateCommand(object source, GridCommandEventArgs e)
        {
            var editableItem = ((GridEditableItem)e.Item);
            var id = (int)editableItem.GetDataKeyValue("ID");
            NewsAndView n = NewsAndViewsRepository.GetByID(id);

            if (n != null)
            {
                n.Title = ((TextBox)e.Item.FindControl("Title")).Text;
                n.Summary = ((TextBox)e.Item.FindControl("Summary")).Text;
                n.PublicationDate = ((RadDatePicker)e.Item.FindControl("PublicationDate")).SelectedDate.Value;
                n.ExpirationDate = ((RadDatePicker)e.Item.FindControl("ExpirationDate")).SelectedDate.Value;
                n.Date = ((RadDatePicker)e.Item.FindControl("Date")).SelectedDate.Value;
                n.Body = ((RadEditor)e.Item.FindControl("Body")).Content;

                NewsAndViewsRepository.Update(n);
            }
        }

        protected void Items_InsertCommand(object source, GridCommandEventArgs e)
        {
            NewsAndView n = new NewsAndView();

            n.Title = ((TextBox)e.Item.FindControl("Title")).Text;
            n.Summary = ((TextBox)e.Item.FindControl("Summary")).Text;
            n.PublicationDate = ((RadDatePicker)e.Item.FindControl("PublicationDate")).SelectedDate.Value;
            n.ExpirationDate = ((RadDatePicker)e.Item.FindControl("ExpirationDate")).SelectedDate.Value;
            n.Date = ((RadDatePicker)e.Item.FindControl("Date")).SelectedDate.Value;
            n.Body = ((RadEditor)e.Item.FindControl("Body")).Content;
            
            NewsAndViewsRepository.Add(n);
        }

I've read the articles about this happening in FireFox and I have set the UseSubmitBehavior property of my update button to false. The problem happens in FF, Safari, Chrome, and IE 7 and 8. I'm using the latest version of the controls and I'm working in VS 2010 on .NET 4.0.
Rumen
Telerik team
 answered on 24 Sep 2010
1 answer
127 views
Hi,

I've got the following code that I am running server-side to export the grid and save it to PDF. I then don't want to show the Dialog box to the user so I can then do more in code to attach the saved PDF to an email.

This is the code I have to save the file:

protected void grdDailyList_GridExporting(object source, Telerik.Web.UI.GridExportingArgs e)
        {
            string path = Server.MapPath("~/DailyList/list.pdf");
            if (File.Exists(path))
                File.Delete(path);
  
            using (FileStream fs = File.Create(path))
            {
                Byte[] info = System.Text.Encoding.Default.GetBytes(e.ExportOutput);
                fs.Write(info, 0, info.Length);
            }
  
  
        }

How do I then prevent the dialog box from getting displayed?

Or can I move the above code to get the grids ExportOutput code without having to go through this method?

Thanks, Mark
Daniel
Telerik team
 answered on 24 Sep 2010
1 answer
136 views
Hello all,

I have a RadGrid (RadGrid1) with a nestedviewtemplate. In the template, I have a RadToolbar (RadToolBar1) and another RadGrid (RadGrid2). I have set up the data sources and the grid works fine and shows the appropriate child items in the second RadGrid.

My problem is referencing the RadToolbar and the two RadGrids clientside using javascript. When a user selects an option from the RadToolbar1, I need to get row number of RadGrid1 and a reference to RadToolbar1 and RadGrid2 which is inside the nestedviewte,plate.

I have look at many many forum articles and demos and cannot seem to get the correct clientside code. I have included my code below.

Any help would be greatly appreciated.

Thanks
Ryan



<%

@ Page Language="VB" AutoEventWireup="false" CodeFile="gridtest.aspx.vb" Inherits="parkingdashboard" %>

 

<%

@ 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">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml">

 

<

 

head runat="server">

 

 

<title></title>

 

 

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

 

</

 

head>

 

<

 

body>

 

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

<script type="text/javascript">

 

 

function OnClickToolBar(sender, args) {

 

 

var nGrid = $find("<%= RadGrid1.ClientID %>");

 

 

var nMasterTable = nGrid.get_masterTableView();

 

 

var nNested = nMasterTable.get_dataItems()[0].get_nestedViews();

 

 

alert(nNested[0].get_id());

 

 

if (args.get_item().get_value() == 'showcustomerid') {

 

alert(

"Toolbar Select: CustomerID");

 

}

 

else if (args.get_item().get_value() == 'showorderid') {

 

alert(

"Toolbar Select: OrderID");

 

}

 

else if (args.get_item().get_value() == 'showlinkid') {

 

alert(

"Toolbar Select: LinkID");

 

}

 

else {

 

alert(

"Toolbar Select: UnknownID");

 

}

}

 

</script>

 

 

</telerik:RadCodeBlock>

 

 

<form id="form1" runat="server">

 

 

<table align="left" cellpadding="5" cellspacing="0">

 

 

<tr>

 

 

<td>

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"

 

 

Skin="Windows7" AllowSorting="True">

 

<

 

MasterTableView AutoGenerateColumns="False" DataKeyNames="customerid"

 

 

DataSourceID="SqlDataSource1" Width="98%">

 

 

<NestedViewTemplate>

 

 

<table align="left" cellpadding="5" cellspacing="0">

 

 

<tr>

 

 

<td>

 

 

<asp:Label ID="Label1" runat="server" Visible="false" Text='<%# Eval("customerid") %>'></asp:Label>

 

 

 

<asp:SqlDataSource ID="SqlDataSource2"

 

 

ConnectionString="<%$ ConnectionStrings:usmasondataConnectionString %>" SelectCommand="SELECT * FROM [aaOrder] WHERE ([customer_id] = @customer_id)"

 

 

runat="server">

 

 

<SelectParameters>

 

 

<asp:ControlParameter ControlID="Label1" DefaultValue="0" Name="customer_id"

 

 

PropertyName="Text" Type="Int32" />

 

 

</SelectParameters>

 

 

</asp:SqlDataSource>

 

 

<telerik:RadToolBar ID="RadToolBar1" Runat="server"

 

 

onclientbuttonclicked="OnClickToolBar" Skin="Office2007" Width="100%">

 

 

<Items>

 

 

<telerik:RadToolBarDropDown runat="server" Text="Show">

 

 

<Buttons>

 

 

<telerik:RadToolBarButton runat="server" Text="Show OrderID"

 

 

Value="showorderid">

 

 

</telerik:RadToolBarButton>

 

 

<telerik:RadToolBarButton runat="server" Text="Show CustomerID"

 

 

Value="showcustomerid">

 

 

</telerik:RadToolBarButton>

 

 

<telerik:RadToolBarButton runat="server" Text="Show LinkID" Value="showlinkid">

 

 

</telerik:RadToolBarButton>

 

 

</Buttons>

 

 

</telerik:RadToolBarDropDown>

 

 

</Items>

 

 

</telerik:RadToolBar>

 

 

<telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="True"

 

 

DataSourceID="SqlDataSource2" GridLines="None" Skin="Office2007">

 

 

<MasterTableView AutoGenerateColumns="False" DataKeyNames="id"

 

 

DataSourceID="SqlDataSource2">

 

 

<CommandItemSettings ExportToPdfText="Export to Pdf" />

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="id"

 

 

ReadOnly="True" SortExpression="id" UniqueName="id">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="customer_id" DataType="System.Int32"

 

 

HeaderText="customer_id" SortExpression="customer_id" UniqueName="customer_id">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="location" HeaderText="location"

 

 

SortExpression="location" UniqueName="location">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="purchasedate" DataType="System.DateTime"

 

 

HeaderText="purchasedate" SortExpression="purchasedate"

 

 

UniqueName="purchasedate">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="link_id" DataType="System.Int32"

 

 

HeaderText="link_id" SortExpression="link_id" UniqueName="link_id">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</NestedViewTemplate>

 

<

 

CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>

 

<

 

RowIndicatorColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

RowIndicatorColumn>

 

<

 

ExpandCollapseColumn Visible="True">

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="customerid" DataType="System.Int32"

 

 

HeaderText="CustID" ReadOnly="True" SortExpression="customerid"

 

 

UniqueName="customerid">

 

 

<ItemStyle Width="80px" Wrap="False" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="customername" HeaderText="Name"

 

 

SortExpression="customername" UniqueName="customername">

 

 

<ItemStyle Width="200px" Wrap="False" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="customercity" HeaderText="City"

 

 

SortExpression="customercity" UniqueName="customercity">

 

 

<ItemStyle Width="200px" Wrap="False" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="customerstate" HeaderText="State"

 

 

SortExpression="customerstate" UniqueName="customerstate">

 

 

<ItemStyle Width="80px" Wrap="False" />

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

</

 

MasterTableView>

 

 

<ClientSettings EnableAlternatingItems="False" EnableRowHoverStyle="True">

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<asp:SqlDataSource ID="SqlDataSource1"

 

 

ConnectionString="<%$ ConnectionStrings:usmasondataConnectionString %>" SelectCommand="SELECT * FROM [vaaCustomer]"

 

 

runat="server">

 

 

</asp:SqlDataSource>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">

 

 

</telerik:RadScriptManager>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">

 

 

</telerik:RadAjaxManager>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

&nbsp;</td>

 

 

</tr>

 

 

</table>

 

 

</form>

 

</

 

body>

 

</

 

html>




 

Iana Tsolova
Telerik team
 answered on 24 Sep 2010
0 answers
117 views
Never mind... :)
TPK
Top achievements
Rank 1
 asked on 24 Sep 2010
7 answers
498 views

How do i generate a radtree view dynamically, i am using a masterpage in the page that i am trying to achieve this, also kindly let me know if i have to make any other changes if i am trying to achieve this if i am doing this in a Usercontrol.

protected void Page_Load(object sender, EventArgs e)
    {
      if (!IsPostBack)
        {
            RadTreeView testTree = new RadTreeView();
            testTree.ID = "testTree";
            RadTreeNode node1 = new RadTreeNode();
            node1.Text = "Project";
            node1.Expanded = true;
            Image img1 = new Image();
            img1.ImageUrl = "~/images/top1.gif";
            node1.Controls.Add(img1);
  
            RadTreeNode node2 = new RadTreeNode();
            node2.Text = "Process";
            Label lblprocess = new Label();
            lblprocess.Text = "MisTesting";
            node2.Controls.Add(lblprocess);
  
            this.Controls.Add(testTree);
        }
    }

please let me know if i am going wrong somewhere...
Yana
Telerik team
 answered on 24 Sep 2010
1 answer
105 views
Hi,
i have a problem to reorder the tabs in radtabstrip.
I tried lots of ways to do the reorder tabs, but i couldn't got the solutions.
below is the rabtabstrip tag
<div runat="server" id="menuDiv">
                                    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" EnableAJAX="true">
                                        <telerik:RadTabStrip ID="emrTab" runat="server" OnClientTabSelected="tabSelect" Orientation="HorizontalTop"
                                            SelectedIndex="0" ReorderTabsOnSelect="true" Skin="Vista" Width="1000" ClickSelectedTab="true" EnableSubLevelStyles="true">                                            
                                        </telerik:RadTabStrip>
                                    </telerik:RadAjaxPanel>
                                </div>


in this tabstrip i have added 15 tabs.

Thanks and regards
Saravanan
Yana
Telerik team
 answered on 24 Sep 2010
6 answers
182 views

Hello:

I have a Website that inherits a .master page. The master page contains a RadWindow and a JavaScript method to show the RadWindow:

<telerik:RadWindow ID="Window1" runat="server" Modal="True" VisibleOnPageLoad="false" EnableShadow="true"
     Behaviors="Close" ReloadOnShow="true" AutoSize="false" Height="600" Width="800">
     <ContentTemplate>
         <asp:UpdatePanel ID="Window1UpdatePanel" runat="server" UpdateMode="Always">
         <ContentTemplate>
         </ContentTemplate>
         </asp:UpdatePanel>
     </ContentTemplate>
 </telerik:RadWindow>
function OpenModalWindow() {
    var oWnd = null;
    oWnd = $find("<%=Window1.ClientID%>"); }
    oWnd.Show();
}

One of my user controls does a response.redirect and loads a user control dynamically. The user controls Load event executes the JavaScript code from server side, which is supposed to show the window. It throws an error saying that oWnd is null (granted the JavaScript code and the modal are on the same master page). If I do a document.getElementById it returns an actual result (but tells me that .Show is an invalid method). So the object seems to exist. I know it's a shot in the dark but does anyone have any suggestions? On controls where the page is NOT redirecting it seems to work fine...thanks!
Georgi Tunev
Telerik team
 answered on 24 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?