Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
176 views
I am encountering strange issues in my continuing quest to get GridAttachmentColumn to play nice with AJAX.

I have implemented conditional postback as follows:

Code behind

if (this.Master != null)
{
    var ajaxManager = (RadAjaxManager)this.Master.FindControl("TelerikAjaxManager");
  
    if (ajaxManager != null)
    {
        ajaxManager.ClientEvents.OnRequestStart += "ConditionalPostback";
    }
}

Script in the content page

function ConditionalPostback(sender, eventArgs)
{
    var eventTarget = eventArgs.get_eventTarget();
  
    if (eventTarget == "<%=this.AttachmentsGrid.UniqueID %>")
    {
        var eventArgument = eventArgs.get_eventArgument();
  
        if (eventArgument.indexOf("Update") > -1 || 
            eventArgument.indexOf("PerformInsert") > -1)
        {
            eventArgs.set_enableAjax(false);
        }
    }
}

function GridOnCommand(sender, args)
{
    if (args.get_commandName() == "DownloadAttachment")
    {
        var manager = $find('<%= RadAjaxManager.GetCurrent(Page).ClientID %>');
  
        manager.set_enableAJAX(false);
  
        setTimeout(function () { manager.set_enableAJAX(true); }, 0);
    }
}

Snippet of the RadGrid

<telerik:RadGrid 
    AutoGenerateColumns="False" 
    AutoGenerateEditColumn="True" 
    DataSourceID="AttachmentsDataSource" 
    ID="AttachmentsGrid" 
    runat="server">
    <MasterTableView 
        DataKeyNames="Id" 
        DataSourceID="AttachmentsDataSource">
        <Columns>
            <telerik:GridAttachmentColumn 
                DataSourceID="AttachmentDataSource"
                MaxFileSize="1048576" 
                EditFormHeaderTextFormat="Upload Attachment:"
                HeaderText="Attachment"
                HeaderTooltip="Download Activity Attachment"
                AttachmentDataField="Attachment" 
                AttachmentKeyFields="Id"
                FileNameTextField="FileName" 
                DataTextField="FileName"
                UniqueName="Attachment">
            </telerik:GridAttachmentColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnCommand="GridOnCommand" />
    </ClientSettings>
</telerik:RadGrid>

The grid is contained within a TabStrip with associated pageviews.

I can upload an attachment, delete etc. but when I click a link in the tab strip, i receive two errors:

b.toUpperCase is not a function
  
Function.__typeName="Function";Functio...terClass("Sys.Net.WebServiceError");
  
Teleri...8366029 (line 6)
  
h is not a constructor
  
Function.__typeName="Function";Functio...terClass("Sys.Net.WebServiceError");
  
Teleri...8366029 (line 6)

Message: Object doesn't support this property or method
Line: 6
Char: 18774
Code: 0
URI: http://localhost:63311/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=TelerikScriptManager_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3ae71d0a15-7471-4384-9905-78bdf2047cba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.2.712.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3af9722142-3e1c-4803-86df-ecfc0d24f144%3a16e4e7cd%3aed16cbdc%3a874f8ea2%3af7645509%3a24ee1bba%3af46195d3%3a19620875%3a490a9d4e%3abd8f85e4%3a86526ba7%3ae330518b%3a1e771326%3ac8618e41%3ac172ae1e%3a9cdfc6e7%3ae4f8f289%3a8e6f0d33%3a6a6d718d%3a58366029

Message: Object expected
Line: 6
Char: 54851
Code: 0
URI: http://localhost:63311/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=TelerikScriptManager_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3ae71d0a15-7471-4384-9905-78bdf2047cba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.2.712.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3af9722142-3e1c-4803-86df-ecfc0d24f144%3a16e4e7cd%3aed16cbdc%3a874f8ea2%3af7645509%3a24ee1bba%3af46195d3%3a19620875%3a490a9d4e%3abd8f85e4%3a86526ba7%3ae330518b%3a1e771326%3ac8618e41%3ac172ae1e%3a9cdfc6e7%3ae4f8f289%3a8e6f0d33%3a6a6d718d%3a58366029


I copied from Firebug / IE.

After ok'ing the alerts, the page loads but with all the telerik styling and functionality in the page broken.

Any ideas what is going on?

Richard

Update (14/10/2011): The issue is caused when there is a RadComboBox within the PageView of the TabStrip.If the ConditionalPostback does not fire the first time, I'm fine but if it does, this error happens. This seems strange to me because afterwards, AJAX is back on and ConditionalPostback doesn't actually do anything when navigating through the TabStrip PageViews.

Even if I just put in a simple

<

 

 

telerik:RadComboBox runat="server" ID="test"></telerik:RadComboBox>

 

I get the errors.

