Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
568 views
Hi there,

I use the radasyncupload control in my website, it works fine on IE. But when I try it on Firefox, a HTTP 302 error is given and the upload shows up failed. The client functions (onClientFileSelected, OnClientFileUploadFailed etc.) are not fired, so I have no idea what is going wrong. How can I debug this? Do you know why the http 302 occurs?

Also, on Chrome clicking the button has no effect.

Any idea how to fix this?
Thank you,
Niels
Niels
Top achievements
Rank 1
 answered on 04 Nov 2010
3 answers
81 views
Hi,

We are using Q3 2009, and are using the image manager and are simply assigning the UploadPaths, DeletePaths and ViewPaths to ~/Imges which exists on the server and all permissions are correct for read write. testing is taking place in Firefox 3.5.5.

The problem we are experiencing is that once the Image manager displays, and we click upload, the upload dialog displays fine, but once you click one of the Select buttons to browse for an image, A large number of javascript errors appear like this

Error: Sys.ArgumentOutOfRangeException: Value must be an integer.
Parameter name: x
Actual value was 263.5.
Source File: http://www.adtechnologies.com/ScriptResource.axd?d=kWlb-4xBCmD-1qaYQsYX1Z6QhodlouPuN90plLQ014hX3Ldj8inarvJfEAvA9DehRULcdLXA0gR8l8vEYTjvfwInrx3P328adNirYV_Ozp01&t=633615008629602500
Line: 5839

Is this a known problem? Is there something we need to register handle wise in the web.config so that the image manager works? Thanks for your help.



Rumen
Telerik team
 answered on 04 Nov 2010
2 answers
109 views
Hello!

Is it possible to force RadGrid to not rebind the datasource on basic operations, like filtering i.e. and just use the previous bound datasource? If so, how?

Regards
Aleš
Top achievements
Rank 1
 answered on 04 Nov 2010
7 answers
1.1K+ views
hey everyone,

I am using a radgrid where user inserts Order.Order are temporarily stored in radgrid using data table as data source.I want to show a total of all the values inside Amount column in the grid footer.How to achieve this?...

Thanks
Amit
Pavlina
Telerik team
 answered on 04 Nov 2010
7 answers
552 views
I have a radcombobox that runs some code when the user starts typing in numbers to pull relevant part numbers. Once a user selects a number I need to populate some asp labels. The problem is, these combobox and labels are in an asp repeater because the user can essentially keep adding parts. To see what it does you can go here. http://devpartsonline.intellicomweb.com/test.aspx
Basically when the users selects a number to go into the radcombobox I need the two labels (right now say test) to update from the database with the price and part name of that number. I need to run serverside code and update those labels but I can't figure out how to get the rad combo box to execute code since it is in a repeater. I really have no idea how to get started on this. Here is my aspx and vb just for a reference. Thanks,

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="bulkOrder.aspx.vb" Inherits="devOrthman.bulkOrder"
    MasterPageFile="~/MasterPage.Master" Title="Bulk Ordering" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script language="javascript" type="text/javascript">
function OnClientItemsRequested(sender, eventArgs)
 {
   if(sender.get_items().get_count() == 0)
   {
    sender.clearSelection();
    sender.hideDropDown();
    
   }
 }
    </script>

    <div class="ContentPadding">
        <asp:UpdatePanel ID="Panel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <span class="H2Internal">Bulk Ordering</span>
                <p>
                    <asp:Repeater ID="Repeater1" runat="server">
                        <HeaderTemplate>
                            <table cellspacing="5">
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr valign="middle">
                                <td width="80px">
                                    
                                    <asp:Button ID="AddButton" runat="server" Text="Add" CommandName="Add" CausesValidation="True" ValidationGroup ="bulkValidation" />
                                    <asp:Button ID="RemoveBtn" runat="server" Text="Delete" CommandName="Remove" CausesValidation="false"
                                        Visible="false" />
                                </td>
                                <td width="175px">
                                    <telerik:RadComboBox ID="RadSearchComboBox" runat="server" Width="150px" Height="175px"  ValidationGroup ="bulkValidation"
                                        OnSelectedIndexChanged="itemChanged"
                                        AllowCustomText="True" ShowToggleImage="False"
                                        ShowMoreResultsBox="true" EnableLoadOnDemand="True" Skin="Telerik" MarkFirstMatch="True"
                                        OnItemsRequested="loadSearch" EnableVirtualScrolling="true" EmptyMessage="Enter Part Number"
                                        ErrorMessage="Value not Found" AutoPostBack="False" OnClientItemsRequested="OnClientItemsRequested">
                                        <CollapseAnimation Duration="100" Type="OutQuint" />
                                    </telerik:RadComboBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"  ValidationGroup ="bulkValidation"
                                        ControlToValidate="RadSearchComboBox" />
                                </td>
                                <td width="45px">
                                    <telerik:RadNumericTextBox ID="QtyTextBox" runat="server" MaxLength="3" MaxValue="999"  ValidationGroup ="bulkValidation"
                                        MinValue="1" NumberFormat-DecimalDigits="0" ShowSpinButtons="false" Type="Number"
                                         Width="20px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"  ValidationGroup ="bulkValidation"
                                        ControlToValidate="QtyTextBox" />
                                </td>
                                <td class="H2Internal">
                                    Part Name: <asp:Label CssClass ="MainText" id="partName" runat="server" Text="test"></asp:Label>&nbsp;&nbsp;&nbsp;
                                    Price: <asp:Label CssClass ="MainText" id="price" runat="server" Text="test"></asp:Label>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </p>
                <p>
                    <asp:Button ID="Button1" runat="server" Text="All Items to Cart" CausesValidation="True"  ValidationGroup ="bulkValidation"
                        OnClick="addToCart"></asp:Button>
                </p>
                <p>
                    <asp:Label ID="msgLabel" runat="server" Text=""></asp:Label>
                </p>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>
