Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views

Hi Team,

 I am using 2012.1.411.40 version of Telerik and i am upgrading my application with the latest version, i would like to know that is there any problems arises with the previous rad controls and is the previous version of rad controls will be compatible with the newer vesion of rad controls.

 

Regards,

A.Shrujan

 

Marin Bratanov
Telerik team
 answered on 09 Jun 2015
17 answers
712 views

I have a radGrid with plan and actual numerical values. These numbers fall under a specific period. For example I want to run the report for 1 year. The periods would be January of this year through December of this year.

 

I want the 2 columns Plan and Actual to appear underneath each period.

Something like this:

 

    January 2015

Plan           Actual

 My datatable has one row per period. So row 1 would contain the plan and actual value for January of 2015. Row 2 would contain the plan and actual values for February of 2015.

 

I have all of this working without the Period groupheader. 

 One last thing. It has to all be done in the code behind. Dynamic creation of the group header.

 Can someone point me in the right direction?

 Thanks,

Julian

Julian
Top achievements
Rank 1
 answered on 09 Jun 2015
4 answers
463 views

I'd like to have a multipage that has a tab for different document types. Clicking the "TAB-A" tab would let you select files, then click on "TAB-B" and select more files. When you are all done, click "Upload" and have all the files in each control process.

 I've run into an issue where I'm unable to have multiple events of .FileUploaded. The postback triggers the control's event to start processing but If I add more than 1 and create an event it shows it's not a valid move to have more than one  .FileUploaded events per page.

Am I doing this incorrectly or is it not possible to use multiple AsyncUpload controls on the same page?

 See Photo below where controls 2 & 3 are not happy since it's using the same event as control 1 (not shown)

Ivan Danchev
Telerik team
 answered on 09 Jun 2015
14 answers
436 views
We are having a couple of issues with the RadComboBox not reloading when the selection has been cleared.  These issues only appear in Internet Explorer and can be reproduced on Telerik's website at http://demos.telerik.com/aspnet-ajax/combobox/examples/default/defaultcs.aspx

Issue #1:
1. Click into the Region RadComboBox.
2. Type or paste a valid value into the Region ComboBox ("Cambridge" is a good example)
3. Click or Tab out of the RadComboBox and it will reload with only the item that was typed into it.
4.  Click back into the Region RadComboBox.
5. Clear the Highlighted text with delete or backspace; notice the list does not request new items and reload.

Issue #2:
Click or Tab out of the field again; notice that the text area is populated with the old value.

Issue #2 is probably a direct result of the item list keeping the previous selection in Issue#1.  We need the RadComboBox to reload the original list when the selection is cleared out of it.


Ivan Danchev
Telerik team
 answered on 09 Jun 2015
3 answers
271 views

So I threw together about the most simple test I could (there's literally nothing on the page except the hamburger) to see what it would look like on a mobile device, and it works just fine on my desktop (hamburger displays, clicking with mouse expands the navigation below) but, as soon as I check it on any mobile device or using the developer tools in Chrome, the hamburger is still displayed but pressing on it does nothing. I've removed nothing from the code below and the only additional change I've made to the site was to include the reference to the sitemap within the Web.config file. Any ideas as to why such a simple example is not being kind to me?

 

ASPX Page

______________________________________________________

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="TestSite.Mobile.test" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadMenu ID="RadMenu1" RenderMode="Mobile" runat="server" ShowToggleHandle="true" Height="115px" Skin="MetroTouch" CssClass="t-rwd-menu-mobile" DataSourceID="dsMobileSitemap"></telerik:RadMenu>        
        <asp:SiteMapDataSource ID="dsMobileSitemap" runat="server" ShowStartingNode="False" SiteMapProvider="mobileSitemap" />
    </form>
</body>
</html>

 

ASPX.CS Page​

______________________________________________________

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;

namespace TestSite.Mobile
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
    }
}

 

mobile.sitemap

______________________________________________________

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/" title="home"  description="Home">
        <siteMapNode url="~/Mobile/Default.aspx" title="home"  description="Home" />
        <siteMapNode url="~/Mobile/Contact.aspx" title="contact us"  description="Contact Us" />
        <siteMapNode url="~/Mobile/DemoRequest.aspx" title="request a demo"  description="Request a Demo" />
    </siteMapNode>
</siteMap>

Ivan Danchev
Telerik team
 answered on 09 Jun 2015
0 answers
157 views

 Hello,

 I'm new in telerik and I need some help.

 In my case everything works fine, except the validation of a field.

 On the line 327 there is a RequiredFieldValidator, the validation doesn't work at all. The validator and the RadTextbox that I want to be validated are inside a  RadWindow, as I can see the problem is somewhere related to RadWindow but I cannot find exactly what is the problem.

 I put my code below, please let me know if anyone has any solution about this issue.

 Thank You

 

 