I hate JavaScript.
Maria Ilieva
Telerik team
 answered on 06 Feb 2012
3 answers
237 views
Hi,
I am looking at a small issue with one of our grids.  Just looking to find out some additional information about the RadGrid's events.  Should the NeedDataSource event be fired every time we change pages? And if so is there a way to turn it off.  We pass the Grid say 30 rows, we would like our users to be able to page between these rows without having to call NeedDataSource everytime.

Thanks,
Michael
Jayesh Goyani
Top achievements
Rank 2
 answered on 06 Feb 2012
1 answer
82 views
We are new to Telerik and are still in the evaluation stages.  I am putting together a prototype using the ASP. NET Ajax controls from Telerik and can't fiqure out how to present errors on the client.  Our prototype is ajax based.  So once the page is loaded on the client the user loads new data and updates changed data with Ajax calls.  We are using JQuery as our Ajax comunication script engine.  However, I have not been able to figure out how to configure the Telerik controls (such as the RadTextBox or RadDateInput)  to display with the error style and show a server error message returned from the Ajax call.  I am looking for some kind of client-side api that would support this scenario, but am not finding anything in the documentation.

Any help with this scenario is appreciated.

Tsvetina
Telerik team
 answered on 06 Feb 2012
5 answers
245 views
Hi,
 When EnableSingleInputRendering is "true" for a PasswordField (RadTextBox), all submit behaviors of form and buttons are not working.
<form id="form1" runat="server" defaultbutton="LogOn" acceptbutton="LogOn" >
<telerik:RadButton ID="LogOn" runat="server" Text="Login" OnClick="LogOn_Click" UseSubmitBehavior="true">
                                        </telerik:RadButton>

Neither ENTER triggers postback nor can I invoke it programmatically from JS.

Clicking on the button, however, works.

Thanks for help,
 Max
Vasil
Telerik team
 answered on 06 Feb 2012
8 answers
481 views
When the user expands a row, then the grid refreshes. The detail rows are not visible because they are displayed below the screen. The user must scroll down to see the details.

Instead, we want the user to see the details without having to scroll.  How?

Steve
Radoslav
Telerik team
 answered on 06 Feb 2012
1 answer
87 views
Hello 
I am using Radcontrols on Telerik ASP.net Controls version 2009.2.826.35 and our combobox code stopped working with error code
Telerik.Web.UI.WebResource.axd:15Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.

My code of that part can be seen here.  
     <telerik:RadComboBox ID="ddlRoom" runat="server" Style="width: 55px" OnClientSelectedIndexChanged="OnRoomAmountChange">
                        <Items>
                            <telerik:RadComboBoxItem Value="1" Text="1" />
                            <telerik:RadComboBoxItem Value="2" Text="2" />
                            <telerik:RadComboBoxItem Value="3" Text="3" />
                            <telerik:RadComboBoxItem Value="4" Text="4" />
                            <telerik:RadComboBoxItem Value="5" Text="5" />
                        </Items>
     </telerik:RadComboBox>
 
 
function OnRoomAmountChange() {
            var radRoom = $find('<%= ddlRoom.ClientID %>');
            if (radRoom == null) return;
            var numberOfRoom = parseInt(radRoom.get_value());
            if (numberOfRoom == undefined || isNaN(numberOfRoom)) numberOfRoom = 1;
            var count = 1;
            $('.RoomArea').hide();
            $('.RoomArea').each(function() {
                $(this).show();
                if (count == numberOfRoom) return false;
                count++;
            });
        }

working (meant not working ) sample can be found at 

http://detur.se/125/HotelDetailResult.aspx when selecting "Rum" number different than 1. 




Kate
Telerik team
 answered on 06 Feb 2012
7 answers
312 views

Hello,