----------------------------------------------------------------------------------------------------------------
VB Code
----------------------------------------------------------------------------------------------------------------
Imports Telerik.Web.UI
Imports System.Data.SqlClient
Imports System.Net.Mail
Partial Public Class bulkOrder
    Inherits System.Web.UI.Page
    Shared allItems As ArrayList

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            allItems = New ArrayList
            Me.bulkItems = allItems
            Me.bulkItems.Add(New bulkOrderItem())
            Me.Repeater1.DataSource = bulkItems
            Me.Repeater1.DataBind()
        Else
            storeList()
        End If
    End Sub
    Protected Sub loadSearch(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
        Dim connection As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("orthmanConnectionString").ToString)
        Dim selectCommand As New SqlCommand("searchByPartNumber", connection)

        selectCommand.Parameters.AddWithValue("partNumber", e.Text)
        selectCommand.CommandType = CommandType.StoredProcedure
        Dim adapter As New SqlDataAdapter(selectCommand)
        Dim data As New DataTable()
        adapter.Fill(data)
        Try

            Dim itemsPerRequest As Integer = 10
            Dim itemOffset As Integer = e.NumberOfItems
            Dim endOffset As Integer = itemOffset + itemsPerRequest
            If endOffset > data.Rows.Count Then
                endOffset = data.Rows.Count
            End If

            If endOffset = data.Rows.Count Then
                e.EndOfItems = True
            End If
            Dim i As Integer = itemOffset
            While i < endOffset
                CType(sender, RadComboBox).Items.Add(New RadComboBoxItem(data.Rows(i)("PartNumber").ToString(), data.Rows(i)("PartId").ToString()))
                i = i + 1
            End While

            If data.Rows.Count > 0 Then
                e.Message = [String].Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), data.Rows.Count.ToString())
            Else
                e.Message = "No Matches"
            End If
        Catch
            e.Message = "No Matches"
        Finally
            adapter.Dispose()
        End Try
    End Sub
    'Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click
    '    Me.bulkItems.Add(New bulkOrderItem())
    '    Me.Repeater1.DataSource = bulkItems
    '    Me.Repeater1.DataBind()

    'End Sub
    Protected Sub rptrDatabound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) Handles Repeater1.ItemDataBound
        Dim index As Integer = e.Item.ItemIndex
        If index < bulkItems.Count And index > -1 Then
            Dim bulkItem As bulkOrderItem
            Dim txtPart As RadComboBox
            Dim qtyPart As Telerik.Web.UI.RadNumericTextBox
            txtPart = CType(e.Item.FindControl("RadSearchComboBox"), RadComboBox)
            qtyPart = CType(e.Item.FindControl("QtyTextBox"), Telerik.Web.UI.RadNumericTextBox)
            bulkItem = CType(bulkItems.Item(index), bulkOrderItem)
            txtPart.Text = bulkItem.itemNumber
            qtyPart.Value = bulkItem.itemQty
            e.Item.FindControl("AddButton").Visible = Not bulkItem.canDelete
            e.Item.FindControl("RemoveBtn").Visible = bulkItem.canDelete
        End If
    End Sub
    Protected Sub storeList()
        Dim index As Integer = 0
        Dim bulkItem As bulkOrderItem
        For Each rptrItem As RepeaterItem In Repeater1.Items
            Dim txtPart As RadComboBox
            Dim qtyPart As Telerik.Web.UI.RadNumericTextBox
            txtPart = CType(rptrItem.FindControl("RadSearchComboBox"), RadComboBox)
            qtyPart = CType(rptrItem.FindControl("QtyTextBox"), RadNumericTextBox)
            bulkItem = CType(bulkItems.Item(index), bulkOrderItem)
            bulkItem.itemNumber = txtPart.Text
            bulkItem.itemQty = qtyPart.Value
            bulkItem.canDelete = Not (rptrItem.FindControl("AddButton").Visible)
            index = index + 1
        Next

    End Sub
    'Protected Sub emailAdministrator(ByVal OrderId As String)
    '    Dim msgBody As String
    '    msgBody = "A new order has been placed." & vbCrLf
    '    msgBody &= " Order ID: " & OrderId & vbCrLf
    '    msgBody &= "Please click on the following link to view the details of the order:" & vbCrLf
    '    msgBody &= "http://orthman.intellicomweb.com/admin/orders/orderDetails.aspx?ID=" & OrderId

    '    Dim msgTo As String = System.Configuration.ConfigurationManager.AppSettings("sentToAdmin")
    '    Dim msgFrom As String = System.Configuration.ConfigurationManager.AppSettings("sendfrom")
    '    Dim msgSubject As String = "Orthman Online Catalog - New Order Placed"
    '    Try
    '        Dim checkoutMail As New MailMessage(msgFrom, msgTo, msgSubject, msgBody)
    '        Dim mailClient As New SmtpClient()
    '        mailClient.Host = "inteexchange01"
    '        checkoutMail.IsBodyHtml = False
    '        mailClient.Send(checkoutMail)
    '    Catch err As Exception
    '        msgLabel.Text = "An error ocurred, please try again later. <BR/>" & err.ToString
    '    End Try
    'End Sub

    Protected Sub itemChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
        Response.Write("test")
    End Sub
    Protected Sub rptrCommand(ByVal sender As Object, ByVal e As RepeaterCommandEventArgs) Handles Repeater1.ItemCommand
        Dim index As Integer
        index = e.Item.ItemIndex
        If e.CommandName = "Remove" Then
            bulkItems.RemoveAt(index)
            Me.Repeater1.DataSource = bulkItems
            Me.Repeater1.DataBind()

        ElseIf e.CommandName = "Add" Then
            Page.Validate()
            If Page.IsValid() Then
                Me.bulkItems.Add(New bulkOrderItem())
                Me.Repeater1.DataSource = bulkItems
                Me.Repeater1.DataBind()
                Me.Repeater1.Items(index).FindControl("AddButton").Visible = False
                Me.Repeater1.Items(index).FindControl("RemoveBtn").Visible = True

            End If
            Panel1.Update()
        End If
    End Sub
    Protected Sub addToCart(ByVal sender As Object, ByVal e As System.EventArgs)

        Page.Validate()
        If Page.IsValid() Then
            Dim bulkItem As bulkOrderItem
            storeList()
            Dim i As Integer = 0
            While i < bulkItems.Count
                bulkItem = CType(bulkItems.Item(i), bulkOrderItem)
                storeInDB(bulkItem.Number, bulkItem.Qty)
                i = i + 1
            End While
            Response.Redirect("~/cart/viewcart.aspx")
        End If
    End Sub
    Private Property bulkItems() As IList
        Get
            Return CType(ViewState("allItems"), ArrayList)
        End Get
        Set(ByVal value As IList)
            ViewState("allItems") = value
        End Set
    End Property
    Protected Sub storeInDB(ByVal partNumber As String, ByVal qty As Integer)
        Dim connString As String = System.Configuration.ConfigurationManager.ConnectionStrings("orthmanConnectionString").ToString
        Dim myConnection As New Data.SqlClient.SqlConnection(connString)
        Dim strSQL = "addPartToCartByNumber"
        Dim insertCommand As New Data.SqlClient.SqlCommand(strSQL, myConnection)
        Dim PartIdParameter As New SqlClient.SqlParameter("@PartNumber", SqlDbType.NVarChar)
        Dim qtyParameter As New SqlClient.SqlParameter("@Quantity", SqlDbType.Int)
        Dim userNameParameter As New SqlClient.SqlParameter("@UserName", SqlDbType.NVarChar)

        insertCommand.CommandType = CommandType.StoredProcedure

        PartIdParameter.Value = partNumber
        qtyParameter.Value = qty
        userNameParameter.Value = User.Identity.Name

        insertCommand.Parameters.Add(PartIdParameter)
        insertCommand.Parameters.Add(qtyParameter)
        insertCommand.Parameters.Add(userNameParameter)
        Try
            myConnection.Open()
            insertCommand.ExecuteNonQuery()
        Catch ex As Exception
            'msgLabel.Text = ex.ToString()
        Finally
            myConnection.Close()
        End Try
    End Sub

