Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
175 views
I have a RadNumericTextbox in the footer of a grid that I use for displaying a running total on a column when in edit mode.
I populate the grid depending upon what the user selects for input. When in edit mode, and they update the quantity column,
the textbox in the footer automatically totals that column.

When I display non-editable data in the grid, I need to be able to manually update the total from the code behind. How can I
gain access to the textbox and set it's value to be displayed?

I tried the following code but it doesn't work. I can access the textbox and set the text property, but it doesn't display.

I have tried this:
     Dim footer As GridFooterItem = DirectCast(RadGrid1.MasterTableView.GetItems(GridItemType.Footer)(0), GridFooterItem)
     Dim TotalQty As RadNumericTextBox = TryCast(footer.FindControl("TextBox2"), RadNumericTextBox)
     TotalQty.Text = dr("TotalQuantity")
 
And, I have tried this:
     Dim TotalQty As RadNumericTextBox = FindControlRecursive(Page, "TextBox2")
     TotalQty.Text = dr("TotalQuantity")

This is the grid:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" DataSourceID="Products"
    Skin="Forest" GridLines="None" OnItemDataBound="RadGrid1_ItemDataBound" Width="50%">
    <ClientSettings>
         <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ></Scrolling>
            <ClientEvents OnBatchEditCellValueChanged="CellValueChanged" />
    </ClientSettings>
    <MasterTableView ShowFooter="true" AutoGenerateColumns="False"
        CurrentResetPageIndexAction="SetPageIndexToFirst" DataKeyNames="ID" DataSourceID="Products"
        Dir="LTR" Frame="Border" TableLayout="Auto" EditMode="Batch" BatchEditingSettings-OpenEditingEvent="Click" CommandItemDisplay="None">
        <Columns>
            <telerik:GridBoundColumn DataField="ID" DataType="System.Int32"  ReadOnly="True" UniqueName="ID" />
            <telerik:GridBoundColumn DataField="ProductName" ReadOnly="true" HeaderText="Product" UniqueName="ProductName" />
             
            <telerik:GridTemplateColumn DataField="Quantity" UniqueName="Quantity" HeaderText="Quantity" DataType="System.Int32">                               
                <ItemTemplate>
                    <%# Eval("Quantity")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtQuantity" runat="server" Width="40px" DataType="System.Int32"
                         NumberFormat-DecimalDigits="0" Skin="Forest">
                        <ClientEvents OnBlur="Blur" OnFocus="Focus" />
                    </telerik:RadNumericTextBox>
                </EditItemTemplate>
                <FooterTemplate>                   
                    <telerik:RadNumericTextBox ID="TextBox2" runat="server" Width="40px" DataType="System.Int32" NumberFormat-DecimalDigits="0" Skin="Forest" ReadOnly="True">
                        <ClientEvents OnLoad="Load" />
                    </telerik:RadNumericTextBox>
                </FooterTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
    <PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>
Steve
Top achievements
Rank 1
 answered on 10 Jan 2014
0 answers
85 views
Hi,

I want to know that can I have a website without Session Timeout?
Is it possible to make this?

If you any come to know this,please let me know.

Thanking you,

AGMRAJA
Agm
Top achievements
Rank 1
 asked on 10 Jan 2014
2 answers
223 views
I'm working on a grid that implements the grouping functionality and we are having an issue when attempting to sort the groups ascending or descending.  The grouping field is an item number and needs to be sorting by value, however we can't seem to get it to not sort alphabetically (Item 10 always comes before Item 2).  The associated column is an integer, so ideally it should sort numerically.

Is it possible to sort by just the group's value and not the formatted string?  We currently have it formatted as "Item #", however we can strip any extra characters if necessary.

<telerik:RadGrid SkinID="Paging" ID="ResultsGrid" runat="server" AllowCustomPaging = "True" AllowPaging="False"
            OnInit="DataGridInit" OnItemDataBound="BindColumnValues"
            OnNeedDataSource="DataGrid_NeedDataSource"
            OnItemCreated="ItemManipulation"
            OnSortCommand="PerformSort"
            OnItemCommand="ResultsGridItemCommand" ShowGroupPanel="true" AutoGenerateColumns="false"
        GridLines="none" ShowFooter="false" EnableLinqExpressions="false">
            <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
            <GroupingSettings ExpandTooltip="Expand" CollapseTooltip="Collapse"  />
            <MasterTableView Summary="<%$ Resources: ResultsTableSummary %>" ShowGroupFooter="true"
                ClientDataKeyNames=""
                DataKeyNames="ItemDocumentKey,FundingKey" CssClass="rgWrapFalse">
                  
                <Columns>
                    <telerik:GridBoundColumn UniqueName="ItemNumber" DataField="ItemNumber" HeaderText="<%$
