Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
100 views
I am trying to have a grid allow me to drag and drop rows. I can get it to allow me to drag it but it doesn't save it in the new place. I'm also going to want to write it out to the database so the values are saved.

I've read all kinds of things that seem WAY to complicated - there must be an easy way to do it.

Can somebody point me in the right direction.

TIA - Jeff.
Shinu
Top achievements
Rank 2
 answered on 25 Jan 2012
14 answers
494 views

Since the most useful part of RadAjaxManager is the UI for defining AjaxSettings that go along with it, why not create something similar to ScriptManager and ScriptManagerProxy?  This way, individual controls could have a ScriptManagerProxy, where they can define their own internal settings and update controls and then the content page (or master page) could have the top level RadAjaxManager that would aggregate all the RadAjaxManagerProxy controls from all child controls and content pages.

Thoughts?

Nick
Top achievements
Rank 1
 answered on 25 Jan 2012
1 answer
89 views
I have a RadScheduler with intervals of 30 minutes.
I am trying to validate when the user moves an appointmente to another timeslot. I am using OnClientAppointmentMoveEnd to check the new timeslot and the new startime.
The problem is that when the user drags the appointment to, for example, 15:30, the "eventArgs.get_newStartTime()" returns "15:01".
If it drags to slot "15:00" it also shows "15:01". Why is that?
Here is a sample code where I am just trying to show a message asking the user to confirm the changes in the schedule and in the resource.

function OnClientAppointmentMoveEnd(sender, eventArgs) {
                 
                var apt = eventArgs.get_appointment();
                var msg = "";
                var novadata = eventArgs.get_newStartTime();
                if (apt.get_start() != novadata) {
                    msg = "New Schedule:" + novadata.format("HH:MM") + "\r\n";
                }
 
                if (apt.get_timeSlot().get_resource(0).get_key() != eventArgs.get_targetSlot().get_resource(0).get_key()) {
                    msg = msg + "New therapist:" + eventArgs.get_targetSlot().get_resource(0).get_text() + "\r\n";
                }
 
                if (confirm(msg + "Confirm change?" )) {
                 
                }
                else {
                    set_cancel(true);
                }
               
                 
                                 
            }

Any ideia? Thanks.
sotero
Top achievements
Rank 1
 answered on 24 Jan 2012
1 answer
139 views
Hello,

Is there a way to customize the tooltip ?

Thanks
Aurore
Richard
Top achievements
Rank 1
 answered on 24 Jan 2012
4 answers
204 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
541 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
519 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
546 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
138 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
115 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?