End Class
vivek
Top achievements
Rank 1
 answered on 04 Nov 2010
3 answers
111 views
I hav a rad grid having some n columns.
If i try to print the grid after grouping a particular column its not working..
Can i know the solution for this??
vijay
Top achievements
Rank 1
 answered on 04 Nov 2010
3 answers
158 views
Hello

I am using two GridDateTimeColumns with Time PickerControl, I am trying to add a compare validator to one of the controls to compare the time against another control however adding the compare validator to the griddatetimecolumn throws Object Reference not set to an instance of an object exception. Below is the code I am using

Protected Sub RadGridTransCalc_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridTransCalc.ItemCreated  
 
            If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then  
                Dim item As GridEditableItem = CType(e.Item, GridEditableItem)  
                Dim editor As GridDateTimeColumnEditor = CType(item.EditManager.GetColumnEditor("END_TIME"), GridDateTimeColumnEditor)  
                Dim cell As TableCell = CType(editor.PickerControl.Parent, TableCell)  
                Dim validator As CompareValidator = New CompareValidator  
                editor.TextBoxControl.ID = "ID_for_validation" 
                validator.ControlToValidate = editor.PickerControl.ID  
                validator.ControlToCompare = "START_TIME" 
                validator.Operator = "GreaterThan" 
                validator.Type = ValidationDataType.Date  
                validator.ErrorMessage = "End time must be greater than start time" 
                cell.Controls.Add(validator)  
            End If  
 