Resources: PostAwardCommon, ItemNumber %>" DataType="System.Int32"
                        Visible="false"/>                           
                    <telerik:GridBoundColumn UniqueName="ShipToCode" DataField="ShipToCode" HeaderText="<%$ Resources: Common, DeliverTo %>" DataType="System.String"
                        SortExpression="ShipToCode" />
                    <telerik:GridBoundColumn DataField="AccountId"
                        HeaderText="<%$ Resources: PostAwardCommon, AccountId %>" UniqueName="AccountId" AllowSorting="true"/>
                    <telerik:GridBoundColumn DataField="AccountCode"
                        HeaderText="<%$ Resources: PostAwardCommon, AccountingCode %>" UniqueName="AccountCode" AllowSorting="true"/>
                    <telerik:GridBoundColumn DataField="AwardedAmount" HeaderText="<%$ Resources: PostAwardCommon, Awarded %>" AllowSorting="true"
                    UniqueName="AwardedAmount" HeaderStyle-CssClass="rgHeader width30 rgHeaderAlignLeft" ItemStyle-HorizontalAlign="Right"/>
                    <telerik:GridBoundColumn DataField="AcceptedToDate" HeaderText="<%$ Resources: PostAwardCommon, AcceptedtoDateHeaderText %>" AllowSorting="true"
                    UniqueName="AcceptedToDate" HeaderStyle-CssClass="rgHeader width45 rgHeaderAlignLeft" ItemStyle-HorizontalAlign="Right"/>
                    <telerik:GridBoundColumn DataField="RemainingAmount" HeaderText="<%$ Resources: PostAwardCommon, Remaining %>" AllowSorting="true"
                    UniqueName="RemainingAmount" HeaderStyle-CssClass="rgHeader width30 rgHeaderAlignLeft" ItemStyle-HorizontalAlign="Right"/>                                                          
                    <telerik:GridBoundColumn UniqueName="AcceptedDate" HeaderText="<%$ Resources: PostAwardCommon, ActualAcceptedDate %>"
                    ItemStyle-HorizontalAlign="Center" />                  
                    <telerik:GridBoundColumn UniqueName="AcceptedAmount"  FooterStyle-HorizontalAlign="Left" FooterText="Total Accepted: "
                    GroupByExpression="AcceptedAmount Group By AcceptedAmount" DataType="System.Double"  Aggregate="Sum" DataField="AcceptedAmount"
                    ItemStyle-HorizontalAlign="Right"/>                                     
                </Columns>
                  
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="ItemNumber" HeaderText="<%$ Resources: PostAwardCommon, ItemNumber %>" FieldName="ItemNumber"></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="ItemNumber" SortOrder="Ascending"></telerik:GridGroupByField>
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>               
                  
            </MasterTableView>
 
        </telerik:RadGrid>
Deborah Blackwell
Top achievements
Rank 1
 answered on 10 Jan 2014
2 answers
120 views
when changing skins my radcombobox's are drawn with a line under them??  (see attached image)

metro and metro touch skins are rendered properly but skins like outlook, sunset have the extra line.

???
Ivan Zhekov
Telerik team
 answered on 10 Jan 2014
8 answers
496 views
Hi,
We want to have the default style for tables set to style="border: 1px solid black;". We know how to attain this from manipulating the stylesheet, but this will not add the tag to HTML mode. So when storing to the DB it will not store the border properties, and when retrieving the data for a report it will not have any borders.

We are now using OnClientCommandExecuting and OnClientCommandExecuted to manipulate the table border formatting. But this way of doing it is causing our pages with many radeditor controls to load extremely slow.