001.<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Classrooms.Default" EnableEventValidation="false" %>
002. 
003.<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
004.<!DOCTYPE html>
005. 
006.<html xmlns="http://www.w3.org/1999/xhtml">
007.<head runat="server">
008.    <title>Classrooms</title>
009.    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
010.        <script type="text/javascript">
011.            var popUp;
012.            function PopUpShowing(sender, eventArgs) {
013.                popUp = eventArgs.get_popUp();
014.                var gridWidth = sender.get_element().offsetWidth;
015.                var gridHeight = sender.get_element().offsetHeight;
016.                var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
017.                var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
018.                popUp.style.left = ((gridWidth - popUpWidth) / 2 + sender.get_element().offsetLeft).toString() + "px";
019.                popUp.style.top = ((gridHeight - popUpHeight) / 2 + sender.get_element().offsetTop).toString() + "px";
020.            }
021. 
022.            var rwEquipments = null;
023.            var radGrid1 = null;
024.            var radGrid2 = null;
025. 
026.            function pageLoad() {
027.                radGrid1 = $find("<%= RadGrid1.ClientID %>");
028.                rwEquipments = $find("<%= rwEquipments.ClientID %>");
029.                rwRoomDetails = $find("<%= rwRoomDetails.ClientID %>");
030.            }
031. 
032.            function cancelEquipments(sender, args) {
033.                rwEquipments.close();
034.                args.set_cancel(true);
035.            }
036.            function saveEquipments(sender, args) {
037.                radGrid1.get_masterTableView().fireCommand("SaveEquipments", rwEquipments.get_title());
038.                rwEquipments.close();
039.                args.set_cancel(true);
040.            }
041. 
042.            function cancelClassroom(sender, args) {
043.                rwRoomDetails.close();
044.                args.set_cancel(true);
045.            }
046.            function saveClassroom(sender, args) {
047.                    radGrid1.get_masterTableView().fireCommand("SaveClassroom", rwRoomDetails.get_title());
048.                    rwRoomDetails.close();
049.                    args.set_cancel(true);
050.            }
051.        </script>
052.        <style>
053.            .RadGrid a.bookNowLink:visited,
054.            .RadGrid a.bookNowLink:link,
055.            .RadGrid a.bookNowLink:hover,
056.            .RadGrid a.bookNowLink:active {
057.                text-decoration: none;
058.                text-transform: uppercase;
059.            }
060. 
061.            div.qsf-right-content .qsf-col-wrap {
062.                padding-right: 0;
063.            }
064. 
065.            div.carTitle {
066.                font-size: 15pt;
067.                padding: 30px 0 5px 0;
068.            }
069. 
070.            .carBackground {
071.                background-position: right bottom;
072.                background-repeat: no-repeat;
073.                height: 263px;
074.                border-top: 1px solid #dae2e8;
075.                border-bottom: 1px solid #dae2e8;
076.                padding: 20px 20px 10px 30px;
077.            }
078. 
079.            .carInfo {
080.                line-height: 24px;
081.            }
082. 
083.            hr.lineSeparator {
084.                color: #a9b5be;
085.                background-color: #a9b5be;
086.                height: 1px;
087.                border: none;
088.            }
089. 
090.            .divTitle {
091.                font-size: 20px;
092.            }
093. 
094.            .divFrame {
095.                padding: 20px 0 20px 20px;
096.                width: 520px;
097.            }
098. 
099.            .RadWindow .rwCorner .rwTopLeft,
100.            .RadWindow .rwTitlebar,
101.            .RadWindow .rwCorner .rwTopRight,
102.            .RadWindow .rwIcon,
103.            .RadWindow table .rwTopLeft,
104.            .RadWindow table .rwTopRight,
105.            .RadWindow table .rwFooterLeft,
106.            .RadWindow table .rwFooterRight,
107.            .RadWindow table .rwFooterCenter,
108.            .RadWindow table .rwBodyLeft,
109.            .RadWindow table .rwBodyRight,
110.            .RadWindow table .rwTitlebar,
111.            .RadWindow table .rwTopResize,
112.            .RadWindow table .rwStatusbar {
113.                display: none;
114.            }
115. 
116.            div.RadGrid_WebBlue .rgFilterRow td {
117.                padding-bottom: 4px;
118.                padding-top: 8px;
119.            }
120. 
121.            .rbDecorated {
122.                padding-right: 10px !important;
123.            }
124. 
125.            span.RadButton {
126.                vertical-align: top;
127.            }
128. 
129.            /*Page Layout*/
130.            .gridHeader {
131.                position: relative;
132.                background-image: url(Images/btns.png);
133.                background-repeat: no-repeat;
134.                background-position: 100% -80px;
135.                padding-right: 161px;
136.            }
137. 
138.                .gridHeader > div {
139.                    background: #9ad0da url("Images/header.png") no-repeat;
140.                    height: 80px;
141.                    margin: 0;
142.                }
143. 
144.                .gridHeader span.saveButton,
145.                .gridHeader span.loadButton {
146.                    height: 80px;
147.                    width: 80px;
148.                    padding: 0;
149.                    position: absolute;
150.                    right: 0;
151.                    top: 0;
152.                    background: url(Images/btns.png) no-repeat 0 0;
153.                    overflow: hidden;
154.                }
155. 
156.                .gridHeader .saveButton input,
157.                .gridHeader .loadButton input {
158.                    text-indent: -9999px;
159.                }
160. 
161.                .gridHeader span.saveButton {
162.                    right: 81px;
163.                    background-position: -80px 0;
164.                }
165. 
166.            * + html .demo-container {
167.                max-width: 1040px;
168.            }
169. 
170.            div.demo-container {
171.                border: 0 none;
172.                padding: 0;
173.            }
174.        </style>
175.    </telerik:RadCodeBlock>
176.</head>
177.<body>
178.    <form id="form1" runat="server">
179.        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
180.        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Metro"></telerik:RadAjaxLoadingPanel>
181. 
182.        <p id="divMsgs" runat="server">
183.            <asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080">
184.            </asp:Label>
185.            <asp:Label ID="Label2" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000">
186.            </asp:Label>
187.        </p>
188. 
189.        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
190.            <AjaxSettings>
191. 
192.                <telerik:AjaxSetting AjaxControlID="RadGrid1">
193.                    <UpdatedControls>                       
194.                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
195.                        <telerik:AjaxUpdatedControl ControlID="divMsgs" LoadingPanelID="RadAjaxLoadingPanel1" />
196.                        <telerik:AjaxUpdatedControl ControlID="rwEquipments" LoadingPanelID="RadAjaxLoadingPanel1" />
197.                        <telerik:AjaxUpdatedControl ControlID="rwRoomDetails" LoadingPanelID="RadAjaxLoadingPanel1" />
198.                    </UpdatedControls>
199.                </telerik:AjaxSetting>
200. 
201.            </AjaxSettings>
202.        </telerik:RadAjaxManager>
203.         
204.        <telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None" OnItemCommand="RadGrid1_ItemCommand"
205.            AllowPaging="True" PageSize="20" AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="true" Skin="Metro"
206.            AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated">
207.            <MasterTableView EditMode="PopUp" DataKeyNames="RoomId,Room">
208.                <Columns>
209.                    <telerik:GridTemplateColumn>
210.                        <ItemTemplate>
211.                            <telerik:RadButton ID="btnEdit" runat="server" ButtonType="LinkButton" Text="Edit" CommandName="ResetFields" OnClick="btnEdit_Click" CommandArgument='<%# Eval("RoomId") %>' Icon-PrimaryIconCssClass="rbEdit" />
212.                        </ItemTemplate>
213.                    </telerik:GridTemplateColumn>
214.                    <telerik:GridBoundColumn DataField="Room" HeaderText="Room" />
215.                    <telerik:GridBoundColumn DataField="Description" HeaderText="Description" />
216.                    <telerik:GridBoundColumn DataField="NumberOfSeats" HeaderText="Number of Seats" />
217.                    <telerik:GridBoundColumn DataField="Campus" HeaderText="Campus" />
218.                    <telerik:GridBoundColumn DataField="Building" HeaderText="Building" />
219.                    <telerik:GridBoundColumn DataField="Floor" HeaderText="Floor" />
220.                    <telerik:GridBoundColumn DataField="DisabledAccessLevel" HeaderText="Disabled AccessLevel" />
221.                    <telerik:GridBoundColumn DataField="Type" HeaderText="Type" />
222.                    <telerik:GridCheckBoxColumn DataField="WorkingState" HeaderText="Working State" />
223.                    <telerik:GridBoundColumn DataField="StateDescription" HeaderText="State Description" />
224.                    <telerik:GridBoundColumn DataField="EnergyEfficiency" HeaderText="Energy Efficiency" />
225.                    <telerik:GridBoundColumn DataField="Longitude" HeaderText="Longitude" />
226.                    <telerik:GridBoundColumn DataField="Latitude" HeaderText="Latitude" />
227.                    <telerik:GridBoundColumn DataField="GMapCoordinates" HeaderText="GMap Coordinates" />
228.                    <telerik:GridTemplateColumn>
229.                        <ItemTemplate>
230.                            <telerik:RadButton ID="btnEquipment" runat="server" ButtonType="LinkButton" Text="Equipments" CommandName="ResetEquipments" OnClick="btnEquipment_Click"
231.                                CommandArgument='<%# Eval("RoomId") %>' />
232.                        </ItemTemplate>
233.                    </telerik:GridTemplateColumn>
234.                </Columns>
235.            </MasterTableView>
236.            <ClientSettings>
237.                <ClientEvents OnPopUpShowing="PopUpShowing" />
238.            </ClientSettings>
239.        </telerik:RadGrid>
240. 
241.        <telerik:RadWindow ID="rwEquipments" runat="server" VisibleTitlebar="false" Modal="true" AutoSize="true" Behaviors="None" Skin="Metro">
242.            <ContentTemplate>
243.                <div class="divFrame">
244.                    <div class="divTitle">
245.                        Select the available equipments for the current classroom
246.                    </div>
247.                    <hr class="lineSeparator" style="margin: 12px 0 12px 0" />
248.                    <table cellspacing="8">
249.                        <colgroup>
250.                            <col width="150px" />
251.                            <col width="150px" />
252.                            <col />
253.                            <col />
254.                        </colgroup>
255.                        <tr>
256.                            <td>Chairs</td>
257.                            <td>
258.                                <asp:CheckBox runat="server" ID="addRemoveChairs" />
259.                            </td>
260.                        </tr>
261.                        <tr>
262.                            <td>Desks</td>
263.                            <td>
264.                                <asp:CheckBox runat="server" ID="addRemoveDesks" />
265.                            </td>
266.                        </tr>
267.                        <tr>
268.                            <td>Computers</td>
269.                            <td>
270.                                <asp:CheckBox runat="server" ID="addRemoveComputers" />
271.                            </td>
272.                        </tr>
273.                        <tr>
274.                            <td>Instructor Computer</td>
275.                            <td>
276.                                <asp:CheckBox runat="server" ID="addRemoveInstructorComputer" />
277.                            </td>
278.                        </tr>
279.                        <tr>
280.                            <td>Projector</td>
281.                            <td>
282.                                <asp:CheckBox runat="server" ID="addRemoveProjector" />
283.                            </td>
284.                        </tr>
285.                        <tr>
286.                            <td>Smart Board</td>
287.                            <td>
288.                                <asp:CheckBox runat="server" ID="addRemoveSmartBoard" />
289.                            </td>
290.                        </tr>
291.                        <tr>
292.                            <td>Specific Software</td>
293.                            <td>
294.                                <asp:CheckBox runat="server" ID="addRemoveSpecificSoftware" />
295.                            </td>
296.                        </tr>
297.                    </table>
298.                    <hr class="lineSeparator" style="margin: 12px 0 12px 0" />
299.                    <telerik:RadButton ID="SaveEquipments" runat="server" Text="Save Changes"
300.                        Width="100px" OnClientClicking="saveEquipments" UseSubmitBehavior="false" />
301.                    <telerik:RadButton ID="CancelEquipments" runat="server" Text="Cancel"
302.                        Width="100px" OnClientClicking="cancelEquipments" UseSubmitBehavior="false" />
303.                </div>
304.            </ContentTemplate>
305.        </telerik:RadWindow>
306.         
307.        <telerik:RadWindow ID="rwRoomDetails" runat="server" VisibleTitlebar="false" Modal="true" AutoSize="true" Behaviors="None" Skin="Metro">
308.            <ContentTemplate>
309.                <div class="divFrame">
310.                    <div class="divTitle">
311.                        Room Details
312.                    </div>
313.                    <hr class="lineSeparator" style="margin: 12px 0 12px 0" />
314.                    <table cellspacing="8">
315.                        <colgroup>
316.                            <col width="150px" />
317.                            <col width="150px" />
318.                            <col />
319.                            <col />
320.                        </colgroup>
321.                        <tr>
322.                            <td>Room</td>
323.                            <td>
324.                                <telerik:RadTextBox runat="server" ID="txtRoom" EmptyMessage="Room Name" />
325.                            </td>
326.                            <td>
327.                                <asp:RequiredFieldValidator
328.                                    ID="rfvRoom"
329.                                    runat="server"
330.                                    Display="Dynamic"
331.                                    ControlToValidate="txtRoom"
332.                                    ErrorMessage="*"
333.                                    ForeColor="Red" />
334.                            </td>
335.                        </tr>
336.                        <tr>
337.                            <td>Description</td>
338.                            <td>
339.                                <telerik:RadTextBox runat="server" ID="txtDescription" EmptyMessage="Description" />
340.                            </td>                           
341.                        </tr>
342.                        <tr>
343.                            <td>Number Of Seats</td>
344.                            <td>
345.                                <telerik:RadTextBox runat="server" ID="txtNumberOfSeats" EmptyMessage="Number of Seats" />
346.                            </td>
347.                        </tr>
348.                        <tr>
349.                            <td>Campus</td>
350.                            <td>
351.                                <telerik:RadComboBox ID="txtCampus" runat="server" EmptyMessage="Campus">
352.                                    <Items>
353.                                        <telerik:RadComboBoxItem Text="TE" Value="TE" />
354.                                        <telerik:RadComboBoxItem Text="SK" Value="SK" />
355.                                    </Items>
356.                                </telerik:RadComboBox>
357.                            </td>
358.                        </tr>
359.                        <tr>
360.                            <td>Building</td>
361.                            <td>
362.                                <telerik:RadTextBox runat="server" ID="txtBuilding" EmptyMessage="Building" />
363.                            </td>
364.                        </tr>
365.                        <tr>
366.                            <td>Floor</td>
367.                            <td>
368.                                <telerik:RadTextBox runat="server" ID="txtFloor" EmptyMessage="Floor" />
369.                            </td>
370.                        </tr>
371.                        <tr>
372.                            <td>Disabled Access Level</td>
373.                            <td>
374.                                <telerik:RadComboBox ID="txtDisabledAccessLevel" runat="server" EmptyMessage="Disabled Access Level">
375.                                    <Items>
376.                                        <telerik:RadComboBoxItem Text="Full" Value="Full" />
377.                                        <telerik:RadComboBoxItem Text="Partial" Value="Partial" />
378.                                        <telerik:RadComboBoxItem Text="No" Value="No" />
379.                                    </Items>
380.                                </telerik:RadComboBox>
381.                            </td>
382.                        </tr>
383.                        <tr>
384.                            <td>Type</td>
385.                            <td>
386.                                <telerik:RadComboBox ID="txtType" runat="server" EmptyMessage="Type">
387.                                    <Items>
388.                                        <telerik:RadComboBoxItem Text="Classroom" Value="Classroom" />
389.                                        <telerik:RadComboBoxItem Text="Computer Lab" Value="Computer Lab" />
390.                                        <telerik:RadComboBoxItem Text="Lab" Value="Lab" />
391.                                        <telerik:RadComboBoxItem Text="LH" Value="LH" />
392.                                    </Items>
393.                                </telerik:RadComboBox>
394.                            </td>
395.                        </tr>
396.                        <tr>
397.                            <td>Working State</td>
398.                            <td>
399.                                <asp:CheckBox runat="server" ID="txtWorkingState" />
400.                            </td>
401.                        </tr>
402.                        <tr>
403.                            <td>State Description</td>
404.                            <td>
405.                                <telerik:RadTextBox runat="server" ID="txtStateDescription" EmptyMessage="State Description" />
406.                            </td>
407.                        </tr>
408.                        <tr>
409.                            <td>Energy Efficiency</td>
410.                            <td>
411.                                <telerik:RadTextBox runat="server" ID="txtEnergyEfficiency" EmptyMessage="Energy Efficiency" />
412.                            </td>
413.                        </tr>
414.                        <tr>
415.                            <td>Longitude</td>
416.                            <td>
417.                                <telerik:RadTextBox runat="server" ID="txtLongitude" EmptyMessage="Longitude" />
418.                            </td>
419.                        </tr>
420.                        <tr>
421.                            <td>Latitude</td>
422.                            <td>
423.                                <telerik:RadTextBox runat="server" ID="txtLatitude" EmptyMessage="Latitude" />
424.                            </td>
425.                        </tr>
426.                        <tr>
427.                            <td>GMap Coordinates</td>
428.                            <td>
429.                                <telerik:RadTextBox runat="server" ID="txtGMapCoordinates" EmptyMessage="GMap Coordinates" />
430.                            </td>
431.                        </tr>
432.                    </table>
433.                    <hr class="lineSeparator" style="margin: 12px 0 12px 0" />
434.                    <telerik:RadButton ID="SaveRoom" runat="server" Text="Save Changes"
435.                        Width="100px" OnClientClicking="saveClassroom" UseSubmitBehavior="false" />
436.                    <telerik:RadButton ID="CancelRoom" runat="server" Text="Cancel"
437.                        Width="100px" OnClientClicking="cancelClassroom" UseSubmitBehavior="false" />
438.                </div>
439.            </ContentTemplate>
440.        </telerik:RadWindow>
441. 
442.    </form>
443.</body>
444.</html>

