Hi,
I have an aspx page which I am showing in a radwindow using navigate url. Now, the issue is the window is not auto sizing correctly, still there are scroll bars, both horizntal and vertical.
1. The solution for this is just wrap the aspx page in a div tag and the autosize will work perfectly fine. like this
<form>
<div>
whole page content
</div>
</form>
But after doing this, the page on postback losts all the controls view and the window is left with only the title. Nothing on form after postback and window resizes to just the title bar.
Page is working perfectly fine if I dont wrap it in the <div> tags and autosize does not work.
Any suggestions?
Thanks in advance,
Jawwad
I am having an issue where RadToolTipManager does not come up in Chrome on IOS. Nothing happens when I click on a button that triggers the action for displaying the tool tip.
I have the following in my markup page:
<telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" ShowEvent="OnClick"
RelativeTo="BrowserWindow" Position="BottomLeft" Width="600px" Height="300px"
Animation="Resize" HideEvent="LeaveTargetAndToolTip" Skin="Default" OnAjaxUpdate="OnAjaxUpdate"
RenderInPageRoot="true" ManualClose="true" Modal="false">
</telerik:RadToolTipManager>
In code behind, I have this:
private void UpdateToolTip(string elementID, UpdatePanel panel)
{
try
{
Control ctrl = Page.LoadControl("../UserControls/PriceBreak.ascx");
panel.ContentTemplateContainer.Controls.Add(ctrl);
...
....
}
Thank you,
Alex
Hi,
I am using RadImageGallery to show the dynamic charts through the URL. I want Previous and Next arrow image should show always. But once i click right or left arrow then after postback arrow image not showing in IE. But in chrome arrow showing properly.
Telerik Version: 2015.2.623.40
Please find the attached gif file. Please help me to fix this issues in IE.
My code:
<telerik:RadImageGallery runat="server" ID="RadImgGal" PreventDefaultGestures="false" Skin="Black" Width="100%" Height="100%">
<Items>
</Items>
<ThumbnailsAreaSettings Mode="ImageSliderPreview" />
<ImageAreaSettings ShowNextPrevImageButtons="true" NavigationMode="Zone" />
<ToolbarSettings ShowSlideshowButton="false" Position="Bottom" />
<ClientSettings>
<KeyboardNavigationSettings>
<Shortcuts>
<telerik:ImageGalleryShortcut Command="Focus" Enabled="False" Key="Y" Modifiers="Ctrl" />
<telerik:ImageGalleryShortcut Command="Prev" Enabled="False" Key="LeftArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Next" Enabled="False" Key="RightArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Up" Enabled="False" Key="UpArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Down" Enabled="False" Key="DownArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="MoveToFirst" Enabled="False" Key="Home" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="MoveToLast" Enabled="False" Key="End" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="PrevView" Enabled="False" Key="LeftArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="NextView" Enabled="False" Key="RightArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="PrevView" Enabled="False" Key="UpArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="NextView" Enabled="False" Key="DownArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="Select" Enabled="False" Key="Enter" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Close" Enabled="False" Key="Escape" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleSlideshow" Enabled="False" Key="Space" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleFullScreen" Enabled="False" Key="F" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleThumbnails" Enabled="False" Key="T" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="PrevPage" Enabled="False" Key="PageDown" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="NextPage" Enabled="False" Key="PageUp" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Focus" Enabled="False" Key="Y" Modifiers="Ctrl" />
<telerik:ImageGalleryShortcut Command="Prev" Enabled="False" Key="LeftArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Next" Enabled="False" Key="RightArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Up" Enabled="False" Key="UpArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Down" Enabled="False" Key="DownArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="MoveToFirst" Enabled="False" Key="Home" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="MoveToLast" Enabled="False" Key="End" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="PrevView" Enabled="False" Key="LeftArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="NextView" Enabled="False" Key="RightArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="PrevView" Enabled="False" Key="UpArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="NextView" Enabled="False" Key="DownArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="Select" Enabled="False" Key="Enter" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Close" Enabled="False" Key="Escape" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleSlideshow" Enabled="False" Key="Space" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleFullScreen" Enabled="False" Key="F" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleThumbnails" Enabled="False" Key="T" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="PrevPage" Enabled="False" Key="PageDown" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="NextPage" Enabled="False" Key="PageUp" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Focus" Enabled="True" Key="Y" Modifiers="Ctrl" />
<telerik:ImageGalleryShortcut Command="Prev" Enabled="True" Key="LeftArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Next" Enabled="True" Key="RightArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Up" Enabled="True" Key="UpArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Down" Enabled="True" Key="DownArrow" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="MoveToFirst" Enabled="True" Key="Home" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="MoveToLast" Enabled="True" Key="End" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="PrevView" Enabled="True" Key="LeftArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="NextView" Enabled="True" Key="RightArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="PrevView" Enabled="True" Key="UpArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="NextView" Enabled="True" Key="DownArrow" Modifiers="Alt" />
<telerik:ImageGalleryShortcut Command="Select" Enabled="True" Key="Enter" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="Close" Enabled="True" Key="Escape" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleSlideshow" Enabled="True" Key="Space" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleFullScreen" Enabled="True" Key="F" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="ToggleThumbnails" Enabled="True" Key="T" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="PrevPage" Enabled="True" Key="PageDown" Modifiers="None" />
<telerik:ImageGalleryShortcut Command="NextPage" Enabled="True" Key="PageUp" Modifiers="None" />
</Shortcuts>
</KeyboardNavigationSettings>
<AnimationSettings SlideshowSlideDuration="3000">
<NextImagesAnimation Type="Blocks" Easing="EaseOutSine" Speed="2500" />
<PrevImagesAnimation Type="Blocks" Easing="EaseOutSine" Speed="2500" />
</AnimationSettings>
</ClientSettings>
<PagerStyle AlwaysVisible="True" />
</telerik:RadImageGallery>
Hello Expert,
I am using the RangeBarChart to visualize the data. Its the very important feature in our application.
So I have to customize the header text of YAxis(Horizontal) in Range Bar Chart of this demo.
http://demos.telerik.com/aspnet-ajax/htmlchart/examples/charttypes/range-bar-chart/defaultcs.aspx
My application scenario will be same as attached screen.
How can I customize the header text of chart? Any expert please.
Regards
Aminul
Hi,
We are using Telerik AJAX UI control version "2015.3.930.45" in our project. We are using Telerik Image editor in our application and we are facing some issue with the "Save" and "Export" in case if we provide the absolute path to the image editor. But for the images which are in the root of the website itself both of the functionality is working fine. In our case, we can NOT keep the image in the website itself because of the load balancer. So we are assigning path from a separate file server.
Here is the sample code which we are using in our project:
<telerik:RadImageEditor ID="TelerikRadImageEditor" runat="server" ImageUrl="https://<servername>/<folderName>/<fileName>.<extension>" >
</telerik:RadImageEditor>
Save image functionality issue:
Suppose, the file which was shown in the image editor is ".jpg" and user click on "Save Image" icon from the tool bar. After that user select “Download Image” option in “Save Dialog popup” and click “Ok” button then we observer that the saved image have the extension of ".png" even though the file extension which we have given to Image Editor was ".jpg". We have tested the same with the ".jpeg" and ".bmp" but the image which is download via download popup have the ".png".
We don't know why the image is saving with extension ".PNG". This should be saved with the same extension we have given in the image URL.
Do let us know whether its a actual functionality provided by Image editor or its a bug. Also, let us know how we can resolve this issue.
FYI, the said functionality working fine for the local image kept within the website with relative URL.
Export image functionality issue:
When user click on "Export" for the image with the ImageURL from the separate file server then system throws the error and export functionality gets failed. The error message we getting is "not a valid virtual path".
Please help us out to resolve these two issues.
with regards
Abhishek Goel
Hello,
After selecting a file in the 'File Upload' dialog, I get an alert with the following string: vData not a String FixMe!!object ({})
I'm not sure what this means and it's happening for all files, this occurs only in Aurora 8.0
After digging a little bit more into the issue I have found this alert comes from the file MicrosoftAjax.js. Would it be possible to get a fixed applied to prevent this alert from showing up?
Regards,
Rafael
Hi,
We have recently upgraded our Telerik version and are now experiencing an issue with the ClientCallBack function, does anyone have any resolution?
Our code is:
<
telerik:RadWindowManager
ID
=
"WindowManager"
runat
=
"server"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"DateChoice"
runat
=
"server"
Behaviors
=
"Close"
ClientCallBackFunction
=
"clientCallback"
EnableEmbeddedSkins
=
"false"
Width
=
"315px"
Height
=
"285px"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
Hello,
I have master and detail table, both having custom paging option set to true and viewstate for page as well as grid is set to false.
The problems are -
1. If I expand row to see the details then it do not collaps. If I expand another row then the row expanded earlier row will collaps. The same row can not be collapsed once expanded.
2. I am binding sales order data using a stored proc. The stored proc extracts no of orders set as per the page size i.e if page size is 10 the proc returns only 10 orders from the table. If page size is 15 then only 15 orders are returned. So If I select page 2 and my page size is 15 then order no 16 to 30 would be extracted from the table and returned by the stored proc. This behaviour works great for main grid table where order header info is displayed. (I have more than 2000K orders in the order master.) But if I try to use the same technique for detail table it fails. E.g. - Order no 2 has 500 items into it. I want to display 50 items per page of detail table. The initial display is correct i.e the detail table displays 50 items on page 1 and shows count of 10 pages. Then if I click on the page 2 of detail table, rather than showing items from 51 to 100 entire grid (main grid) is rebound. So I am not able to jump on page 2 of any order detail.
Pls help...
Following is the code-
aspx -
<%@ Page Title="Sales Order" Language="C#" enableViewState="false" ViewStateMode="Disabled" MasterPageFile="~/Erp.Master" AutoEventWireup="true" CodeBehind="SalesOrderEntry.aspx.cs" Inherits="ErpWebApplication.TransactionData.SalesOrderEntry" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGridSalesOrder">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGridSalesOrder" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
<%--<Services>
<asp:ServiceReference Path="~/Services/FetchData.svc" />
</Services>--%>
</asp:ScriptManagerProxy>
<br />
<div id="DivMessage" runat="server" >
<asp:Label ID="LblMessage" runat="server" Text=""></asp:Label>
</div>
<div class="clearfix"></div>
<%--<br />--%>
<fieldset class="border-inset">
<legend class="caption-for-selected-page-header"> Sales Order </legend>
<div id="DivDataDisplayInGrid" runat="server" class="col-md-16" style="background-color:transparent;">
<div id="DivButtonTop" class="col-md-16" runat="server">
<fieldset class="border-for-div text-align-Left">
<legend class="caption-for-div"> Action </legend>
<telerik:RadButton ID="btnAddTop" runat="server" Text="Add" RenderMode="Auto" ToolTip="Add SO" OnClick="btnAddTop_Click" CausesValidation="False">
<Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
<telerik:RadButton ID="btnEditTop" runat="server" Text="Edit" RenderMode="Auto" ToolTip="Edit SO" OnClick="btnEditTop_Click" CausesValidation="False" >
<Icon PrimaryIconCssClass="rbEdit" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
<telerik:RadButton ID="btnSaveTop" runat="server" Text="Save" RenderMode="Auto" ToolTip="Save/Update SO" OnClick="btnSaveTop_Click" OnClientClicking="SaveConfirm">
<Icon PrimaryIconCssClass="rbSave" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
<telerik:RadButton ID="btnAbortTop" runat="server" Text="Abort" RenderMode="Auto" ToolTip="Abort" OnClick="btnAbortTop_Click" OnClientClicking="SaveConfirm" CausesValidation="False">
<Icon PrimaryIconCssClass="rbCancel" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
<telerik:RadButton ID="btnRefreshTop" runat="server" Text="Refresh" RenderMode="Auto" ToolTip="Refresh" OnClick="btnRefreshTop_Click" CausesValidation="False">
<Icon PrimaryIconCssClass="rbRefresh" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
</fieldset>
</div>
<div class="clearfix"></div>
<br />
<div id="DivGrid" class="col-md-16" runat="server">
<fieldset class="border-for-div">
<legend class="caption-for-div"> Sales Order List </legend>
<%-- <telerik:RadSearchBox ID="SearchRegionName" EmptyMessage="Search Region" Width="100%" runat="server" DataContextKeyField="RegionName" TabIndex="1" OnSearch="SearchRegionName_Search" EnableAutoComplete="true" >
<WebServiceSettings Path="SalesOrder.aspx" Method="GetSearchBoxResults" />
</telerik:RadSearchBox>--%>
<telerik:RadGrid ID="RadGridSalesOrder" runat="server" EnableHeaderContextMenu="true" AllowFilteringByColumn="True" AutoPostBackOnFilter="true" EnableViewState="false"
AllowPaging="True" EnableLinqExpressions="false" AllowCustomPaging="true" AllowSorting="True" AutoGenerateColumns="False" RenderMode="Auto"
GroupPanelPosition="Top" ShowGroupPanel="false"
OnNeedDataSource="RadGridSalesOrder_NeedDataSource"
OnDetailTableDataBind="RadGridSalesOrder_DetailTableDataBind"
OnItemCommand="RadGridSalesOrder_ItemCommand"
OnPageIndexChanged="RadGridSalesOrder_PageIndexChanged"
OnSortCommand="RadGridSalesOrder_SortCommand"
OnPageSizeChanged="RadGridSalesOrder_PageSizeChanged" >
<ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="True" >
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowSelected="OnRowSelected" />
<%--<ClientEvents OnCommand="RadGrid1_Command"></ClientEvents>--%>
</ClientSettings>
<MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="SalesOrderId" AllowMultiColumnSorting="true" ClientDataKeyNames="SalesOrderId" Name="MasterTbl" EnableViewState="false" >
<CommandItemSettings ShowAddNewRecordButton="false" ShowCancelChangesButton="false" ShowExportToCsvButton ="false" ShowExportToExcelButton ="false" ShowExportToPdfButton ="false"
ShowExportToWordButton ="false" ShowSaveChangesButton ="false" />
<SortExpressions>
<telerik:GridSortExpression FieldName="SalesOrderId" SortOrder="Descending" />
</SortExpressions>
<DetailTables>
<telerik:GridTableView DataKeyNames="ItemCode" Name="OrderDetail" Width="100%" AllowCustomSorting="false" AllowCustomPaging="true" EnableViewState="false" AllowFilteringByColumn="false" PageSize="10" ShowFooter="true" AllowSorting="false" HierarchyLoadMode="ServerBind" HierarchyDefaultExpanded="true">
<SortExpressions>
<telerik:GridSortExpression FieldName="ItemCode" SortOrder="Ascending" />
</SortExpressions>
<Columns>
<telerik:GridBoundColumn HeaderText="Item Code" DataField="ItemCode" SortExpression="ItemCode" UniqueName="ItemCode" Groupable="False" AllowFiltering="false" Visible="True" FilterControlWidth="60%" >
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="10%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Item Name" DataField="ItemName" SortExpression="ItemName" UniqueName="ItemName" Groupable="False" AllowFiltering="false" Visible="True" FilterControlWidth="60%" FooterText ="Total : " >
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="30%" />
<HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="30%" />
<FooterStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="30%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Qty" DataField="OrderQty" Aggregate="Sum" SortExpression="OrderQty" UniqueName="OrderQty" Groupable="False" AllowFiltering="false" Visible="True" FilterControlWidth="60%" DataFormatString="{0:###0.00}" >
<ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="10%" />
<FooterStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="10%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Rate" DataField="Rate" SortExpression="Rate" UniqueName="Rate" Groupable="False" AllowFiltering="false" Visible="false" FilterControlWidth="60%" DataFormatString="{0:###0.00}">
<ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="10%" />
</telerik:GridBoundColumn>
<%--<telerik:GridBoundColumn HeaderText="Amount" DataField="Amount" SortExpression="Amount" UniqueName="Amount" Groupable="False" AllowFiltering="false" Visible="True" FilterControlWidth="60%" DataFormatString="{0:###0.00}">
<ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="10%" />
</telerik:GridBoundColumn>--%>
<telerik:GridCalculatedColumn HeaderText="Amount" UniqueName="Amount" DataType="System.Double" DataFields="OrderQty, Rate" Expression="{0}*{1}" FooterText="Total : " Aggregate="Sum" DataFormatString="{0:###0.00}">
<ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="10%" />
<FooterStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="10%" />
</telerik:GridCalculatedColumn>
<telerik:GridTemplateColumn HeaderText="Status" DataField ="IsActive" UniqueName="IsActive" Groupable="false" AllowSorting="false" AllowFiltering="false" Visible="true" >
<ItemTemplate>
<%# Boolean.Parse(Eval("IsActive").ToString()) ? "<font color='#006600'><b> Active</b></font>" : "<font color='#990000'><b>Inactive</b></font>" %>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="10%" />
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="10%" />
</telerik:GridTemplateColumn>
</Columns>
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
</telerik:GridTableView>
</DetailTables>
<Columns>
<%-- <telerik:GridClientSelectColumn Text="Edit" UniqueName="colRowSelect" Visible="False">
</telerik:GridClientSelectColumn>
<telerik:GridEditCommandColumn UniqueName="edtColumn" ButtonType="ImageButton">
</telerik:GridEditCommandColumn>--%>
<telerik:GridBoundColumn HeaderText="SO Id" DataField="SalesOrderId" SortExpression="SalesOrderId" UniqueName="SalesOrderId" Groupable="False" AllowFiltering="True" Visible="True" FilterControlWidth="60%" >
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="10%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="SO Date" DataField="SalesOrderDate" SortExpression="SalesOrderDate" UniqueName="SalesOrderDate" Groupable="true" AllowFiltering="True" Visible="True" FilterControlWidth="60%" DataFormatString="{0:dd/MM/yyyy}" >
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="10%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Party Name" DataField="PartyName" SortExpression="PartyName" UniqueName="PartyName" Groupable="True" AllowFiltering="True" Visible="True" FilterControlWidth="90%">
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="47%" />
<HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="47%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Party Ref No" DataField="PartyRefPONo" SortExpression="PartyRefPONo" UniqueName="PartyRefPONo" Groupable="false" AllowFiltering="True" Visible="True" FilterControlWidth="70%">
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="10%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Party Ref Date" DataField="PartyRefPODate" SortExpression="PartyRefPODate" UniqueName="PartyRefPODate" Groupable="false" AllowFiltering="True" Visible="True" FilterControlWidth="70%" DataFormatString="{0:dd/MM/yyyy}">
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="10%" />
<HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="10%" />
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Status" DataField ="IsActive" UniqueName="IsActive" Groupable="false" AllowSorting="false" AllowFiltering="false" Visible="true" >
<ItemTemplate>
<%# Boolean.Parse(Eval("IsActive").ToString()) ? "<font color='#006600'><b> Active</b></font>" : "<font color='#990000'><b>Inactive</b></font>" %>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="10%" />
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="10%" />
</telerik:GridTemplateColumn>
<%--<telerik:GridButtonColumn CommandName="Delete" Text="Deactivate" UniqueName="column" ButtonType="ImageButton" ConfirmText="Are you Sure ?" ConfirmTitle="Confirm" ShowSortIcon="False">
</telerik:GridButtonColumn>--%>
</Columns>
<CommandItemStyle HorizontalAlign="Left" />
</MasterTableView>
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
<FilterMenu CssClass="cssForFilterButton">
</FilterMenu>
<CommandItemStyle HorizontalAlign="Left" />
<FilterItemStyle HorizontalAlign="Left" />
<GroupingSettings ShowUnGroupButton = "false" />
</telerik:RadGrid>
</fieldset>
</div>
<div class="clearfix"></div>
<div id="DivDataForm" class="col-md-16" style="background-color:transparent;" runat="server">
<div id="DivRegionName" class="col-md-16">
<fieldset class="border-for-div">
<legend class="caption-for-div">Sales Order</legend>
<asp:HiddenField ID="hdnSalesOrderId" runat="server" Value="0" />
<asp:HiddenField ID="hdnVisibleDiv" runat="server" Value="DivGrid" />
<label class="MTIPLRadTextBoxLabel label-font-setting-small left-padding-5">Region Name :</label>
<asp:TextBox ID="TxtRegionName" runat="server" Width="100%" TabIndex="2" CausesValidation="True" placeholder="Enter Region Name">
</asp:TextBox>
<asp:RequiredFieldValidator ID="ReqRegion" runat="server" ErrorMessage="Region Name can not be blank" ControlToValidate="TxtRegionName" Display="Dynamic" CssClass="ruError" EnableClientScript="true"></asp:RequiredFieldValidator>
</fieldset>
</div>
<div class="clearfix"></div>
<br />
<div class="col-md-16">
<fieldset class="border-for-div">
<legend class="caption-for-div">Status</legend>
<asp:Radiobutton ID="RbActive" runat="server" Text="Active" Checked="true" TabIndex="31" class="label-font-setting-medium" GroupName="ActiveInactive" />
<asp:Radiobutton ID="RbInactive" runat="server" Text="In-Active" TabIndex="32" class="label-font-setting-medium" GroupName="ActiveInactive" />
<%--<asp:Button ID="Button1" runat="server" Text="Save" style="visibility:hidden;"/>--%>
</fieldset>
</div>
</div>
<div class="clearfix"></div>
<br />
<div class="col-md-16">
<fieldset class="border-for-div text-align-Left">
<legend class="caption-for-div"> Action </legend>
<telerik:RadButton ID="btnAddBottom" runat="server" Text="Add" RenderMode="Lightweight" ToolTip="Add SO" OnClick="btnAddTop_Click" CausesValidation="False">
<Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
<telerik:RadButton ID="btnEditBottom" runat="server" Text="Edit" RenderMode="Lightweight" ToolTip="Edit SO" OnClick="btnEditTop_Click" CausesValidation="False">
<Icon PrimaryIconCssClass="rbEdit" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
<telerik:RadButton ID="btnSaveBottom" runat="server" Text="Save" RenderMode="Lightweight" ToolTip="Save/Update SO" OnClick="btnSaveTop_Click" OnClientClicking="SaveConfirm">
<Icon PrimaryIconCssClass="rbSave" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
<telerik:RadButton ID="btnAbortBottom" runat="server" Text="Abort" RenderMode="Auto" ToolTip="Abort" OnClick="btnAbortTop_Click" OnClientClicking="SaveConfirm" CausesValidation="False">
<Icon PrimaryIconCssClass="rbCancel" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
<telerik:RadButton ID="btnRefreshBottom" runat="server" Text="Refresh" RenderMode="Auto" ToolTip="Refresh" OnClick="btnRefreshTop_Click" CausesValidation="False">
<Icon PrimaryIconCssClass="rbRefresh" PrimaryIconLeft="5" PrimaryIconTop="5"></Icon>
</telerik:RadButton>
</fieldset>
</div>
<div class="clearfix"></div>
<br />
</div>
</fieldset>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function SaveConfirm(sender, args) {
args.set_cancel(!window.confirm("Are you sure ?"));
}
function OnRowSelected(sender, args) {
var SoId = args.getDataKeyValue("SalesOrderId");
var hdnControl = document.getElementById('<%= hdnSalesOrderId.ClientID%>');
hdnControl.value = SoId;
//alert(hdnControl.value);
}
</script>
</telerik:RadScriptBlock>
</asp:Content>
C# -
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Script.Services;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using MTIPLSQLCommonClass;
using ModelClasses;
using ErpBusinessDataLayer;
using System.Globalization;
namespace ErpWebApplication.TransactionData
{
public partial class SalesOrderEntry : System.Web.UI.Page
{
#region library class instances
clsSQLCommonLib objFunLib = new clsSQLCommonLib();
clsRegionMasterBDL objRegionMaster = new clsRegionMasterBDL();
#endregion
#region Variable declaration
int intVirtualRowCount = 0, intVirtualRowCount1 = 0, intVirtualRowCount2 = 0, intDtlTblCurrentPageIndex = 0;
const int ItemsPerRequest = 10;
#endregion
#region static variables for radgrid
string strSalesOrderId;
static string strSortOrder = null;
static string strRadGridFilter = null;
static int intPageIndex = 1;
static List<ClsFilterCriteria> objClsFilterCriteria = new List<ClsFilterCriteria>();
#endregion
protected void Page_Load(object sender, EventArgs e)
{
this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "Global", this.ResolveClientUrl("~/Include/javaFunctionLib.js"));
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-US");
DateTimeFormatInfo dtf = new System.Globalization.DateTimeFormatInfo();
dtf.ShortDatePattern = "dd/MM/yyyy";
ci.DateTimeFormat = dtf;
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoServerCaching();
HttpContext.Current.Response.Cache.SetNoStore();
Response.AddHeader("Refresh", Convert.ToString((Session.Timeout * 60) + 10) + "; url=" + ResolveServerUrl("~/login/frmLogin.aspx"));
RadInputManager mpRadInputManager;
mpRadInputManager = (RadInputManager)Master.FindControl("RadInputManager1");
if (mpRadInputManager != null)
{
DateInputSetting dateTextBoxSetting = (DateInputSetting)mpRadInputManager.GetSettingByBehaviorID("BIDateInput");
//dateTextBoxSetting.TargetControls.Add(new TargetInput(TxtOrderDate.UniqueID, true));
TextBoxSetting txtBoxSetting = (TextBoxSetting)mpRadInputManager.GetSettingByBehaviorID("BINotEmpty");
//txtBoxSetting.TargetControls.Add(new TargetInput(TxtVyasaRefNo.UniqueID, true));
//txtBoxSetting.TargetControls.Add(new TargetInput(TxtCustomerOrderNo.UniqueID, true));
}
if (!IsPostBack)
{
strSortOrder = null;
strRadGridFilter = null;
intPageIndex = 1;
objClsFilterCriteria = new List<ClsFilterCriteria>();
DivDataForm.Attributes["style"] = "Display:None;";
DivDataDisplayInGrid.Attributes["style"] = "Display:Normal;";
btnAddTop.Enabled = true;
btnAddBottom.Enabled = true;
btnEditTop.Enabled = true;
btnEditBottom.Enabled = true;
btnSaveTop.Enabled = false;
btnSaveBottom.Enabled = false;
btnAbortTop.Enabled = false;
btnAbortBottom.Enabled = false;
btnRefreshTop.Enabled = true;
btnRefreshBottom.Enabled = true;
ClsFilterCriteria TempClsFilter;
TempClsFilter = new ClsFilterCriteria();
TempClsFilter.ColumnName = "SalesOrderId";
TempClsFilter.FilterCriteria = null;
objClsFilterCriteria.Add(TempClsFilter);
TempClsFilter = new ClsFilterCriteria();
TempClsFilter.ColumnName = "SalesOrderDate";
TempClsFilter.FilterCriteria = null;
objClsFilterCriteria.Add(TempClsFilter);
TempClsFilter = new ClsFilterCriteria();
foreach (GridSortExpression exp in RadGridSalesOrder.MasterTableView.SortExpressions)
{
if (strSortOrder == "" | String.IsNullOrEmpty(strSortOrder))
{
strSortOrder = exp.ToString();
}
else
{
strSortOrder = strSortOrder + ", " + exp.ToString();
}
}
//RadGridSalesOrder.Rebind();
}
else
{
if (hdnVisibleDiv.Value == "DivDataForm")
{
DivDataForm.Attributes["style"] = "Display:Normal;";
DivGrid.Attributes["style"] = "Display:None;";
btnRefreshTop.Enabled = false;
btnRefreshBottom.Enabled = false;
}
else
{
DivDataForm.Attributes["style"] = "Display:None;";
DivGrid.Attributes["style"] = "Display:Normal;";
btnRefreshTop.Enabled = true;
btnRefreshBottom.Enabled = true;
}
}
}
public static string ResolveServerUrl(string serverUrl, bool forceHttps)
{
// *** Is it already an absolute Url?
if (serverUrl.IndexOf("://") > -1)
return serverUrl;
// *** Start by fixing up the Url an Application relative Url
string newUrl = System.Web.VirtualPathUtility.ToAbsolute(serverUrl); //ResolveServerUrl(serverUrl);
Uri originalUri = HttpContext.Current.Request.Url;
newUrl = (forceHttps ? "https" : originalUri.Scheme) +
"://" + originalUri.Authority + newUrl;
return newUrl;
}
public static string ResolveServerUrl(string serverUrl)
{
return ResolveServerUrl(serverUrl, false);
}
#region button events
//Same event is used for save buttom based at bottom
protected void btnSaveTop_Click(object sender, EventArgs e) //Same event is used for save buttom based at bottom
{
if (!Page.IsValid)
{
DivMessage.Attributes["class"] = "error rounded-corners";
LblMessage.Text = "Data validation failed";
ClientScript.RegisterStartupScript(this.GetType(), "HideLabel", "<script type=\"text/javascript\">setTimeout(\"document.getElementById('" + DivMessage.ClientID + "').style.display='none'\",20000)</script>");
DivDataForm.Attributes["style"] = "Display:Normal;";
DivGrid.Attributes["style"] = "Display:None;";
btnAddTop.Enabled = false;
btnAddBottom.Enabled = false;
btnEditTop.Enabled = false;
btnEditBottom.Enabled = false;
btnSaveTop.Enabled = true;
btnSaveBottom.Enabled = true;
btnAbortTop.Enabled = true;
btnAbortBottom.Enabled = true;
hdnVisibleDiv.Value = "DivDataForm";
btnRefreshTop.Enabled = false;
btnRefreshBottom.Enabled = false;
return;
}
else
{
objRegionMaster.RegionId = Convert.ToInt16(hdnSalesOrderId.Value);
objRegionMaster.RefCompanyId = Convert.ToByte(Request.Cookies["RefCompanyId"].Value);
objRegionMaster.RegionName = TxtRegionName.Text;
objRegionMaster.IsActive = RbActive.Checked == true ? true : false;
objRegionMaster.SaveData();
DivMessage.Attributes["style"] = "Display:Normal;";
if (objRegionMaster.IntMessageCode == 1 | objRegionMaster.IntMessageCode == 2)
{
DivMessage.Attributes["class"] = "success rounded-corners";
}
else
{
DivMessage.Attributes["class"] = "error rounded-corners";
}
LblMessage.Text = objRegionMaster.StrMessage;
ClientScript.RegisterStartupScript(this.GetType(), "HideLabel", "<script type=\"text/javascript\">setTimeout(\"document.getElementById('" + DivMessage.ClientID + "').style.display='none'\",20000)</script>");
DivDataForm.Attributes["style"] = "Display:None;";
DivGrid.Attributes["style"] = "Display:Normal;";
btnAddTop.Enabled = true;
btnAddBottom.Enabled = true;
btnEditTop.Enabled = true;
btnEditBottom.Enabled = true;
btnSaveTop.Enabled = false;
btnSaveBottom.Enabled = false;
btnAbortTop.Enabled = false;
btnAbortBottom.Enabled = false;
hdnVisibleDiv.Value = "DivGrid";
btnRefreshTop.Enabled = true;
btnRefreshBottom.Enabled = true;
RadGridSalesOrder.DataSource = null;
RadGridSalesOrder.Rebind();
}
// btnAddTop_Click(sender, e);
}
//Same event is used for Add buttom based at bottom
protected void btnAddTop_Click(object sender, EventArgs e)
{
DivDataForm.Attributes["style"] = "Display:Normal;";
DivGrid.Attributes["style"] = "Display:None;";
btnAddTop.Enabled = false;
btnAddBottom.Enabled = false;
btnEditTop.Enabled = false;
btnEditBottom.Enabled = false;
btnSaveTop.Enabled = true;
btnSaveBottom.Enabled = true;
btnAbortTop.Enabled = true;
btnAbortBottom.Enabled = true;
hdnVisibleDiv.Value = "DivDataForm";
btnRefreshTop.Enabled = false;
btnRefreshBottom.Enabled = false;
hdnSalesOrderId.Value = "0";
TxtRegionName.Text = String.Empty;
}
//Same event is used for edit buttom based at bottom
protected void btnEditTop_Click(object sender, EventArgs e)
{
DivDataForm.Attributes["style"] = "Display:Normal;";
DivGrid.Attributes["style"] = "Display:None;";
btnAddTop.Enabled = false;
btnAddBottom.Enabled = false;
btnEditTop.Enabled = false;
btnEditBottom.Enabled = false;
btnSaveTop.Enabled = true;
btnSaveBottom.Enabled = true;
btnAbortTop.Enabled = true;
btnAbortBottom.Enabled = true;
hdnVisibleDiv.Value = "DivDataForm";
btnRefreshTop.Enabled = false;
btnRefreshBottom.Enabled = false;
objRegionMaster.GetData(hdnSalesOrderId.Value);
TxtRegionName.Text = objRegionMaster.RegionName.ToString();
if (objRegionMaster.IsActive == true)
{
RbActive.Checked = true;
RbInactive.Checked = false;
}
else
{
RbActive.Checked = false;
RbInactive.Checked = true;
}
}
//Same event is used for abort buttom based at bottom
protected void btnAbortTop_Click(object sender, EventArgs e)
{
DivDataForm.Attributes["style"] = "Display:None;";
DivGrid.Attributes["style"] = "Display:Normal;";
btnAddTop.Enabled = true;
btnAddBottom.Enabled = true;
btnEditTop.Enabled = true;
btnEditBottom.Enabled = true;
btnSaveTop.Enabled = false;
btnSaveBottom.Enabled = false;
btnAbortTop.Enabled = false;
btnAbortBottom.Enabled = false;
hdnVisibleDiv.Value = "DivGrid";
btnRefreshTop.Enabled = true;
btnRefreshBottom.Enabled = true;
}
//Same event is used for abort buttom based at bottom
protected void btnRefreshTop_Click(object sender, EventArgs e)
{
RadGridSalesOrder.Rebind();
btnAddTop.Enabled = true;
btnAddBottom.Enabled = true;
btnEditTop.Enabled = true;
btnEditBottom.Enabled = true;
btnSaveTop.Enabled = false;
btnSaveBottom.Enabled = false;
btnAbortTop.Enabled = false;
btnAbortBottom.Enabled = false;
btnRefreshTop.Enabled = true;
btnRefreshBottom.Enabled = true;
}
#endregion
#region validation rules
protected void ValidateForNotBlank(object source, ServerValidateEventArgs e)
{
if (e.Value.Length == 0)
e.IsValid = false;
else
e.IsValid = true;
}
#endregion
#region radgrid events
protected void RadGridSalesOrder_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
if (!e.IsFromDetailTable)
{
RadGridSalesOrder.DataSource = objFunLib.GetDataTableForRadgridCustomPaging("SalesOrderMaster INNER JOIN PartyMaster ON SalesOrderMaster.PartyId = PartyMaster.PartyId", intPageIndex, RadGridSalesOrder.PageSize, "SalesOrderMaster.SalesOrderId, SalesOrderMaster.SalesOrderDate, PartyMaster.PartyName, SalesOrderMaster.PartyRefPONo, SalesOrderMaster.PartyRefPODate, SalesOrderMaster.IsActive", strSortOrder, strRadGridFilter, ref intVirtualRowCount);
RadGridSalesOrder.MasterTableView.VirtualItemCount = intVirtualRowCount;
}
}
protected void RadGridSalesOrder_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "OrderDetail":
{
int intPageIndex = e.DetailTableView.CurrentPageIndex+1;
strSalesOrderId = dataItem.GetDataKeyValue("SalesOrderId").ToString();
e.DetailTableView.DataSource = objFunLib.GetDataTableForRadgridCustomPaging("SalesOrderDetail INNER JOIN ItemMaster ON SalesOrderDetail.ItemCode = ItemMaster.ItemCode", 1, RadGridSalesOrder.PageSize, "SalesOrderDetail.ItemCode, ItemMaster.ItemName, SalesOrderDetail.OrderQty, SalesOrderDetail.Rate, SalesOrderDetail.IsActive", strSortOrder, " SalesOrderDetail.SalesOrderId = '" + strSalesOrderId + "'", ref intVirtualRowCount1);
e.DetailTableView.VirtualItemCount = intVirtualRowCount1;
e.DetailTableView.CurrentPageIndex = intPageIndex - 1;
break;
}
case "Order":
{
//string OrderID = dataItem.GetDataKeyValue("OrderID").ToString();
//e.DetailTableView.DataSource = GetDataTable("SELECT * FROM [Order Details] WHERE OrderID = " + OrderID);
break;
}
}
}
protected void RadGridSalesOrder_PageIndexChanged(object sender, GridPageChangedEventArgs e)
{
intPageIndex = e.NewPageIndex + 1;
RadGridSalesOrder.DataSource = null;
RadGridSalesOrder.Rebind();
}
protected void RadGridSalesOrder_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)
{
intPageIndex = 1;
}
protected void RadGridSalesOrder_ItemCommand(object sender, GridCommandEventArgs e)
{
string strFilter = "";
if ((e.CommandName == RadGrid.FilterCommandName))
{
DataTable objDt;
Pair filterPair = (Pair)e.CommandArgument;
e.Canceled = true;
foreach (ClsFilterCriteria obb in objClsFilterCriteria)
{
if (obb.ColumnName.ToUpper() == filterPair.Second.ToString().ToUpper())
{
TextBox filterBox = (e.Item as GridFilteringItem)[filterPair.Second.ToString()].Controls[0] as TextBox;
obb.FilterCriteria = objFunLib.GetFilterCriteria(filterPair.First.ToString(), filterBox.Text) == "" ? null : objFunLib.GetFilterCriteria(filterPair.First.ToString(), filterBox.Text);
if (obb.FilterCriteria == null)
{
foreach (GridColumn column in RadGridSalesOrder.MasterTableView.RenderColumns)
{
if (column.SupportsFiltering())
{
if (filterPair.Second.ToString().ToUpper() == column.UniqueName.ToString().ToUpper())
{
column.CurrentFilterValue = string.Empty;
}
}
}
}
}
}
foreach (ClsFilterCriteria obb in objClsFilterCriteria)
{
if (obb.FilterCriteria != null & obb.FilterCriteria != "")
{
if (strFilter == "")
{
strFilter = obb.ColumnName + " " + obb.FilterCriteria;
}
else
{
strFilter = strFilter + " And " + obb.ColumnName + " " + obb.FilterCriteria + " ";
}
}
}
strRadGridFilter = strFilter;
intPageIndex = 1;
//RadGridSalesOrder.DataSource = objFunLib.GetDataTableForRadgridCustomPaging("RegionMaster", intPageIndex, RadGridSalesOrder.PageSize, "RegionId, RegionName, IsActive", strSortOrder, strRadGridFilter, ref intVirtualRowCount);
RadGridSalesOrder.DataSource = objFunLib.GetDataTableForRadgridCustomPaging("SalesOrderMaster INNER JOIN PartyMaster ON SalesOrderMaster.PartyId = PartyMaster.PartyId", intPageIndex, RadGridSalesOrder.PageSize, "SalesOrderMaster.SalesOrderId, SalesOrderMaster.SalesOrderDate, PartyMaster.PartyName, SalesOrderMaster.PartyRefPONo, SalesOrderMaster.PartyRefPODate, SalesOrderMaster.IsActive", strSortOrder, strRadGridFilter, ref intVirtualRowCount);
RadGridSalesOrder.MasterTableView.VirtualItemCount = intVirtualRowCount;
RadGridSalesOrder.Rebind();
}
DivDataForm.Attributes["style"] = "Display:None;";
DivGrid.Attributes["style"] = "Display:Normal;";
btnAddTop.Enabled = true;
btnAddBottom.Enabled = true;
btnEditTop.Enabled = true;
btnEditBottom.Enabled = true;
btnSaveTop.Enabled = false;
btnSaveBottom.Enabled = false;
btnAbortTop.Enabled = false;
btnAbortBottom.Enabled = false;
hdnVisibleDiv.Value = "DivGrid";
btnRefreshTop.Enabled = true;
btnRefreshBottom.Enabled = true;
}
protected void RadGridSalesOrder_SortCommand(object sender, GridSortCommandEventArgs e)
{
int intLoc = 0;
GridTableView tableView = e.Item.OwnerTableView;
e.Canceled = true;
GridSortExpression expression = new GridSortExpression();
if (expression.SortOrder != GridSortOrder.None)
{
expression.FieldName = e.SortExpression;
if (RadGridSalesOrder.MasterTableView.SortExpressions.ContainsExpression(e.SortExpression))
{
intLoc = RadGridSalesOrder.MasterTableView.SortExpressions.IndexOf(expression) < 0 ? 0 : RadGridSalesOrder.MasterTableView.SortExpressions.IndexOf(expression);
}
if (RadGridSalesOrder.MasterTableView.SortExpressions.Count == 0 || RadGridSalesOrder.MasterTableView.SortExpressions[intLoc].FieldName != e.SortExpression)
{
expression.SortOrder = GridSortOrder.Descending;
}
else if (RadGridSalesOrder.MasterTableView.SortExpressions[intLoc].SortOrder == GridSortOrder.Descending)
{
expression.SortOrder = GridSortOrder.Ascending;
}
else if (RadGridSalesOrder.MasterTableView.SortExpressions[intLoc].SortOrder == GridSortOrder.Ascending)
{
expression.SortOrder = GridSortOrder.None;
}
else if (RadGridSalesOrder.MasterTableView.SortExpressions[intLoc].SortOrder == GridSortOrder.None)
{
expression.SortOrder = GridSortOrder.Descending;
}
if (string.IsNullOrEmpty(strSortOrder) == false)
{
strSortOrder = strSortOrder.Replace(e.SortExpression + " " + "ASC,", "");
strSortOrder = strSortOrder.Replace(e.SortExpression + " " + "DESC,", "");
strSortOrder = strSortOrder.Replace(e.SortExpression + " " + "ASC", "");
strSortOrder = strSortOrder.Replace(e.SortExpression + " " + "DESC", "");
strSortOrder = strSortOrder.Replace(e.SortExpression + ", ", "");
strSortOrder = strSortOrder.Replace(e.SortExpression + " ", "");
strSortOrder = strSortOrder.Replace(e.SortExpression, "");
strSortOrder = strSortOrder.Trim();
}
if (strSortOrder == "" | String.IsNullOrEmpty(strSortOrder))
{
if (expression.SortOrder == GridSortOrder.None)
{
strSortOrder = expression.ToString() + "ASC";
}
else
{
strSortOrder = expression.ToString();
}
}
else
{
if (strSortOrder.Substring(0, 1) == ",")
{
strSortOrder = strSortOrder.Substring(1, strSortOrder.Trim().Length - 1);
}
if (strSortOrder.Substring(strSortOrder.Trim().Length - 1, 1) == ",")
{
strSortOrder = strSortOrder.Substring(0, strSortOrder.Trim().Length - 1);
}
if (expression.SortOrder != GridSortOrder.None)
{
strSortOrder = strSortOrder + ", " + expression.ToString();
}
}
RadGridSalesOrder.MasterTableView.SortExpressions.AddSortExpression(expression);
DivDataForm.Attributes["style"] = "Display:None;";
DivGrid.Attributes["style"] = "Display:Normal;";
btnAddTop.Enabled = true;
btnAddBottom.Enabled = true;
btnEditTop.Enabled = true;
btnEditBottom.Enabled = true;
btnSaveTop.Enabled = false;
btnSaveBottom.Enabled = false;
btnAbortTop.Enabled = false;
btnAbortBottom.Enabled = false;
hdnVisibleDiv.Value = "DivGrid";
btnRefreshTop.Enabled = true;
btnRefreshBottom.Enabled = true;
RadGridSalesOrder.DataSource = null;
RadGridSalesOrder.Rebind();
}
}
#endregion
}
}
Thanks
Milind
Hi,
I would like to add a "are you sure?" confirm dialog when user clicks the "cancel changes" button in the grid when batch editing.
Any client side event to register to? (I did not find any).
Thanks,
Gaetan
Hello,
I have a parent page and I open a
jQuery Dialog using the load function in order to open another aspx
page. Everything looks fine when the dialogs opens, however, when I close the dialog my Telerik Controls (tried RadComboBox, RadButton, RadGrid) cannot postback, asp:buttons work properly.
Please note that both of my pages
are enclosed by update panels but I have removed them and I still
have the same behavior. Also, I have another jQuery dialog within the
same page but without the load functionality (just displays a div) and
does not causes the same issue.
My Page is very large and may be something else causes the issue but I have tried to isolate some parts of my code that I believe that are important.
<script type="text/javascript">
$(document).ready(
//Bind jQuery events
function () {
Load();
});
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(
// re-bind jQuery events on End Request
function () {
Load();
});
function Load() {
$(".companyLink").click( //On a link click event
function () {
$(".client-editor")
.load("../somepage.aspx?cid=ad24a5dd-e2bb-4196-9f06-6fac43ccd4c0") //Load the aspx page
.dialog({ //Prepare the dialog
autoOpen: false,
modal: true,
close: function () { //Empty the page loaded on close
$(".client-editor").empty();
}
});
$(".client-editor").dialog("open"); //Open the dialog
});
}
</script>
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:HyperLink id="hlkCompanyName" runat="server" CssClass="companyLink" Text="Open"></asp:HyperLink>
<telerik:RadButton ID="rbButton1" runat="server" Text="Telerik Button"></telerik:RadButton>
<asp:Button ID="btnButton2" runat="server" Text="ASP Button" />
<div class="client-editor" title="Edit Control"></div>
</ContentTemplate>
</asp:UpdatePanel>