Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
184 views
Hi folks,

I use the ItemTemplate and put a DropDownList in the RadListBox. Meanwhile I set the EnableDragAndDrop to true for the RadListBox. Then the DropDownList does not work in IE9 and Chrome. However It works in FireFox, IE8, IE7. Did anyone encounter the same problem and know how to solve it? Any help would be appreciated.

Chris
Chris
Top achievements
Rank 1
 answered on 24 Jan 2012
4 answers
508 views
I have a RadGrid in a RadWindow.  When I try to filter the grid it does a postback and throws this exception:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +9792
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

I found that if I put another RadGrid on the page not in a RadWindow and filter it first, then filter the RadGrid in the window, it works correctly.

To reproduce: click "Open RadWindow", enter "5" in Title filter, click the filter icon for the Title column and select "Contains"

Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="RadGridTest.aspx.vb" Inherits="RadGridTest" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <a href="javascript:$find('RadWindow1').show();">Open RadWindow</a>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="True" VisibleTitlebar="true" VisibleStatusbar="false">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" Title="Change Dashboard" Width="500" Modal="true">
                    <ContentTemplate>
                        <telerik:RadGrid ID="RadGrid1" runat="server" PageSize="10" AllowPaging="true" AllowSorting="true">
                            <GroupingSettings CaseSensitive="false" />
                            <MasterTableView AutoGenerateColumns="false" AllowFilteringByColumn="true">
                                <Columns>
                                    <telerik:GridTemplateColumn AllowFiltering="false">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="lnkSelect" runat="server" NavigateUrl='/Default.aspx'>Select</asp:HyperLink>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn HeaderText="Title" DataField="Title" SortExpression="Title" />
                                    <telerik:GridBoundColumn HeaderText="Description" DataField="Description" SortExpression="Description" />
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
    </div>
    <div>
        <telerik:RadGrid ID="RadGrid2" runat="server" PageSize="10" AllowPaging="true" AllowSorting="true">
            <GroupingSettings CaseSensitive="false" />
            <MasterTableView AutoGenerateColumns="false" AllowFilteringByColumn="true">
                <Columns>
                    <telerik:GridTemplateColumn AllowFiltering="false">
                        <ItemTemplate>
                            <asp:HyperLink ID="lnkSelect" runat="server" NavigateUrl='/Default.aspx'>Select</asp:HyperLink>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn HeaderText="Title" DataField="Title" SortExpression="Title" />
                    <telerik:GridBoundColumn HeaderText="Description" DataField="Description" SortExpression="Description" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

Imports Telerik.Web.UI
Imports Telerik.Charting
Imports System.Data
Partial Class RadGridTest
    Inherits System.Web.UI.Page
 
    Private Shared Function GetGridDataTable() As DataTable
        Dim GridDataTable As New DataTable()
        GridDataTable.Columns.Add(New DataColumn("Title", System.Type.GetType("System.String")))
        GridDataTable.Columns.Add(New DataColumn("Description", System.Type.GetType("System.String")))
        For i As Integer = 0 To 4
            Dim Row As DataRow = GridDataTable.NewRow()
            Row.SetField("Title", "Title " & i)
            Row.SetField("Description", "Description " & i)
            GridDataTable.Rows.Add(Row)
        Next
        Return GridDataTable
    End Function
 
    Protected Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        RadGrid1.DataSource = GetGridDataTable()
    End Sub
 
    Protected Sub RadGrid2_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid2.NeedDataSource
        RadGrid2.DataSource = GetGridDataTable()
    End Sub
End Class

BrianS
Top achievements
Rank 1
 answered on 24 Jan 2012
3 answers
398 views
Hello,

I get an error when I try to sort the data in the grid.


The error is

Server Error in '/' Application.

Operation is not valid due to the current state of the object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Operation is not valid due to the current state of the object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Operation is not valid due to the current state of the object.]
   System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2692302
   System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +61
   System.Web.HttpRequest.FillInFormCollection() +148