Code used for JS function call manipulation;
        <telerik:RadEditor  
                ID="RadEditor1"  
                runat="server" 
                Width="100%" 
                ToolsFile="../RadControls/Editor/BasicTools.xml"  
                skin="Vista" 
                EditModes="Design"  
                EnableResize="False" 
                EnableTheming="True" 
                StripFormattingOptions="AllExceptNewLines" 
                ToolbarMode="Default" 
                OnClientCommandExecuting="OnClientCommandExecuting"  
                OnClientCommandExecuted="OnClientCommandExecuted">  
        </telerik:RadEditor> 

var curTables = []; 
var curTds = []; 
            function IsObjectInArray(elem, array) 
            { 
                if (!array || !array.length) return false
                for (var i=0; i < array.length; i++) 
                { 
                    if (elem == array[i]) return true
                } 
                return false
            } 
 
            function OnClientCommandExecuting(editor, args) { 
                var commandName = args.get_commandName(); 
                if ("InsertTable" == commandName) { 
                    var cArea = editor.get_contentArea(); 
                    var tables = cArea.getElementsByTagName("TABLE"); 
                    var tds = cArea.getElementsByTagName("TD"); 
                    for (var i = 0; i < tables.length; i++) { 
                        curTables[curTables.length] = tables[i]; 
                    } 
                    for (var j = 0; j < tds.length; j++) { 
                        curTds[curTds.length] = tds[j]; 
                    } 
                } 
            } 
            function OnClientCommandExecuted(editor, args) { 
                var commandName = args.get_commandName(); 
                if ("InsertTable" == commandName) { 
 
                    var cArea = editor.get_contentArea(); 
                    var tables = cArea.getElementsByTagName("TABLE"); 
                    var tds = cArea.getElementsByTagName("TD"); 
                    for (var i = 0; i < tables.length; i++) { 
                        var oTable = tables[i]; 
                        if (!IsObjectInArray(oTable, curTables)) { 
                            oTable.style.borderCollapse = "collapse"
                            oTable.style.border = "Black 1px solid"
                            oTable.style.width = "100%"
                        } 
                    } 
                    for (var j = 0; j < tds.length; j++) { 
                        var oTd = tds[j]; 
                        if (!IsObjectInArray(oTd, curTds)) { 
                            oTd.style.border = "1px solid black"
                        } 
                    } 
                } 
            } 




Is there any other way of attaining the desired behaviour?
Marin Bratanov
Telerik team
 answered on 10 Jan 2014
5 answers
131 views
Just thought I should check to make sure.  

I have rather conservative managers and they've been resisting upgrades to our current version of the Rad Ajax controls.  (We're currently using 2012.2.607.40.)  I, of course, am getting impatient and would like to try the latest.

It occurs to me that the way our apps are designed, this should not be a problem.  All references to the Telerik controls are to copies of the DLL located in the project itself, not to the originals located in the c:\program files (x86) folder.

Just wondering if downloading the latest version would have any affect on this project?  

Any factor I might be overlooking?

Plamen
Telerik team
 answered on 10 Jan 2014
3 answers
118 views
If I open 2 radwindows, after closing the second one, the focus don't go back to the first one. This issue is only in Lightweight rendering.
I attached a snapshot demonstrating the problem.
Marin Bratanov
Telerik team
 answered on 10 Jan 2014
3 answers
136 views
A page uses a RadGrid :
1. DataBind to a DataTable.(on Page_Load)
2. GridTemplateColumn , put a RadTextBox (in .aspx file)

no compile warning or errors, run in IE, the grid  in displayed very strange.
snapshot pic is here: http://i.imgbox.com/abhkG4MO.png

codes:
1. WebForm1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" CellSpacing="0" Culture="zh-CN" GridLines="None">
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn DataField="name" FilterControlAltText="Filter name column" HeaderText="name" UniqueName="name">
                    </telerik:GridBoundColumn>
 
                    <telerik:GridTemplateColumn DataField="age" FilterControlAltText="Filter age column" HeaderText="age" UniqueName="age">
                        <ItemTemplate>
                            <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Eval("age") %>'></telerik:RadTextBox>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </form>
</body>
</html>