I'm using RadAjaxLoadingPanel with a Skin="Windows7".  It works fine when I cliked on a button while retrieving data from a database, but after that, I try to click on the button again or even click on the Next-Previous button on the RadGrid, the animation displays static, without spinning circle.  This is odd.  Can you advise?  Am I missing a setting somewhere?
Please see the attached file for my code.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title>ITSM User Information</title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //function export data to Excel
            function onRequestStart(sender, args) {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) {
                    args.set_enableAjax(false);
                }
            }
        </script>
        <br />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" />
        <div style="text-align:center; font-weight:bold; font-size:large">
            User Foundation Data
        </div>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" 
            ClientEvents-OnRequestStart="onRequestStart" 
            LoadingPanelID="RadAjaxLoadingPanel1" EnableHistory="True" 
            HorizontalAlign="NotSet">     
            <div style="text-align:center">
                <table style="width:100%">
                    <tr>
                        <td style="width:32%"></td>
                        <td style="width:10%; text-align:center">
                            <asp:Button ID="btUpdate" runat="server" Text="Collect Data" Font-Bold="true" 
                                onclick="btUpdate_Click" />
                        </td>
                        <td style="width:10%; text-align:center">
                            <asp:Button ID="btAccept" runat="server" Text="Accept" Font-Bold="true"
                                onclick="btAccept_Click" Enabled="False" />
                        </td>
                        <td style="width:10%; text-align:center">
                            <asp:Button ID="btReject" runat="server" Text="Reject" Font-Bold="true" 
                                OnClick="btReject_Click" Enabled="False" />
                        </td>                  
                        <td style="text-align:left; width:15%">
                            <telerik:RadTextBox ID="rtxtRequestTicket" Runat="server" 
                                EmptyMessage="Enter Request Ticket #" Width="125px" MaxLength="9"                                                      
                                ToolTip="Please enter the request ticket number that status already completed" 
                                Display="False" Skin="Windows7">
                            </telerik:RadTextBox>
                        </td>
                        <td style="width:25%"></td>
                    </tr>
                </table
            </div><br />        
            <telerik:RadGrid ID="RadGridUser" runat="server" Skin="Windows7" AutoGenerateColumns="false"
                AllowPaging="True" CellSpacing="0"  
                onneeddatasource="RadGridUser_NeedDataSource" 
                onitemcommand="RadGridUser_ItemCommand" 
                ongridexporting="RadGridUser_GridExporting" 
                onexcelmlexportrowcreated="RadGridUser_ExcelMLExportRowCreated" 
                onexcelmlexportstylescreated="RadGridUser_ExcelMLExportStylesCreated" 
                onexportcellformatting="RadGridUser_ExportCellFormatting">
                <ExportSettings ExportOnlyData="True"  
                    IgnorePaging="True" OpenInNewWindow="True" HideStructureColumns="True" 
                    FileName="">
                    <Excel Format="ExcelML" />
                </ExportSettings>
                <MasterTableView CommandItemDisplay="Top">
                    <CommandItemSettings ExportToPdfText="Export to PDF" 
                        ShowAddNewRecordButton="False" ShowExportToExcelButton="True" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="Action" HeaderText="Action"
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ADName" HeaderText="AD_Name"
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Email" HeaderText="Email" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name"
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Middle" HeaderText="Middle"
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name"
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="VIP" HeaderText="VIP" >
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Location" HeaderText="Location" Visible="false"
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Department" HeaderText="Department" Visible="false"
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" ItemStyle-Width="80px">
                            <ItemStyle Width="80px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Birthday" UniqueName="Birthday" HeaderText="Birthday"
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Last4" UniqueName="Last4" HeaderText="Last4" >
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DebugEmpID" UniqueName="DebugEmpID" HeaderText="DebugEmpID" Visible="false" >
                        </telerik:GridBoundColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                    <ItemStyle HorizontalAlign="Left" />
                    <HeaderStyle HorizontalAlign="Left" />
                    <SortExpressions>
                        <telerik:GridSortExpression FieldName="Action" SortOrder="Descending" />
                    </SortExpressions>
                </MasterTableView>
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Windows7">
                </HeaderContextMenu>
            </telerik:RadGrid>       
            <br /><br />
            <asp:Label ID="lbResult" runat="server"></asp:Label>
        </telerik:RadAjaxPanel>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Windows7" />
    </form>
</body>
</html>

Oh, one more thing, I want to export data from a RadGrid, by default it creates an .xls file type.  I want to export to an .xlsx (2007 format).  I searched on the forum and see that's possible by adding Excel-FileExtension = "xlsx" in the ExportSettings.  However, it's still not working.  Please help me on this matter.
Thanks so much!

Galin
Telerik team
 answered on 06 Feb 2012
5 answers
110 views
Hi,

I add over 150 columns to Rad Filter in code behind grammatically. When I click columns section on RadFilter, it takes really long to show the list. Also the list is so long, and it is not easy to find the column name you want.

So I was wondering if I could use a type ahead to select the column name.

Thanks,

Nazmi Etik
Mira
Telerik team
 answered on 06 Feb 2012
1 answer
51 views
I want to change the back color of telerik radTimePicker after disabled in javascript
How is it possible?
Princy
Top achievements
Rank 2
 answered on 06 Feb 2012
2 answers
61 views
Hi,

I'm using a RadStyleSheetManager on a form and make it add a css file from an embedded resource by calling:
myRSSM.StyleSheets.Add(new StyleSheetReference("stylesheet.css", "My.Lib"));
However, no matter what the contents of the css file, it works in Chrome and IE8, but not in IE9. IE9 just doesn't seem to load the file. Could I be doing something wrong?

Thanks,
Emiel
Emiel
Top achievements
Rank 1
 answered on 06 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?