Ahmed
Top achievements
Rank 1
 asked on 09 Jun 2015
4 answers
322 views
Hi,

I have a master page with a RadAjaxPanel wrapped around the ContentPlaceHolder.
This works well for most of my pages with the RadAjaxLoadingPanel popping up as expected and disappearing when the request completes.

My issue occurs when I download a file to the browser using the following sequence of code: (*** Code updated 13dec2012 ***)

Response.TransmitFile(path + Session["Attachment"].ToString());
Response.AddHeader("Content-Disposition", "attachment; filename=" + Session["Attachment"].ToString().Replace(" ", "_"));
Response.ContentType = "application/octet-stream";

The above code is actually in a separate page from the one on which the initial request was launched.  I do a Response.Redirect to get to this second page (which is not displayed, but just performs the above code in its Page_Load event).

The document is successfully downloaded to the browser, but the RadAjaxLoadingPanel remains visible.
Is there something I should be doing to make the loading panel aware that the request is complete?
I have tried using Response.End() but this causes an error.

Once again, the loading panel is working fine for any other type of requests; it's only the document download that causes the problem.

Any suggestions would be greatly appreciated.

Thanks in advance.

Jim
Angel Petrov
Telerik team
 answered on 09 Jun 2015
4 answers
241 views

Hello, 