2. WebForm1.aspx.cs
using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace WebApplication2
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                DataTable dt = new DataTable();
 
                dt.Columns.Add("name");
                dt.Columns.Add("age");
 
                for (int i = 0; i < 20; i++)
                {
                    DataRow r = dt.NewRow();
 
                    r["name"] = "name" + (char)('A' + i);
                    r["age"] = i;
 
                    dt.Rows.Add(r);
                }
 
                RadGrid1.DataSource = dt;
                RadGrid1.DataBind();
            }
        }
    }
}



Ray
Top achievements
Rank 1
 answered on 10 Jan 2014
3 answers
729 views

I have a radgrid and I can loo through the selected items.  If I set the for loop

for (int i = 0; i < totalSelected; i++)
     GridDataItem selectedItem = (GridDataItem) RadGrid1.SelectedItems[i]

it will loop in the order that they were selected and not the order of display on the screen.  Is there a way to loop through the selected based on the order in the grid?

for the time being I have found

foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
   if (item.Selected)
   {

but this will loop through the whole grid which seems kind of a waist when I should be able to just loop through the selected items.

Viktor Tachev
Telerik team
 answered on 10 Jan 2014
1 answer
84 views

I have a page that has a RadGrid with a Context Menu on it.   I am using the context menu to fire open a RadWindow that is hosting another aspx page with a RadProgressArea completing a long running process.   Once the job is finished I have some JS in a placeholder that I make visable to Rebind the radgrid and then close the RadWindow.


Everything works fine except if I rebind the RadGrid the RadWindow reopens back up.   What am I doing wrong?



Here is the main aspx page - stripped down to be simple.



<%@ Control Language="VB" AutoEventWireup="false" CodeFile="PartInventory.ascx.vb" Inherits="UserControls_PartInventory" %>
<telerik:RadCodeBlock runat="server" ID="RadCodeBlock2">
 
        <script type="text/javascript">
            
            function RowContextMenu(sender, eventArgs) {
                  
                var menu = $find("<%=RadMenu1.ClientID %>");
                var evt = eventArgs.get_domEvent();
 
                if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
                    return;
                }
                var index = eventArgs.get_itemIndexHierarchical();
                document.getElementById("radGridClickedRowIndex").value = index;
 
                sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);
                menu.show(evt);
                evt.cancelBubble = true;
                evt.returnValue = false;
 
                if (evt.stopPropagation) {
                    evt.stopPropagation();
                    evt.preventDefault();
                 
                }
            }
 
            function refreshGrid() {
                var masterTable = $find("<%=rgInventoryEdit.ClientID%>").get_masterTableView();
                masterTable.rebind();
            }
 
 
        </script>
 
    </telerik:RadCodeBlock>
<telerik:RadGrid ID="rgInventoryEdit" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" CellSpacing="0" DataSourceID="sqlInventory" GridLines="None" Skin="WebBlue"
     AllowMultiRowSelection="true"  AllowAutomaticDeletes="True" >
    <ClientSettings>
            <ClientEvents OnRowContextMenu="RowContextMenu" />
            <Selecting CellSelectionMode="None" AllowRowSelect="True"></Selecting>
            <Resizing AllowColumnResize="True" AllowResizeToFit="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"></Resizing>
        </ClientSettings>
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="InventoryID" DataSourceID="sqlInventory"  PageSize="25" ShowFooter="True" ShowHeader="true"  CommandItemDisplay="Top">
         <CommandItemTemplate>
                <div style="padding: 5px 5px;">
                      <asp:LinkButton ID="LinkButton1" runat="server" OnClick="SaveGridSettings" CommandName="SaveSettings"><img style="border:0px;vertical-align:middle;"  alt="" src="../../Images/Icons/24x24/save24x24.png"/> Save Layout</asp:LinkButton>   
                </div>
            </CommandItemTemplate>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="Img"  AllowFiltering="False"  UniqueName="HasImages">
                <HeaderStyle Width="35px"></HeaderStyle>
                <ItemStyle Width="35px"></ItemStyle>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" Text="Link" Target="_blank" Visible='<%# Eval("HasImages")%>' ImageUrl="~/Images/BlueIcons/16x16/blue16_032.gif" onclick="window.open (this.href, 'child', 'height=800,width=800,scrollbars'); return false"
                        NavigateUrl='<%# String.Format("~/CarAndPartPics.aspx?NoMaster=True&InventoryNumber={0}&StockNumber={1}", Convert.ToString(Eval("InventoryNumber")), Convert.ToString(Eval("StockTicketNumber")))%>' />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="MyImageButton" />
                </telerik:GridEditCommandColumn>
            
             <telerik:GridButtonColumn ConfirmText="Delete this Part?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