[HttpException (0x80004005): The URL-encoded form data is not valid.]
   System.Web.HttpRequest.FillInFormCollection() +206
   System.Web.HttpRequest.get_Form() +68
   System.Web.HttpRequest.get_Item(String key) +39
   Telerik.Web.UI.RadCompression.IsAjaxRequest() +59
   Telerik.Web.UI.RadCompression.Compress(HttpApplication application) +720
   Telerik.Web.UI.RadCompression.PreRequestHandlerExecute(Object sender, EventArgs e) +76
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


My radgrid Setting
    <telerik:RadGrid ID="gridReports_Telerik" runat="server"  
                EnableAjaxSkinRendering="true"
                GridLines="Horizontal" CellPadding="0" BorderStyle="None"
                ClientSettings-AllowColumnHide="true" ClientSettings-EnableRowHoverStyle="true"
                ShowStatusBar="true" ShowHeader="true" AllowSorting="true"
                ShowFooter="true" RegisterWithScriptManager="true"
                EnableViewState="true"
                AllowFilteringByColumn="false"
                AllowMultiRowSelection="true"
                FilterItemStyle-Width="40" >
        <PagerStyle Mode="NextPrevAndNumeric" />
        <GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" />
        <MasterTableView TableLayout="Fixed" NoMasterRecordsText="No Record" >
        </MasterTableView>
        <HeaderStyle Height="50px" />
        <ClientSettings>
            <Scrolling EnableVirtualScrollPaging="false" />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
            <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
            <Resizing AllowColumnResize="true" EnableRealTimeResize="false"  ShowRowIndicatorColumn="false"
                      ResizeGridOnColumnResize="true" AllowRowResize="false" ClipCellContentOnResize="false" />
            
        </ClientSettings>
    
    </telerik:RadGrid>



I have used the httprequest to get some parameter from the url, so that the page url is http://xxx.com/test.aspx?operation=1&......
But the error message told that the URL encode is not valid.
What is the cause of the error and how to solve it? Thank you.

Regards,
Kev
Richard
Top achievements
Rank 1
 answered on 24 Jan 2012
2 answers
499 views
Howdy,

I'm writing some functionality that lists events for a specific date.  The date I am using is the radScheduler.SelectedDate. 

My question is about setting the radScheduler.SelectedDate.  Whenever you change it on the date selector, it doesn't seem to automatically change the radScheduler.SelectedDate . The radScheduler.SelectedDate gets set when some other event is fired (i.e. changing to day view, month view, etc.....) 

Is there a way to set the radScheduler.SelectedDate when the dateSelector event change?

Any help would be appreciated. 

Thanks!

Justin
Justin
Top achievements
Rank 1
 answered on 24 Jan 2012
5 answers
115 views
Hello,

I want to use the files selected from the Upload control to populate a grid.

below is my code, please provide examples I had trouble following the documentation...It wasn't exactly what I wanted, I want the same interface of selecting documents that the upload control provides, but I want to make a collection of those documents and then set it as the datasource for my grid.

Here is my code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default3.aspx.cs" Inherits="MultiFileUploadPrototype.Default3" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2011.3.1305.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
  
<head id="Head1" runat="server">
  
    <style type="text/css">
        .binaryImage img
        {
            border: 1px solid;
        }
    </style>
  
</head>
  