I am trying to implement RadListView similar to this ListView - DataGrouping Demo. But I got very strange behaviour on page changes. I've set PageSize="5" in DataPager.

  • Page 1: shows (5) items from 1 - 5 (Correct)
  • Page 2: shows (10) items from 6 - 15 (Incorrect. Extra 5 items)
  • Page 3: shows (15) items from 11 - 25 (Even worse. Extra 5 new items and 5 previous items. 11 to 15 was already shown on page 2)
  • Page 4: shows (20) items from 16 - 35 (I've no idea)
  • Page 5: shows (20) items from 21 - 40
  • Page 6: shows (15) items from 26 - 40 (Reduced 5 items. All duplicated records from previous pages)
  • Page 7: shows (10) items from 31 - 40 (Reduced 5 more items. All duplicated records from previous pages)
  • Page 8: shows (5) items from 36 - 40 (Reduced 5 more items. All duplicated records from previous pages)
  • Page 9: shows (5) items from next group
  • Same Pattern ...

I am not sure my markup have problem or my data have. You can see​ my sample code that will create above result below. I also attached screen shots for faster reference.

Please help and thanks in advanced.

Sample.aspx.cs

protected void RadListView1_NeedDataSource(object sender, Telerik.Web.UI.RadListViewNeedDataSourceEventArgs e)
{
    RadListView1.DataSource = PrepareData();
}
 
private DataTable PrepareData()
{
    DataTable l_Table = new DataTable();
    l_Table.Columns.Add("ID");
    l_Table.Columns.Add("Code");
    l_Table.Columns.Add("Group");
    l_Table.Columns.Add("PIN");
 
    l_Table.Rows.Add(new object[] { 1, "A10001", "A", 8096 });
    l_Table.Rows.Add(new object[] { 2, "A10002", "A", 3029 });
    l_Table.Rows.Add(new object[] { 3, "A10003", "A", 9427 });
    l_Table.Rows.Add(new object[] { 4, "A10004", "A", 8792 });
    l_Table.Rows.Add(new object[] { 5, "A10005", "A", 7166 });
    l_Table.Rows.Add(new object[] { 6, "A10006", "A", 1002 });
    l_Table.Rows.Add(new object[] { 7, "A10007", "A", 4989 });
    l_Table.Rows.Add(new object[] { 8, "A10008", "A", 8108 });
    l_Table.Rows.Add(new object[] { 9, "A10009", "A", 8547 });
    l_Table.Rows.Add(new object[] { 10, "A10010", "A", 3651 });
    l_Table.Rows.Add(new object[] { 11, "A10011", "A", 2418 });
    l_Table.Rows.Add(new object[] { 12, "A10012", "A", 7482 });
    l_Table.Rows.Add(new object[] { 13, "A10013", "A", 2696 });
    l_Table.Rows.Add(new object[] { 14, "A10014", "A", 7149 });
    l_Table.Rows.Add(new object[] { 15, "A10015", "A", 8167 });
    l_Table.Rows.Add(new object[] { 16, "A10016", "A", 1995 });
    l_Table.Rows.Add(new object[] { 17, "A10017", "A", 4006 });
    l_Table.Rows.Add(new object[] { 18, "A10018", "A", 7834 });
    l_Table.Rows.Add(new object[] { 19, "A10019", "A", 6419 });
    l_Table.Rows.Add(new object[] { 20, "A10020", "A", 1864 });
    l_Table.Rows.Add(new object[] { 21, "A10021", "A", 2777 });
    l_Table.Rows.Add(new object[] { 22, "A10022", "A", 7167 });
    l_Table.Rows.Add(new object[] { 23, "A10023", "A", 6995 });
    l_Table.Rows.Add(new object[] { 24, "A10024", "A", 7136 });
    l_Table.Rows.Add(new object[] { 25, "A10025", "A", 2612 });
    l_Table.Rows.Add(new object[] { 26, "A10026", "A", 3543 });
    l_Table.Rows.Add(new object[] { 27, "A10027", "A", 3262 });
    l_Table.Rows.Add(new object[] { 28, "A10028", "A", 5829 });
    l_Table.Rows.Add(new object[] { 29, "A10029", "A", 3409 });
    l_Table.Rows.Add(new object[] { 30, "A10030", "A", 6428 });
    l_Table.Rows.Add(new object[] { 31, "A10031", "A", 2510 });
    l_Table.Rows.Add(new object[] { 32, "A10032", "A", 3874 });
    l_Table.Rows.Add(new object[] { 33, "A10033", "A", 6840 });
    l_Table.Rows.Add(new object[] { 34, "A10034", "A", 8446 });
    l_Table.Rows.Add(new object[] { 35, "A10035", "A", 6599 });
    l_Table.Rows.Add(new object[] { 36, "A10036", "A", 9215 });
    l_Table.Rows.Add(new object[] { 37, "A10037", "A", 8140 });
    l_Table.Rows.Add(new object[] { 38, "A10038", "A", 9804 });
    l_Table.Rows.Add(new object[] { 39, "A10039", "A", 9179 });
    l_Table.Rows.Add(new object[] { 40, "A10040", "A", 7315 });
    l_Table.Rows.Add(new object[] { 41, "B10001", "B", 9307 });
    l_Table.Rows.Add(new object[] { 42, "B10002", "B", 6832 });
    l_Table.Rows.Add(new object[] { 43, "B10003", "B", 2386 });
    l_Table.Rows.Add(new object[] { 44, "B10004", "B", 2283 });
    l_Table.Rows.Add(new object[] { 45, "B10005", "B", 3295 });
    l_Table.Rows.Add(new object[] { 46, "B10006", "B", 6314 });
    l_Table.Rows.Add(new object[] { 47, "B10007", "B", 1433 });
    l_Table.Rows.Add(new object[] { 48, "B10008", "B", 2250 });
    l_Table.Rows.Add(new object[] { 49, "B10009", "B", 1658 });
    l_Table.Rows.Add(new object[] { 50, "B10010", "B", 4967 });
    l_Table.Rows.Add(new object[] { 51, "B10011", "B", 6391 });
    l_Table.Rows.Add(new object[] { 52, "B10012", "B", 6217 });
    l_Table.Rows.Add(new object[] { 53, "B10013", "B", 5478 });
    l_Table.Rows.Add(new object[] { 54, "B10014", "B", 2037 });
    l_Table.Rows.Add(new object[] { 55, "B10015", "B", 3961 });
    l_Table.Rows.Add(new object[] { 56, "B10016", "B", 8989 });
    l_Table.Rows.Add(new object[] { 81, "C10001", "C", 5405 });
    l_Table.Rows.Add(new object[] { 82, "C10002", "C", 9161 });
    l_Table.Rows.Add(new object[] { 83, "C10003", "C", 7635 });
    l_Table.Rows.Add(new object[] { 84, "C10004", "C", 4567 });
    l_Table.Rows.Add(new object[] { 85, "C10005", "C", 1197 });
    l_Table.Rows.Add(new object[] { 86, "C10006", "C", 3379 });
    l_Table.Rows.Add(new object[] { 87, "C10007", "C", 4782 });
    l_Table.Rows.Add(new object[] { 88, "C10008", "C", 5650 });
    l_Table.Rows.Add(new object[] { 89, "C10009", "C", 7737 });
    l_Table.Rows.Add(new object[] { 90, "C10010", "C", 7174 });
    l_Table.Rows.Add(new object[] { 91, "C10011", "C", 8038 });
    l_Table.Rows.Add(new object[] { 92, "C10012", "C", 1445 });
    l_Table.Rows.Add(new object[] { 93, "C10013", "C", 9798 });
    l_Table.Rows.Add(new object[] { 94, "C10014", "C", 6405 });
    l_Table.Rows.Add(new object[] { 95, "C10015", "C", 2384 });
    l_Table.Rows.Add(new object[] { 96, "C10016", "C", 3403 });
    l_Table.Rows.Add(new object[] { 97, "C10017", "C", 6483 });
    l_Table.Rows.Add(new object[] { 98, "C10018", "C", 8907 });
    l_Table.Rows.Add(new object[] { 99, "C10019", "C", 5507 });
    l_Table.Rows.Add(new object[] { 100, "C10020", "C", 4660 });
    l_Table.Rows.Add(new object[] { 101, "C10021", "C", 9608 });
    l_Table.Rows.Add(new object[] { 102, "C10022", "C", 5091 });
    l_Table.Rows.Add(new object[] { 103, "C10023", "C", 7184 });
    l_Table.Rows.Add(new object[] { 127, "D10001", "D", 5775 });
    l_Table.Rows.Add(new object[] { 128, "D10002", "D", 6340 });
    l_Table.Rows.Add(new object[] { 129, "D10003", "D", 1671 });
    l_Table.Rows.Add(new object[] { 130, "D10004", "D", 2434 });
    l_Table.Rows.Add(new object[] { 131, "D10005", "D", 2740 });
    l_Table.Rows.Add(new object[] { 132, "D10006", "D", 5798 });
    l_Table.Rows.Add(new object[] { 133, "D10007", "D", 5826 });
    l_Table.Rows.Add(new object[] { 134, "D10008", "D", 6959 });
    l_Table.Rows.Add(new object[] { 135, "D10009", "D", 2469 });
    l_Table.Rows.Add(new object[] { 136, "D10010", "D", 6864 });
    l_Table.Rows.Add(new object[] { 137, "D10011", "D", 8379 });
    l_Table.Rows.Add(new object[] { 138, "D10012", "D", 8301 });
    l_Table.Rows.Add(new object[] { 139, "D10013", "D", 7469 });
    l_Table.Rows.Add(new object[] { 140, "D10014", "D", 2079 });
    l_Table.Rows.Add(new object[] { 141, "D10015", "D", 5101 });
    l_Table.Rows.Add(new object[] { 142, "D10016", "D", 9003 });
    l_Table.Rows.Add(new object[] { 143, "D10017", "D", 7630 });
    l_Table.Rows.Add(new object[] { 144, "D10018", "D", 4189 });
 
    return l_Table;
}

Sample.aspx

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
    <telerik:RadListView ID="RadListView1" runat="server" ItemPlaceholderID="DataGroupPlaceHolder3"
        OnNeedDataSource="RadListView1_NeedDataSource"
        AllowPaging="True" GroupAggregatesScope="AllItems" DataKeyNames="ID">
        <ItemTemplate>
            <div style="display: inline-block; background-color: white; padding: 10px; margin: 10px;">
                <div>
                    <b>ID: </b>
                    <%#Eval("ID")%>
                </div>
                <div class="category model">
                    <b>Code: </b>
                    <%#Eval("Code")%>
                </div>
                <div class="category">
                    <b>PIN: </b>
                    <%#Eval("PIN")%>
                </div>
            </div>
        </ItemTemplate>
        <LayoutTemplate>
            <asp:Panel ID="DataGroupPlaceHolder2" runat="server">
            </asp:Panel>
            <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListView1"
                Skin="Silk" PageSize="5" class="clearfix">
                <Fields>
                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" FirstButtonText="First" PrevButtonText="Prev"></telerik:RadDataPagerButtonField>
                    <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="10"></telerik:RadDataPagerButtonField>
                    <telerik:RadDataPagerButtonField FieldType="NextLast" NextButtonText="Next" LastButtonText="Last"></telerik:RadDataPagerButtonField>
                </Fields>
            </telerik:RadDataPager>
        </LayoutTemplate>
        <GroupSeparatorTemplate>
        </GroupSeparatorTemplate>
        <DataGroups>
            <telerik:ListViewDataGroup GroupField="Group" DataGroupPlaceholderID="DataGroupPlaceHolder2"
                SortOrder="Ascending">
                <DataGroupTemplate>
                    <asp:Panel runat="server" ID="Panel3" GroupingText='<%# "Group:<b>" + (Container as RadListViewDataGroupItem).DataGroupKey + "</b>"%> '>
                        <asp:PlaceHolder runat="server" ID="DataGroupPlaceHolder3"></asp:PlaceHolder>
                    </asp:Panel>
                </DataGroupTemplate>
                <GroupAggregates>
                    <telerik:ListViewDataGroupAggregate Aggregate="First" DataField="Group" />
                </GroupAggregates>
            </telerik:ListViewDataGroup>
        </DataGroups>
    </telerik:RadListView>
</telerik:RadAjaxPanel>     

Robin
Top achievements
Rank 2
 answered on 09 Jun 2015
1 answer
91 views

Hi all,

 I'm trying to validate some fields in a FormTemplate inside of a RadGrid and everything is working fine except for one problem. Whenever the submit button is pressed, an async postback is triggered and after postback the validators are triggered. Functionality wise it works fine, the update/insert isn't persisted, but I don't understand why the post-back is occurring (and causing the ajax loading panel to trigger) instead of the validation occurring all on the client side. Is it possible to prevent the post-back? Form is below and the page is using RadAjaxManager for async. Thanks.

<EditFormSettings EditFormType="Template" CaptionFormatString="Create/Edit Broker" PopUpSettings-Modal="True">
    <FormTemplate>
        <div class="form-template">
            <table>
                <tr>
                    <td>Name</td>
                    <td>
                        <asp:TextBox ID="tbName" runat="server" Text='<%# Bind("NAME") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="tbName" ValidationGroup="form" ErrorMessage="Required!" Display="Dynamic" CssClass="required" />
                    </td>
                </tr>
                <tr>
                    <td>Broker</td>
                    <td>
                        <icl:KeyNameDropDown runat="server" ID="ddlBroker" AppendDataBoundItems="True" />
                        <asp:RequiredFieldValidator ID="rfvBroker" runat="server" InitialValue="0" ControlToValidate="ddlBroker" ValidationGroup="form" ErrorMessage="Required!" Display="Dynamic" CssClass="required" />
                    </td>
                </tr>
                <tr>
                    <td>Is Active</td>
                    <td>
                        <asp:CheckBox ID="cbActive" runat="server" Checked='<%#  Eval("ISACTIVE").ToString().Equals("True") %>' />
                    </td>
                </tr>
            </table>
 
            <asp:LinkButton ID="btnUpdate" runat="server"
                Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' ValidationGroup="form" />
        </div>
    </FormTemplate>
</EditFormSettings>

Eyup
Telerik team
 answered on 09 Jun 2015
0 answers
188 views
Model:-
public class PurchaseOrder
{
 
public string PlanedDate { get; set; }
public DateTime? PlanedDateTime { get; set; }
public string PlanedDateString { get; set; }
 
public string CompletionDate { get; set; }
 
        [Display(Name = "Completion Date")]
        public DateTime? CompletionDateTime { get; set; }
        public string CompletionDateString { get; set; }
 
 
 
}
 
 
 
Controller:-
private void ModifyFilters(IEnumerable<IFilterDescriptor> filters)
        {
            if (filters.Any())
            {
                foreach (var filter in filters)
                {
                    var descriptor = filter as FilterDescriptor;
 
                    if (descriptor != null && (descriptor.Member == "PlanedDateTime" || descriptor.Member == "ModifiedDateTime" || descriptor.Member == "CompletionDateTime" ||
                    descriptor.Member == "CharterDateTime" || descriptor.Member == "UpLiftDateTime" || descriptor.Member == "PurchaseOrderDateTime" || descriptor.Member == "InvoiceSubmittedDateTime"))
                    {
                         descriptor.Value = Convert.ToDateTime(descriptor.Value.ToString().Trim()).ToShortDateString();
                        //Not Equal Op  We send Only Date
                    }
  if (descriptor != null && descriptor.Member == "PlanedDateTime")
                    {
                        descriptor.Member = "PlanedDate";
                        
                    else if (filter is CompositeFilterDescriptor)
                    {
                        ModifyFilters(((CompositeFilterDescriptor)filter).FilterDescriptors);
                    }
                }
            }
        }

 

 

Controller:-
  public ActionResult PurchaseCellarOrder_Read([DataSourceRequest] DataSourceRequest request, FormCollection formcol)
        {
         XrmServiceContext xrm = new XrmServiceContext(CrmService.Service);
            var totalRecordCount = 0;
 
            Guid ParentCustomerId = xrm.ContactSet.SingleOrDefault(i => i.Id == new Guid(HttpContext.User.Identity.Name)).ParentCustomerId != null ? xrm.ContactSet.SingleOrDefault(i => i.Id == new Guid(HttpContext.User.Identity.Name)).ParentCustomerId.Id : Guid.Empty;
          List<PurchaseOrderModel> purchaseOrderList = new List<PurchaseOrderModel>();
            if (ParentCustomerId != Guid.Empty)
            {
                ModifyFilters(request.Filters);
                   po.PlanedDate = entity.Attributes.Contains("tcrmb_planneddate") ? (TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(entity.Attributes["tcrmb_planneddate"].ToString()), timezone)).ToShortDateString().Trim() : "--";
                    po.PlanedDateTime = entity.Attributes.Contains("tcrmb_planneddate") ? (TimeZoneInfo.ConvertTimeFromUtc(Convert.ToDateTime(entity.Attributes["tcrmb_planneddate"].ToString()), timezone)).Date : (DateTime?)null;
                    po.PlanedDateString = entity.Attributes.Contains("tcrmb_planneddate") ? entity.FormattedValues["tcrmb_planneddate"] : "--";
   purchaseOrderList.Add(po);
             }
      var page = request.Page;
         
       request.Page = 1;
 
            var result = purchaseOrderList.ToDataSourceResult(request);
            if (totalRecordCount <= request.PageSize)
            {
                result.Total = purchaseOrderList.Count;
            }
            else
            {
                result.Total = totalRecordCount;
            }
 
            return Json(result);
}
View:-
 
 
@model SupplierPortal.Models.PurchaseOrderModel
@using Kendo.Mvc.UI
 
@(Html.Kendo().Grid<SupplierPortal.Models.PurchaseOrderModel>().Name("PurchaseCellarOrders")
                        .DataSource(ds => ds.Ajax()
                            .Read(r => r.Action("PurchaseCellarOrder_Read", "PurchaseOrder"))
                        .Model(m => m.Id(p => p.PurchaseOrderId))
                        .ServerOperation(true)
                         .Sort(sort => sort.Add(po=>po.ModifiedDateTime).Descending())        
                         .PageSize(50).Events(e => e.RequestEnd("requestEnd"))
                        )
                        .Columns(cols =>
                        {
                            cols.Bound(con => con.PurchaseOrderId).Title("<input type='checkbox' id='checkAll'/>").Filterable(false).Sortable(false)
                                .ClientTemplate("<input type='checkbox'  #=PurchaseOrderId ? checked='':'' # class='check-box' onchange='SetCheckBOX(this)'/>");
 
                            cols.Bound(con => con.PHCNumber).Title("PHC");
                            cols.Bound(con => con.PubName);
                            cols.Bound(con => con.PostCode);
                            cols.Bound(con => con.CaseNumber).Visible(false);
                            cols.Bound(con => con.PONumber).Title("Purchase Order Number");
                            cols.Bound(con => con.CharterDate).Format("{0:dd/MM/yyyy}").Visible(false);
                            cols.Bound(con => con.CharterDateTime).ClientTemplate("#=CharterDateString #");
                            cols.Bound(con => con.PlanedDate).Format("{0:dd/MM/yyyy}").Visible(false);
                            cols.Bound(con => con.PlanedDateTime).ClientTemplate("#=PlanedDateString #").Title("Planned Date");
                            cols.Bound(con => con.CompletionDate).Format("{0:dd/MM/yyyy}").Visible(false);
                            cols.Bound(con => con.CompletionDateTime).Title("Work Done Date").ClientTemplate("#=CompletionDateString #");
                            cols.Bound(con => con.Status).Filterable(false).Sortable(false).Visible(false);
                            cols.Bound(con => con.StatusReason).Sortable(false).Title("Status Reason");
                            cols.Bound(con => con.Classification).Width(120);
                            cols.Bound(con => con.ModifiedDate).Format("{0:dd/MM/yyyy}").Visible(false);
                            cols.Bound(con => con.ModifiedDateTime).ClientTemplate("#=ModifiedDateString #");
                            cols.Bound(con => con.InvoiceSubmittedDate).Format("{0:dd/MM/yyyy}").Visible(false);
                            cols.Bound(con => con.InvoiceSubmittedDateTime).Title("Invoice Submitted").ClientTemplate("#=InvoiceSubmittedDateString #");
                            cols.Bound(con => con.OnHold);
                            cols.Bound(con => con.OnHoldBool).Visible(false);
 
                            //cols.Bound(con => con.PONumber);
 
 
                        })
                                                 .Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
        //.Events(events => events.DataBound("onDataBound"))
                                                 .Pageable()
                                                 .Sortable()
                                                 .Filterable()
 
    )

 

 here I got Filter Binding issues...when Give 28/05/2014 in Planned Date 28/05/2015  "On or Before"  in Controller Side I got Full record But it Excute  the Following line

 var result = purchaseOrderList.ToDataSourceResult(request); 

Some Of the Records are missing ....I unable to find where the ..issues 

I attach Following image First one is webportal one...in this we missing 2  records of planned date 08/05/2015 and 07/05/2015 but it exist in Controller At the time of binding...It Show in second image .....help me here ...where is the  issues.

 

 

Sairam
Top achievements
Rank 1
 asked on 09 Jun 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?