<telerik:RadPersistenceManagerProxy ID="RadPersistenceManagerProxy1" runat="server">
        <PersistenceSettings>
            <telerik:PersistenceSetting ControlID="rgInventoryEdit" />
        </PersistenceSettings>
</telerik:RadPersistenceManagerProxy>
<input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />
<telerik:RadContextMenu ID="RadMenu1" runat="server" OnItemClick="RadMenu1_ItemClick" SkinID="WebBlue"
        EnableRoundedCorners="true" EnableShadows="true">
        <Items>
            <telerik:RadMenuItem Text="Increase Prices">
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="Do Multiple Operations">
            </telerik:RadMenuItem>
 
        </Items>
 
    </telerik:RadContextMenu>
<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server" EnableShadow="true">
    <Windows>
        <telerik:RadWindow ID="rwOne" runat="server" ReloadOnShow="true" ShowContentDuringLoad="false" Behaviors="Close,Move"
                Modal="true" >
            </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
<asp:SqlDataSource ID="sqlInventory" runat="server" ConnectionString="<%$ ConnectionStrings: %>"
   
</asp:SqlDataSource>




Here is the code Behind.

Imports Telerik.Web.UI
 
 
Partial Class UserControls_PartInventory
    Inherits System.Web.UI.UserControl
 
    Protected Sub UserControls_PartInventory_Load(sender As Object, e As EventArgs) Handles Me.Load
 
        If Not IsPostBack Then
            LoadTelerikPF()
        End If
    End Sub
 
    
 
    Public Function SaveTelerikPF() As Boolean
        Try
            Dim mstr As MasterPage = Me.Parent.Page.Master
            Dim rp As Telerik.Web.UI.RadPersistenceManager = mstr.FindControl("RadPersistenceManager1")
            rp.SaveState()
        Catch ex As Exception
            Return False
        End Try
        Return True
    End Function
 
    Public Function LoadTelerikPF() As Boolean
        Try
            Dim mstr As MasterPage = Me.Parent.Page.Master
            Dim rp As Telerik.Web.UI.RadPersistenceManager = mstr.FindControl("RadPersistenceManager1")
            rp.LoadState()
        Catch ex As Exception
            Return False
        End Try
        Return True
    End Function
 
    Protected Sub SaveGridSettings(sender As Object, e As EventArgs)
        SaveTelerikPF()
    End Sub
 
    Protected Sub RadMenu1_ItemClick(sender As Object, e As Telerik.Web.UI.RadMenuEventArgs) Handles RadMenu1.ItemClick
 
        Dim intArray(rgInventoryEdit.SelectedItems.Count - 1) As Integer
        Dim intCount As Integer = 0
 
        For Each row As GridItem In rgInventoryEdit.SelectedItems
            intArray(intCount) = rgInventoryEdit.MasterTableView.Items(row.ItemIndex).GetDataKeyValue("InventoryID")
            intCount += 1
        Next
 
        Dim strGUID As String = Guid.NewGuid.ToString
        Session(strGUID) = intArray
 
        Select Case e.Item.Text
 
 
            Case "Increase Prices"
                RadWindowManager1.Windows(0).Title = "Increase Prices"
                RadWindowManager1.Windows(0).Height = 300
                RadWindowManager1.Windows(0).Width = 600
                RadWindowManager1.Windows(0).Left = 150
                RadWindowManager1.Windows(0).NavigateUrl = "~/UserControls/PartEditDialogs/IncreasePrice.aspx?sesKey=" + Server.HtmlEncode(strGUID)
                RadWindowManager1.Windows(0).VisibleOnPageLoad = True          
 
            Case "Do Multiple Operations"
 
        End Select
 
    End Sub
End Class




Here is the aspx page that opens up in the Radwindow.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="IncreasePrice.aspx.vb" Inherits="UserControls_PartEditDialogs_IncreasePrice" Theme="SkinFile" StylesheetTheme="SkinFile" %>
<style type="text/css">
    .auto-style1 {
        width: 348px;
    }