End Sub 

 

On debugging I found that the following line is throwing the exception

 

Dim cell As TableCell = CType(editor.PickerControl.Parent, TableCell)  

does anyone had a similar issue ?? If so how did you solve it, Help!!!!!

Thanks,
Kevin
Chris
Top achievements
Rank 1
 answered on 03 Nov 2010
3 answers
144 views

I have a following code in my radgrid:

<CommandItemTemplate>
    <asp:LinkButton ID="ExportToPdfButton" runat="server" CommandName="ExportToPdf" CssClass="pdfButton" ></asp:LinkButton>
</CommandItemTemplate>

The radgrid is ajaxafied with a RadAjaxManager.

Use ItemCreated in I call RegisterPostBackControl so that when I click the PDF button it doesn't use ajax and pops up my PDF.

Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
        If TypeOf e.Item Is GridCommandItem Then
            Dim btn As LinkButton = e.Item.FindControl("ExportToPdfButton")
            If Not btn Is Nothing Then
                RadScriptManager.GetCurrent(Page).RegisterPostBackControl(btn)
            End If
        End If
End Sub

This works fine the first time my page loads. I click the PDF, it opens up... all good. 
However, I have a series of combo boxes that are wired in the RadAjaxManager to rebind the grid when changed. When the radgrid gets changed through an ajax postback, and I click the PDF button, it then causes an ajax postback and the commanditem template disappears entirely, and of course.. the PDF is not created.

Any idea how I can make sure the PDF button always does a regular postback?
Greg
Top achievements
Rank 1
 answered on 03 Nov 2010
5 answers
222 views
Hi, after implementing URlrewrite, the telerik ajaxmanager not seems to responding.

got following error
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 3.5.30428; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Tue, 23 Feb 2010 00:51:29 UTC


Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
<!DOCTYPE html PUB'.
Line: 6
Char: 62099
Code: 0
URI: http://dev10nz.oslweb.co.nz/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.3.1210.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a21436984-11a2-4f37-85de-ba7b6084d96e%3a16e4e7cd%3a874f8ea2%3af7645509%3a24ee1bba%3a19620875%3a39040b5c%3ab7778d6c%3a1e771326%3aa7e79140%3aed16cbdc%3a3f6e8f3f%3ae330518b%3ac8618e41%3aaa288e2d


Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
<!DOCTYPE html PUB'.
Line: 6
Char: 62099
Code: 0
URI: http://dev10nz.oslweb.co.nz/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.3.1210.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a21436984-11a2-4f37-85de-ba7b6084d96e%3a16e4e7cd%3a874f8ea2%3af7645509%3a24ee1bba%3a19620875%3a39040b5c%3ab7778d6c%3a1e771326%3aa7e79140%3aed16cbdc%3a3f6e8f3f%3ae330518b%3ac8618e41%3aaa288e2d

James Shelton Agar
Top achievements
Rank 2
 answered on 03 Nov 2010
1 answer
74 views
Hi all!

I'm a new guy and on the way to use RadGrid. Here is my problem

+ I created a RadGrid and used NeedDataSource Event to load the data.
+ It's good at this time. But I wonder when I click on the next button on paging, it refreshes all the page instead of only the RadGrid.

Thanks!

Andy.
Daniel
Telerik team
 answered on 03 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?