<body class="BODY">
  
    <form runat="server" id="mainForm" method="post">
  
        <!-- content start -->
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
  
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
          
            <script type="text/javascript">
                  
                //On insert and update buttons click temporarily disables ajax to perform upload actions
                function conditionalPostback(sender, eventArgs) {
                    var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                    if (eventArgs.get_eventTarget().match(theRegexp)) {
                        var upload = $find(window['UploadId']);
  
                        //AJAX is disabled only if file is selected for upload
                        if (upload.getFileInputs()[0].value != "") {
                            eventArgs.set_enableAjax(false);
                        }
                    }
                }
  
                function validateRadUpload(source, e) {
                    e.IsValid = false;
  
                    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)) {
                            e.IsValid = true;
                            break;
                        }
                    }
                }
  
                var $ = $telerik.$;
  
                function onClientFileUploaded(radAsyncUpload, args) {
                    //                    var $row = $(args.get_row());
                    //                    var categoryInputName = radAsyncUpload.getAdditionalFieldID("TextBox");
                    //                    var categoryInputType = "text";
                    //                    var categoryInputID = categoryInputName;
                    //                    var categoryInput = createInput(categoryInputType, categoryInputID, categoryInputName);
                    //                    var categoryLabel = createLabel(categoryInputID, "Category");
  
                    //                    var subCategoryInputName = radAsyncUpload.getAdditionalFieldID("ComboBox");
                    //                    var subCategoryInputID = subCategoryInputName;
                    //                    var subCategoryInput = createComboBox(subCategoryInputID);
                    //                    var subCategoryLabel = createLabel(subCategoryInputID, "Category");
  
                    //                    $row.append("<br/>");
                    //                    $row.append(categoryLabel);
                    //                    $row.append(categoryInput);
                    //                    $row.append("<br/>");
                    //                    $row.append(subCategoryLabel);
                    //                    $row.append(subCategoryInput);
                }
  
            </script>
  
        </telerik:RadCodeBlock>
          
        <div class="FileDetails">
            <telerik:RadAsyncUpload runat="server" 
                                    id="RadAsyncUpload1"
                                    OnClientFileUploaded="onClientFileUploaded" 
                                    MultipleFileSelection="Automatic" 
                                    OnFileUploaded="RadAsyncUpload1_OnFileUploaded">
            </telerik:RadAsyncUpload>
        </div>
  
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="conditionalPostback">
  
            <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
            <telerik:RadProgressArea ID="RadProgressArea1" runat="server" />
  
            <telerik:RadGrid runat="server" 
                             ID="RadGrid1" 
                             AllowPaging="True" 
                             AllowSorting="True"
                             AutoGenerateColumns="False" 
                             Width="97%" 
                             ShowStatusBar="True"
                             GridLines="None"
                             PageSize="4" 
                             OnItemDataBound="RadGrid1_ItemDataBound" 
                             OnItemCreated="RadGrid1_ItemCreated" >
                  
                <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
  
                <MasterTableView CommandItemDisplay="Top" 
                                 EditMode="InPlace" 
                                 AutoGenerateColumns="false" 
                                 AllowMultiColumnSorting="True" 
                                 EnableNoRecordsTemplate="False" 
                                 DataKeyNames="DocID" 
                                 IsFilterItemExpanded="False">
                      
                    <CommandItemTemplate>
                           <table width="100%">
                                <tr>
                                       <td width="40px">
                                            <asp:linkbutton id="btnRefresh" runat="server" commandname="RebindGrid">
                                            <img id="imgRebindGrid" style="border: 0px; vertical-align: middle;" alt="Refresh Data"
                                                runat="server" src="~/images/grids/refresh_small.gif" /></asp:linkbutton>
                                       </td>
                                       <td>
                                                <asp:linkbutton id="btnClearSort" runat="server" commandname="ClearSort">
                                                <img id="img1" style="border: 0px; vertical-align: middle;" alt="Clear Sorting"
                                                    runat="server" src="~/images/grids/Filter_Delete.gif" /></asp:linkbutton>
                                       </td>
                                       <td align="right">
                                                Show  
                                                <asp:dropdownlist ID="ddlFilterByDays" runat="server" Width="70px" commandname="filterbydays" AutoPostBack="true" >
                                                        <asp:ListItem Value="7">7 days</asp:ListItem>
                                                        <asp:ListItem Value="14">14 days</asp:ListItem>
                                                        <asp:ListItem Value="30">30 days</asp:ListItem>
                                                        <asp:ListItem Value="60">60 days</asp:ListItem>
                                                        <asp:ListItem Value="-1">ALL</asp:ListItem>
                                                </asp:dropdownlist>         
                                        </td>
                                </tr>
                           </table>
                    </CommandItemTemplate>
  
                    <Columns>
                          
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:ImageButton ID="btnEdit" ToolTip="Edit Record" runat="server" CausesValidation="False" CommandName="EditItem" ImageUrl="~/Images/Grids/edit_pencil_small.gif" />
                            </ItemTemplate>  
                        </telerik:GridTemplateColumn>
  
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:ImageButton ID="btnDelete" ToolTip="Delete Record" runat="server" CausesValidation="False"
                                                 CommandName="DeleteItem" OnClientClick="return GetUserConfirmForItemDelete(event);"
                                                 ImageUrl="~/Images/Delete.gif" />
                                                          
                            </ItemTemplate>             
                        </telerik:GridTemplateColumn>
  
                        <telerik:GridBoundColumn DataField="FileName" AllowFiltering="true" HeaderText="File Name" SortExpression="FileName" UniqueName="FileName" />
                      
                        <telerik:GridBoundColumn DataField="Category" AllowFiltering="true" HeaderText="Category" HeaderStyle-Wrap="true" SortExpression="Category" UniqueName="Category" />
                          
                        <telerik:GridBoundColumn DataField="SubCategory" AllowFiltering="true" HeaderText="Sub Category" HeaderStyle-Wrap="true" SortExpression="SubCategory" UniqueName="SubCategory" />
                          
                    </Columns>
  
                </MasterTableView>
  
                <ClientSettings>
                    <Selecting AllowRowSelect="false" /> 
                </ClientSettings>
  
            </telerik:RadGrid>
  
        </telerik:RadAjaxPanel>
       
    </form>