</style>
<telerik:RadCodeBlock runat="server" ID="RadCodeBlock2">
 
        <script type="text/javascript">
function GetRadWindow()  
    {  
       var oWindow = null;  
       if (window.radWindow) oWindow = window.radWindow;  
       else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
       return oWindow;  
    }  
</script>
 
    </telerik:RadCodeBlock>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            AsyncPostBackTimeout="3600"/>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        </telerik:RadAjaxManager>
        <telerik:RadProgressManager ID="RadProgressManager1" Runat="server" />
         
         
        <div>
 
            <table>
                <tr>
                    <td style="text-align: right">
                        <asp:Label ID="Label1" runat="server" SkinID="stdLabel" Text="Amount to add to Retail :"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbRetail" runat="server" Width="50px">0</asp:TextBox>
                    </td>
                    <td class="auto-style1">
                        <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="tbRetail" ErrorMessage="Please enter an amount between 0 and 1000" MaximumValue="1000" MinimumValue=".01"></asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        <asp:Label ID="Label2" runat="server" SkinID="stdLabel" Text="Amount to add to Wholesale :"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="tbWholesale" runat="server" Width="50px">0</asp:TextBox>
                    </td>
                    <td class="auto-style1">
                        <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="tbWholesale" ErrorMessage="Please enter an amount between 0 and 1000" MaximumValue="1000" MinimumValue=".01"></asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        <asp:Button ID="btnSetPrices" runat="server" Text="Adjust Prices" />
                    </td>
                    <td> </td>
                    <td class="auto-style1"> </td>
                </tr>
            </table>
 
        </div>
 
        <asp:PlaceHolder ID="phCloseWindow" runat="server">
            <script>
                var oWin = GetRadWindow();
                var parentWindow = oWin.BrowserWindow;
                oWin.close();
                parentWindow.refreshGrid();
                
            </script>
        </asp:PlaceHolder>
 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Width="600px" Height="300px" Runat="server" IsSticky="True" MinDisplayTime="1000" Skin="Default">
        </telerik:RadAjaxLoadingPanel>
        <div style="position:absolute;z-index:1000;top:10px;left:10px">
             <telerik:RadProgressArea ID="RadProgressArea1" runat="server" Skin="WebBlue" HeaderText="Current Progress" ProgressIndicators="FilesCountBar, CurrentFileName, TimeElapsed">
                   <Localization Uploaded="Uploaded" CurrentFileName="" UploadedFiles=""></Localization>
                </telerik:RadProgressArea>
        </div>
         
         
         
    </form>
</body>
</html>


Here is the code behind.

Imports Telerik.Web.UI
Imports System.Threading
 
Partial Class UserControls_PartEditDialogs_IncreasePrice
    Inherits System.Web.UI.Page
 
    Protected Sub UserControls_PartEditDialogs_IncreasePrice_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Not IsPostBack Then
            phCloseWindow.Visible = False
        End If
 
    End Sub
 
    Protected Sub btnSetPrices_Click(sender As Object, e As EventArgs) Handles btnSetPrices.Click
        Dim sesKey As String = Request.QueryString("sesKey")
        Dim invArray As Integer() = Session(sesKey)
        Dim bolSuccess As Boolean = True
        Dim strWarning As String = ""
 
        For Each intID As Integer In invArray
            Label1.Text += intID.ToString + vbCrLf
        Next
 
        Dim progress As RadProgressContext = RadProgressContext.Current
        progress.Speed = "N/A"
        progress.CurrentOperationText = "Part 1 of " + invArray.Count.ToString
        RadProgressArea1.Localization.CurrentFileName = "Re-Pricing Parts : "
        progress.OperationComplete = False
 
        Dim intProgress As Integer = 0
 
        For Each intInventoryID As Integer In invArray
            Thread.Sleep(1000)
            intProgress += 1
            progress.TimeEstimated = (invArray.Count - intProgress) * 100
            progress.CurrentOperationText = "Part " + intProgress.ToString() + " of " + invArray.Count.ToString
        Next
 
        phCloseWindow.Visible = bolSuccess
        progress.OperationComplete = True
 
    End Sub
End Class


Marin Bratanov
Telerik team
 answered on 10 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?