</body>
</html>

I have a class called uploadedDocument, which contains an ID, Name, Category and Subcategory.  How do I on the server side create a collection of this type based on the documents selected (for example, the document name I would use for the Name property and empty string for the other properties).

Thanks,

Thanks!
Plamen
Telerik team
 answered on 24 Jan 2012
3 answers
98 views
Currently we are evaluating upload controls provided by Telerik. Is HttpModules(s) mandatory for RadAsyncUpload(using Silverlight client) & RadUpload controls if we want to have progress bar.
Plamen
Telerik team
 answered on 24 Jan 2012
2 answers
96 views
Hi!

I'm implementing the DBFileBrowserContentProvider class to access to a Sql Server data base. It works fine if I use a web site but if I use a web application when I try to show the file the handler doesn't work. Does anybody have an idea about what I'm doing wrong?

The example I'm following is the next

http://www.telerik.com/community/code-library/aspnet-ajax/file-explorer/connect-radfileexplorer-or-radeditor-to-a-sql-databse.aspx

This example uses a web site but when I try to do the same in a web application, the hanlder file is never invoked and the file is never shown

Thanks in advance
Israel
Top achievements
Rank 1
 answered on 24 Jan 2012
3 answers
253 views
hello friends,

i am using the RadEditor in my application.

in my .aspx page i have some controls in the middle of those controls RadEditor is present, so i set the focus to the first controls on my aspx page, when ever i open my .aspx page focus is coming the first control after that i am pressing the Tab key  it is going to the next control, once it reaches to the RadEditor control(i.e., in the content area) if i press the Tab within that content area only focus is moving that is also fine. Now, my problem is i had some controls after RadEditor, so how can i move the focus to those controls using Tab key .

Thanks.
Richard
Top achievements
Rank 1
 answered on 24 Jan 2012
1 answer
126 views
Hi,

I was able get the FileExplorer to show files in a relative path within my project.
I'm now trying to show files in a physical location in my machine 'C:/Mediacontent/1' but I keep getting this error :

'C:/MediaContent/1' is a physical path, but a virtual path was expected.

I based my code in this example and I'm using a plain FileSystemContentProvider as the content provider type.
Can you help please?





Dobromir
Telerik team
 answered on 24 Jan 2012
1 answer
84 views
Hi,

I have a problem with the RTL resources (GUI related problems).
By trying to upload an image using the ImageManager (for example), The Upload window opens (View attached screen-shot), but not orgnized well (Not all labels are aligned to right and there is scrollers).

I'm uisng the following resources in order to change the language:
RadEditor.Dialogs.resx
RadEditor.Main.resx
RadEditor.Modules.resx
RadEditor.Tools.resx
RadListBox.resx
RadProgressArea.resx
RadScheduler.Main.resx
RadSpell.Dialog.resx
RadUpload.resx

By the way, the version which is used in this application is 2009.3.1314.35.

Please, I need your help in order to solve the above problem.

Regards,
Bader

Rumen
Telerik team
 answered on 24 Jan 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?