Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
33 views
Hello all,
           I am having a problem in radpanelbar particularly in IE9, The problem is whenever I made an Ajax Request using RadAjaxManager from client script. my RadPanelbar Items moves one step down automatically. Please find me the solution because I already spend LOT in this.

Here is my aspx page
................................................................................................................................................................................................................

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadPanelBarTester._Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .Tools
        {
            width: 120px;
            height: 20px;
            border: solid 1px blue;
            border-top:none;
            padding: 2px;
            margin: 4px;
            color: Black;
            font: normal 11.5px "Segoe UI", Arial, sans-serif;
            text-align: center;
            cursor: move;
            display:block;
            overflow:hidden;
            background-image:url('RootItemBg.png');
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            onajaxrequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadPanelBar1"/>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadPanelBar ID="RadPanelBar1" ExpandMode="SingleExpandedItem" Skin="Outlook"
            runat="server">
        </telerik:RadPanelBar>
        <asp:HiddenField ID="myHiddenField" runat="server" />
        <br />
        <input id="Button1" type="button" onclick="callsvr()" value="Test" />
    </div>
    </form>
    <script type="text/javascript">
        function callsvr() {
            $find("RadAjaxManager1").ajaxRequest("test");
        }
    </script>

</body>
</html>


My server side code
.....................................................................................................................................................................................................
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;
using System.Web.UI.HtmlControls;

namespace RadPanelBarTester
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                InitialzeToolBox();
            }
        }

        private void InitialzeToolBox()
        {
            for (int i = 0; i < 5; i++)
            {
                RadPanelItem radItem = new RadPanelItem("TAB TEST" + i);
                var motherDiv = new HtmlGenericControl("div");
                motherDiv.Attributes.Add("align", "center");
                for (int j = 0; j < 5; j++)
                {
                    HtmlGenericControl childDiv = new HtmlGenericControl("div");
                    childDiv.Attributes.Add("class", "Tools");
                    childDiv.Style.Add(HtmlTextWriterStyle.ZIndex, "2");
                    childDiv.InnerText = "TAB TEST" + i + "Tool" + j;
                    childDiv.ID = "TAB TEST" + i + "Tool" + j;
                    motherDiv.Controls.Add(childDiv);
                }
                RadPanelItem itemTemplate = new RadPanelItem();
                TemplateItem template = new TemplateItem(motherDiv);
                itemTemplate.ItemTemplate = template;
                radItem.Items.Add(itemTemplate);
                RadPanelBar1.Items.Add(radItem);
            }
            RadPanelBar1.Items.FindItemByText("TAB TEST0").Expanded = true;
        }

        protected override void OnLoad(EventArgs e)
        {
            for (int i = 0; i < RadPanelBar1.Items.Count; i++)
            {
                var motherDiv = new HtmlGenericControl("div");
                motherDiv.Attributes.Add("align", "center");
                for (int j = 0; j < 5; j++)
                {
                    HtmlGenericControl childDiv = new HtmlGenericControl("div");
                    childDiv.Attributes.Add("class", "Tools");
                    childDiv.InnerText = "TAB TEST" + i + "Tool" + j;
                    childDiv.ID = "TAB TEST" + i + "Tool" + j;
                    motherDiv.Controls.Add(childDiv);
                }
                RadPanelItem itemTemplate = new RadPanelItem();
                TemplateItem template = new TemplateItem(motherDiv);
                itemTemplate.ItemTemplate = template;
                RadPanelBar1.Items[i].Items.Add(itemTemplate);
            }
            base.OnLoad(e);
        }

        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
        }
    }
}


Template item class
............................................................................................................................................................................................

public class TemplateItem:ITemplate
    {
        Control control;
        #region ITemplate Members

        public void InstantiateIn(Control container)
        {
            container.Controls.Add(control);
        }

        #endregion

        public TemplateItem(Control ctrl)
        {
            control = ctrl;
        }
    }
Kate
Telerik team
 answered on 04 Aug 2011
1 answer
136 views
I have a radgrid with a popup to insert record and when I try inserting record(from entity) from my serverside , I can see that the grid has the value but the updatepanel would not refresh unless I hit the refresh button on grid. Is there any way I can force the radupdatepanel to refresh from serverside?
Please see the code below
<table id="NotesAndCommentsTable" border="1" style="border-collapse:collapse;border-color:Black;display:block;background-color:White" 
                            width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                 <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="true">
                                 <telerik:RadGrid ID="grdNotes" runat="server" Skin="WebBlue"  CssClass="RadGrid" GridLines="None"
                                    AllowPaging="True" PageSize="20" AllowSorting="True" AutoGenerateColumns="False"
                                    ShowStatusBar="true" HorizontalAlign="NotSet" OnNeedDataSource="grdNotes_NeedDataSource" OnInsertCommand="grdNotes_InsertCommand">
                                        <MasterTableView CommandItemDisplay="Bottom" DataKeyNames="ClaimUserNotes_IDX" EditMode="PopUp">
                                         <Columns>
                                               <telerik:GridBoundColumn UniqueName="DateCreated" HeaderText="Date" DataField="DateCreated">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn UniqueName="UserCreated" HeaderText="User" DataField="UserCreated">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn UniqueName="Notes" HeaderText="Notes/Comments" DataField="Notes">
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                        <EditFormSettings CaptionFormatString="Edit :"
                                            CaptionDataField="Claim_Idx" EditFormType="Template" >
                                            <FormTemplate>
                                                <table id="Table1"  style="border-collapse:collapse;border-color:Black;display:block;background-color:White" cellspacing="1" cellpadding="1" width="100%" border="0">
                                                    <tr>
                                                        <td>
                                                        </td>
                                                        <td>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Notes/Comments:
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="TextBox10" TextMode="MultiLine" width="300" Text='<%# Bind( "Notes") %>' runat="server">
                                                            </asp:TextBox>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <table style="width: 100%;border-collapse:collapse;border-color:Black;display:block;background-color:White" >
                                                    <tr>
                                                        <td align="right" colspan="2">
                                                            <asp:Button ID="Button1" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                                            </asp:Button
                                                            <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                                                            </asp:Button>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </FormTemplate>
                                        </EditFormSettings>
                                    </MasterTableView>
                                    <ClientSettings>
                                        <ClientEvents OnRowDblClick="RowDblClick" />
                                    </ClientSettings>
                                </telerik:RadGrid>
                            </telerik:RadAjaxPanel>
                                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
                                 </td>
                            </tr>
                        </table>
  and the .cs

 

 

protected void grdNotes_InsertCommand(object sender, GridCommandEventArgs e)

 

{

 

 

GridEditableItem dataItem = e.Item as GridEditableItem;

 

 

 

Hashtable values = new Hashtable();

 

dataItem.ExtractValues(values);

 

 

ClaimUserNotes un = new ClaimUserNotes();

 

un.Claim_IDX = claimId;

un.Notes = values[

 

"Notes"].ToString();

 

un.UserCreated = user.UserName;

un.DateCreated =

 

DateTime.Now;

 

entities.AddToClaimUserNotes(un);

entities.SaveChanges();

lstUserNotes = entities.ClaimUserNotes.Where(obj => obj.Claim_IDX == claimId).ToList();

 

grdNotes.Rebind();

}

Radoslav
Telerik team
 answered on 04 Aug 2011
11 answers
174 views
In our master page we have this ...
public string AjaxLoadingSkin
{
    get
    {
        string s = SkinManager.Skin ?? "Office2007";
        return String.Format("Telerik.Web.UI.Skins.{0}.Ajax.loading.gif", s);
    }
}
And this is in the master page's markup ...
<telerik:RadAjaxLoadingPanel IsSticky="true" ID="LoadingPanel1" runat="Server">
  <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, AjaxLoadingSkin) %>' style="border: 0;"/>
</telerik:RadAjaxLoadingPanel>
And this has worked just fine for a Donkey's age.

We upgraded to Q2 2011 yesterday and registered the new Telerik.Web.UI.Skins DLL and now the loading panel is showing incorrectly.

-- 
Stuart

Maria Ilieva
Telerik team
 answered on 04 Aug 2011
1 answer
135 views
I have tried everything from several post I've found on here about having the loading panel show on Load of Page. 
Post I've tried.
http://www.telerik.com/help/aspnet/ajax/ajxshowloadingpaneloninitialpageload.html

Can anyone look at the code below and let me know what I'm doing incorrect?

<%

@ Page Language="C#" AutoEventWireup="true" CodeBehind="OpenItemsInventory.aspx.cs"

 

 

Inherits="Sterling.SNEF.Tax.Web.OpenItemsInventory" %>

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml">

 

<

 

head runat="server">

 

 

<title>Open Items Inventory</title>

 

 

<style type="text/css">

 

 

.RadGrid_Web20 .rgCommandRow

 

{

 

color: #35467C !important;

 

}

 

</style>

 

</

 

head>

 

<

 

telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

<script type="text/javascript">

 

 

var rad_val;

 

 

function pageLoad(sender, eventArgs) {

 

 

if (!eventArgs.get_isPartialLoad()) {

 

$find(

"<%= RadAjaxManager1.ClientID %>").ajaxRequest("InitialPageLoad");

 

}

}

 

 

function onFutureInventory(sender, args) {

 

document.getElementById(

'<%= btnFutureInventory.ClientID %>').disabled = true;

 

 

GetRadioValue();

 

var windowURL = "FutureInventoryDialog.aspx?ViewByType=" + rad_val

 

 

var oWnd = $find("<%= dlgFutureInventory.ClientID%>");

 

oWnd.setUrl(windowURL);

oWnd.SetSize(470, 505);

oWnd.show();

oWnd.set_initialBehaviors(Telerik.Web.UI.WindowBehaviors.Close);

oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);

oWnd.SetModal(

true);

 

 

}

 

 

function GetRadioValue()

 

{

message =

"";

 

surplusMessage =

"";

 

 

 

if (document.getElementById('<%= rdoAssignee.ClientID %>').checked)

 

{

rad_val =

"Assignee";

 

}

 

else

 

{

rad_val =

"State";

 

}

}

 

 

function onFutureInventoryClose(sender, eventArgs) {

 

document.getElementById(

'<%= btnFutureInventory.ClientID %>').disabled = false;

 

}

 

 

function onRequestStart(sender, args)

 

{

 

if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0)

 

{

args.set_enableAjax(

false);

 

}

}

 

 

</script>

 

</

 

telerik:RadCodeBlock>

 

<

 

body>

 

 

<form id="form1" runat="server">

 

 

<telerik:RadScriptManager ID="OpenItemsInventoryScriptManager" runat="server">

 

 

</telerik:RadScriptManager>

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<ClientEvents OnRequestStart="onRequestStart" />

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="Panel1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="LoadingPanel" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadWindow ID="dlgFutureInventory" runat="server" Skin="Web20" EnableViewState="False"

 

 

KeepInScreenBounds="True" ReloadOnShow="True" ShowContentDuringLoad="False" VisibleStatusbar="False"

 

 

Behaviors="None" OnClientClose="onFutureInventoryClose" onclientOverlay="True">

 

 

</telerik:RadWindow>

 

 

<telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server" Skin="Web20">

 

 

</telerik:RadAjaxLoadingPanel>

 

 

<asp:Panel ID="Panel1" runat="server">

 

 

<asp:Panel ID="Panel2" Visible="false" runat="server">

 

 

<asp:Label ID="lblLenders" runat="server" Font-Bold="True" Text="Lenders:" Font-Names="Arial"></asp:Label>

 

 

<asp:Label ID="Label3" runat="server" Font-Bold="True" Text="Lenders:" Font-Names="Arial"></asp:Label>

 

 

<br />

 

 

<asp:Label ID="lblViewBy" runat="server" Font-Bold="True" Text="View By:" Font-Names="Arial"></asp:Label>

 

 

<asp:RadioButton ID="rdoAssignee" runat="server" Text="Assignee" GroupName="ViewByGroup"

 

 

OnCheckedChanged="ViewByGroup_CheckedChanged" Checked="true" AutoPostBack="true"

 

 

Font-Names="Arial" Font-Size="Smaller" />&nbsp;&nbsp;

 

 

<asp:RadioButton ID="rdoState" runat="server" Text="State" GroupName="ViewByGroup"

 

 

OnCheckedChanged="ViewByGroup_CheckedChanged" AutoPostBack="true" Font-Names="Arial"

 

 

Font-Size="Smaller" />

 

 

<br />

 

 

<br />

 

 

<div style="border: thin solid #5177B5; left: 5px; position: relative; left: 5px;

 

 

width: 760px;">

 

 

<table border="1" width="760px" style="border-collapse: collapse;">

 

 

<tr>

 

 

<td align="center" style="width: 145px; background-color: #7FA5D7;">

 

 

<asp:Label ID="lblhdrAssignee" runat="server" Text="Assignee" Font-Bold="True" Font-Names="Arial"

 

 

Font-Size="12px" ForeColor="White"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px; background-color: #7FA5D7;">

 

 

<asp:Label ID="Label2" runat="server" Text="Jurisdictions" Font-Bold="True" Font-Names="arial,sans-serif"

 

 

Font-Size="12px" ForeColor="White"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px; background-color: #7FA5D7;">

 

 

<asp:Label ID="Label6" runat="server" Text="Prior Open Items" Font-Bold="True" Font-Names="Arial"

 

 

Font-Size="12px" ForeColor="White"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px; background-color: #7FA5D7;">

 

 

<asp:Label ID="Label7" runat="server" Text="Current Open Items" Font-Bold="True"

 

 

Font-Names="Arial" Font-Size="12px" ForeColor="White"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 110px; background-color: #7FA5D7;">

 

 

<asp:Label ID="Label4" runat="server" Text="Items Left to Pay" Font-Bold="True" Font-Names="Arial"

 

 

Font-Size="12px" ForeColor="White"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px; background-color: #7FA5D7;">

 

 

<asp:Label ID="Label5" runat="server" Text="% Complete" Font-Bold="True" Font-Names="Arial"

 

 

Font-Size="12px" ForeColor="White"></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td align="center" style="width: 150px;">

 

 

<asp:Label ID="Label1" runat="server" Text="Totals" Font-Bold="True" Font-Names="Arial"

 

 

Font-Size="12px"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px;">

 

 

<asp:Label ID="lblhdrJurisdictions" runat="server" Font-Names="arial,sans-serif"

 

 

Font-Size="12px"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px;">

 

 

<asp:Label ID="lblhdrPrior" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px;">

 

 

<asp:Label ID="lblhdrCurrent" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px;">

 

 

<asp:Label ID="lblhdrItemsLeft" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>

 

 

</td>

 

 

<td align="center" style="width: 100px;">

 

 

<asp:Label ID="lblhdrPctComplete" runat="server" Font-Names="arial,sans-serif" Font-Size="12px"></asp:Label>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</div>

 

 

<br />

 

 

<table>

 

 

<tr>

 

 

<td>

 

 

<asp:Label ID="lblCurrentandPrior" runat="server" Font-Bold="True" Font-Size="Large"

 

 

Font-Names="Arial">Current and

 

Prior Inventory by Assignee

</asp:Label>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

<table>

 

 

<tr>

 

 

<td colspan="3">

 

 

<telerik:RadGrid ID="grdCurrentandPrior" runat="server" AllowSorting="True" AutoGenerateColumns="False"

 

 

GridLines="Horizontal" Skin="Web20" Style="margin-right: 0px" Width="780px" Height="255px"

 

 

OnNeedDataSource="grdCurrentandPrior_NeedDataSource" OnExcelMLExportRowCreated="grdCurrentandPrior_ExcelMLExportRowCreated">

 

 

<ExportSettings FileName="OpenItemsCurrentInventory" IgnorePaging="True" OpenInNewWindow="True"

 

 

ExportOnlyData="true" Excel-Format="ExcelML">

 

 

</ExportSettings>

 

 

<MasterTableView CommandItemDisplay="Bottom" AllowNaturalSort="false" UseAllDataFields="true">

 

 

<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"

 

 

ShowRefreshButton="false" />

 

 

<Columns>

 

 

<telerik:GridTemplateColumn DataField="Assignee" HeaderText="Assignee" UniqueName="Assignee"

 

 

SortExpression="Assignee">

 

 

<HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />

 

 

<ItemTemplate>

 

 

<asp:Label ID="lbAssignee" runat="server" Text='<%# Eval("Assignee") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<FooterStyle HorizontalAlign="Right" Font-Bold="true" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn DataField="State" HeaderText="State" UniqueName="State"

 

 

SortExpression="State" Visible="false">

 

 

<HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />

 

 

<ItemTemplate>

 

 

<asp:Label ID="lbState" runat="server" Text='<%# Eval("State") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<FooterStyle HorizontalAlign="Right" Font-Bold="true" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn DataField="JurisdictionCount" HeaderText="Jurisdictions"

 

 

UniqueName="JurisdictionCount" SortExpression="JurisdictionCount">

 

 

<HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" />

 

 

<ItemTemplate>

 

 

<asp:Label ID="lbJurisdiction" runat="server" Text='<%# Eval("JurisdictionCount", "{0:N0}")%>'></asp:Label>

 

 

</ItemTemplate>

 

 

<ItemStyle HorizontalAlign="Right" ForeColor="Black" />

 

 

<FooterStyle HorizontalAlign="Right" Font-Bold="true" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn DataField="OpenItemsCountPrior" HeaderText="Prior Open Items"

 

 

UniqueName="OpenItemsCountPrior" SortExpression="OpenItemsCountPrior">

 

 

<HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" />

 

 

<ItemTemplate>

 

 

<asp:Label ID="lbPrior" runat="server" Text='<%# Eval("OpenItemsCountPrior", "{0:N0}") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<ItemStyle HorizontalAlign="Right" ForeColor="Black" />

 

 

<FooterStyle HorizontalAlign="Right" Font-Bold="true" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn DataField="OpenItemsCountCurrent" HeaderText="Current Open Items"

 

 

UniqueName="OpenItemsCountCurrent" SortExpression="OpenItemsCountCurrent">

 

 

<HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" />

 

 

<ItemTemplate>

 

 

<asp:Label ID="lbCurrent" runat="server" Text='<%# Eval("OpenItemsCountCurrent", "{0:N0}") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<ItemStyle HorizontalAlign="Right" ForeColor="Black" />

 

 

<FooterStyle HorizontalAlign="Right" Font-Bold="true" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn DataField="TotalRemainingItems" HeaderText="Items Left to Pay"

 

 

UniqueName="TotalRemainingItems" SortExpression="TotalRemainingItems">

 

 

<HeaderStyle Font-Bold="True" Width="105px" HorizontalAlign="Center" Font-Names="Arial" />

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblTotalRemain" runat="server" Text='<%# Eval("TotalRemainingItems", "{0:N0}") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

<ItemStyle HorizontalAlign="Right" ForeColor="Black" />

 

 

<FooterStyle HorizontalAlign="Right" Font-Bold="true" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn DataField="PercentComplete" HeaderText="% Complete" UniqueName="clmPctComplete"

 

 

SortExpression="PercentComplete">

 

 

<HeaderStyle Font-Bold="True" HorizontalAlign="Center" Font-Names="Arial" />

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblPctComplete" runat="server" Text='<%# Eval("PercentComplete", "{0:F2}%")%>'></asp:Label>

 

 

</ItemTemplate>

 

 

<ItemStyle HorizontalAlign="Right" ForeColor="Black" />

 

 

<FooterStyle HorizontalAlign="Right" Font-Bold="true" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="AssigneeEmployeeKey" ReadOnly="True" UniqueName="AssigneeEmployeeKey"

 

 

Visible="False">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<HeaderStyle BorderStyle="Solid" />

 

 

<ClientSettings>

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

<br />

 

 

<table>

 

 

<tr>

 

 

<td>

 

 

<asp:Button ID="btnFutureInventory" runat="server" Text="Future Inventory" SkinID="Web20"

 

 

OnClientClick="onFutureInventory(); return false;" Width="164px" UseSubmitBehavior="false" />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</asp:Panel>

 

 

</asp:Panel>

 

 

</form>

 

</

 

body>

 

</

 

html>

 





.cs File

using

 

System;

 

using

 

System.Collections;

 

using

 

System.Collections.Generic;

 

using

 

System.Configuration;

 

using

 

System.Data;

 

using

 

System.Linq;

 

using

 

System.Web;

 

using

 

System.Web.Security;

 

using

 

System.Web.UI;

 

using

 

System.Web.UI.HtmlControls;

 

using

 

System.Web.UI.WebControls;

 

using

 

System.Web.UI.WebControls.WebParts;

 

using

 

System.Xml.Linq;

 

using

 

Sterling.SNEF.Core;

 

using

 

Sterling.SNEF.Tax.Entity;

 

using

 

Sterling.SNEF.Tax.Service;

 

using

 

Telerik.Web.UI;

 

using

 

Telerik.Web.UI.GridExcelBuilder;

 

 

namespace

 

Sterling.SNEF.Tax.Web

 

{

 

public partial class OpenItemsInventory : OpenItemsBasePage

 

{

 

public OpenItemsInventory()

 

{ }

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

BaseLogger.LogInfo(System.Reflection.MethodBase.GetCurrentMethod().Name);

 

 

RadAjaxManager.GetCurrent(this.Page).AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);

 

 

if (!Page.IsPostBack)

 

{

GetInventoryHeaderData();

GetCurrentandPriorbyAssigneeData();

ViewByGroup_CheckedChanged(rdoAssignee, e);

 

}

}

 

 

protected void ViewByGroup_CheckedChanged(object sender, EventArgs e)

 

{

 

try

 

{

 

if (rdoAssignee.Checked == true)

 

{

lblhdrAssignee.Text =

"Assignee";

 

lblCurrentandPrior.Text =

"Current and Prior Inventory by Assignee";

 

GetCurrentandPriorbyAssigneeData();

grdCurrentandPrior.MasterTableView.Columns[0].Visible =

true;

 

grdCurrentandPrior.MasterTableView.Columns[1].Visible =

false;

 

}

 

else

 

{

lblhdrAssignee.Text =

"State";

 

lblCurrentandPrior.Text =

"Current and Prior Inventory by State";

 

GetCurrentandPriorbyStateData();

grdCurrentandPrior.MasterTableView.Columns[0].Visible =

false;

 

grdCurrentandPrior.MasterTableView.Columns[1].Visible =

true;

 

}

}

 

catch (Exception ex)

 

{

 

BaseLogger.LogError("OpenItemsInventory.ViewByGroup_CheckedChanged Error : " + ex.Message);

 

 

throw;

 

}

}

 

//Method retrieves Inventory Header Counts and populates the fields.

 

 

protected void GetInventoryHeaderData()

 

{

 

try

 

{

 

BaseLogger.LogInfo(System.Reflection.MethodBase.GetCurrentMethod().Name);

 

 

var invSvc = new InventoryService(Convert.ToInt16(base.CurrentEnvironment.OrganizationId));

 

 

var invSvcResult = invSvc.GetInventoryHeader(CurrentEnvironment.EmployeeKey);

 

 

if (invSvcResult != null)

 

{

 

//lblhdrJurisdictions.Text = Convert.ToString(invSvcResult.JurisdictionCount,);

 

lblhdrJurisdictions.Text = invSvcResult.JurisdictionCount.ToString(

"N0");

 

lblhdrPrior.Text = invSvcResult.OpenItemsCountPrior.ToString(

"N0");

 

lblhdrCurrent.Text = invSvcResult.CurrentItems.ToString(

"N0");

 

lblhdrItemsLeft.Text = invSvcResult.TotalRemainingItems.ToString(

"N0");

 

lblhdrPctComplete.Text = invSvcResult.PercentComplete.ToString(

"P2");

 

}

 

else

 

 

BaseLogger.LogWarn("Inventory header is empty.");

 

}

 

catch (Exception ex)

 

{

 

BaseLogger.LogError("OpenItemsInventory.GetInventoryHeaderData Error : " + ex.Message);

 

 

throw;

 

}

}

 

public void GetCurrentandPriorbyAssigneeData()

 

{

 

try

 

{

 

BaseLogger.LogInfo(System.Reflection.MethodBase.GetCurrentMethod().Name);

 

 

InventoryService invSvc = new InventoryService(Convert.ToInt16(CurrentEnvironment.OrganizationId));

 

 

List<InventorySummary> InventoryResult;

 

InventoryResult = invSvc.GetInventorySummaryByAssignee(CurrentEnvironment.EmployeeKey);

 

if (InventoryResult != null && InventoryResult.Count > 0)

 

{

grdCurrentandPrior.DataSource = InventoryResult;

grdCurrentandPrior.DataBind();

 

InventorySessionState.CurrentSessionState.InventorySummaryByAssignee = InventoryResult;

 

}

 

else

 

{

 

BaseLogger.LogWarn("Inventory summary is empty.");

 

 

InventorySessionState.CurrentSessionState.InventorySummaryByAssignee = null;

 

grdCurrentandPrior.DataSource =

new string[] { };

 

grdCurrentandPrior.Rebind();

}

}

 

catch (Exception ex)

 

{

 

BaseLogger.LogError("OpenItemsInventory.GetCurrentandPriorbyAssigneeData Error : " + ex.Message);

 

 

throw;

 

}

}

 

public void GetCurrentandPriorbyStateData()

 

{

 

try

 

{

 

BaseLogger.LogInfo(System.Reflection.MethodBase.GetCurrentMethod().Name);

 

 

InventoryService invSvc = new InventoryService(Convert.ToInt16(CurrentEnvironment.OrganizationId));

 

 

List<InventorySummary> InventoryResult;

 

InventoryResult = invSvc.GetInventorySummaryByState(CurrentEnvironment.EmployeeKey);

 

if (InventoryResult != null && InventoryResult.Count > 0)

 

{

grdCurrentandPrior.DataSource = InventoryResult;

grdCurrentandPrior.DataBind();

 

InventorySessionState.CurrentSessionState.InventorySummaryByState = InventoryResult;

 

}

 

else

 

{

 

InventorySessionState.CurrentSessionState.InventorySummaryByState = null;

 

grdCurrentandPrior.DataSource =

new string[] { };

 

grdCurrentandPrior.Rebind();

}

}

 

catch (Exception ex)

 

{

 

BaseLogger.LogError("OpenItemsInventory.GetCurrentandPriorbyStateData Error : " + ex.Message);

 

 

throw;

 

}

}

 

protected void grdCurrentandPrior_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 

{

 

BaseLogger.LogInfo(System.Reflection.MethodBase.GetCurrentMethod().Name);

 

 

try

 

{

 

if (rdoAssignee.Checked == true)

 

{

 

if (InventorySessionState.CurrentSessionState.InventorySummaryByAssignee == null)

 

{

GetCurrentandPriorbyAssigneeData();

}

 

else

 

{

grdCurrentandPrior.DataSource =

InventorySessionState.CurrentSessionState.InventorySummaryByAssignee;

 

}

}

 

else

 

{

 

if (InventorySessionState.CurrentSessionState.InventorySummaryByState == null)

 

{

GetCurrentandPriorbyStateData();

}

 

else

 

{

grdCurrentandPrior.DataSource =

InventorySessionState.CurrentSessionState.InventorySummaryByState;

 

}

}

}

 

catch (Exception ex)

 

{

 

BaseLogger.LogError("OpenItemsInventory.grdCurrentandPrior_NeedDataSource Error : " + ex.Message);

 

 

throw;

 

}

}

 

protected void grdCurrentandPrior_ExcelMLExportRowCreated(object source, GridExportExcelMLRowCreatedArgs e)

 

{

 

Int32 JurisdictionCount = 0;

 

 

Int32 OpenItemsCountPrior = 0;

 

 

Int32 OpenItemsCountCurrent = 0;

 

 

Int32 TotalRemainingItems = 0;

 

 

 

foreach (GridDataItem item in grdCurrentandPrior.MasterTableView.Items)

 

{

 

Label jc = (Label)item.FindControl("lbJurisdiction");

 

JurisdictionCount +=

Int32.Parse(jc.Text.Replace(",", "").Trim());

 

 

Label oipc = (Label)item.FindControl("lbPrior");

 

OpenItemsCountPrior +=

Int32.Parse(oipc.Text.Replace(",", "").Trim());

 

 

Label oicc = (Label)item.FindControl("lbCurrent");

 

OpenItemsCountCurrent +=

Int32.Parse(oicc.Text.Replace(",", "").Trim());

 

 

Label tr = (Label)item.FindControl("lblTotalRemain");

 

TotalRemainingItems +=

Int32.Parse(tr.Text.Replace(",", "").Trim());

 

 

}

 

if (e.Worksheet.Table.Rows.Count == grdCurrentandPrior.Items.Count + 1)

 

{

 

RowElement row = new RowElement();

 

 

GridFooterItem footer = (source as RadGrid).MasterTableView.GetItems(GridItemType.Footer)[0] as GridFooterItem;

 

 

foreach (GridColumn column in (source as RadGrid).MasterTableView.Columns)

 

{

 

CellElement cell = new CellElement();

 

 

string cellText = "";

 

 

if ((column.UniqueName == "Assignee") && (rdoAssignee.Checked == true))

 

cellText =

"Totals";

 

 

else

 

{

 

if ((column.UniqueName == "State") && (rdoState.Checked == true))

 

cellText =

"Totals";

 

}

 

if (column.UniqueName == "JurisdictionCount")

 

cellText = JurisdictionCount.ToString();

 

if (column.UniqueName == "OpenItemsCountPrior")

 

cellText = OpenItemsCountPrior.ToString();

 

if (column.UniqueName == "OpenItemsCountCurrent")

 

cellText = OpenItemsCountCurrent.ToString();

 

if (column.UniqueName == "TotalRemainingItems")

 

cellText = TotalRemainingItems.ToString();

 

if (cellText != "")

 

{

cell.Data.DataItem = cellText ==

"&nbsp;" ? "" : cellText;

 

row.Cells.Add(cell);

}

}

e.Worksheet.Table.Rows.Add(row);

}

}

 

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)

 

{

 

if (e.Argument == "InitialPageLoad")

 

{

 

//simulate longer page load

 

 

//System.Threading.Thread.Sleep(2000);

 

Panel2.Visible =

true;

 

}

}

 

}

}



I would really like the LoadingPanel to show on Page Load and then disappear when page had completed loading.

Thanks
Kristi
Shinu
Top achievements
Rank 2
 answered on 04 Aug 2011
1 answer
111 views

Hello.

In the web application I am developing, RadScheduler is used to display appointments users can join in.
Since users are not allowed to create appointments, property AllowInsert has been set to "False".

I would like to add the following features to the application:

1) If a time slot is double-clicked and there is no appointment associated with it, a message should be displayed stating that only existing appointments can be selected.

2) If a time slot is double-clicked and there is an appointment associated with it, a series of web service calls should be made in order to identify if the user is eligible to join the appointment.
If any of the conditions fails, a message should be displayed stating the reason(s) the user cannot join the appointment.

3) If a time slot is double-clicked, there is an appointment associated with it, and the conditions checked in step #2 are satisfied, the user should be allowed to join the appointment.
In this case, a form should be displayed with read-only fields, like the description and date/time of the appointment.
In addition, input fields should be displayed so that the user can provide additional information associated with the appointment.
After entering all information, the user should join the appointment after clicking Save.

I would appreciate whether some guidelines could be provided in order to implement these features.

Thank you in advance.
Paulo

Plamen
Telerik team
 answered on 04 Aug 2011
1 answer
49 views
Hi,

Brand new to Telerik controls and setting up a demo. I'd like to be able to click on a link in a row of Radgrid and have that open another grid preferably on a new page but ok if on same page. Is this doable?

Kind of like Master/Detail style.

Thanks!! 
Princy
Top achievements
Rank 2
 answered on 04 Aug 2011
1 answer
86 views
Hello,

I want to know how to populate a dropdownlist when I double click in my grid. I use ( http://www.telerik.com/help/aspnet-ajax/grid-operations-with-dropdownlist-in-edititemtemplate.html ) for populating it in edit mode but I don't know how to do it when i double click in my grid, which is made like the Batch update example. Any ideas? (I can't use a sqlDataSource, I pass an Object in server side)
Thank you very much
Pavlina
Telerik team
 answered on 04 Aug 2011
1 answer
108 views
I'm trying to simulate a bullet chart with a radrating control.  What I need is the individual items in the control to not have space between them.  I need the rating control to look like one solid image.  I don't see any attributes on the control to do this, is there any CSS that might help?

Thanks,
Jamie
Bozhidar
Telerik team
 answered on 04 Aug 2011
1 answer
84 views
Hello, what i need for this radalert is when I clicked on the button. If the textbox is nothing, it will alert that textbox is empty and if there's something in the textbox , it will prompt that upload success.

How can i achieve that? 

Thanks
Princy
Top achievements
Rank 2
 answered on 04 Aug 2011
2 answers
159 views
Hello,

I've noticed a buggy behaviour using Telerik RadTabStrip inside ASP.NET FormView. First of all, I tried to create an example without FormView and everything worked fine. Then I put RadTabStrip and RadMultiPage inside EditItemTemplate of FormView and a problem occured.

I have 3 tabs, and when I set one of them Visible to false in Page.PreRender event, for the first time, the tab is not rendered. But after postback, even though the value is correctly loaded from viewstate and the Visible property is false (according to debugger), the tab is unexpectably rendered.

Here is the code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestTabStrip.Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:FormView ID="fvSystemConfig" DefaultMode="Edit" DataSourceID="odsDS" RenderOuterTable="false" runat="server">
            <EditItemTemplate>
                <telerik:RadTabStrip ID="rts" runat="server" MultiPageID="rmp">
                    <Tabs>
                        <telerik:RadTab Text="Core" PageViewID="rpv1" />
                        <telerik:RadTab Text="UI" PageViewID="rpv2" />
                        <telerik:RadTab Text="Export" PageViewID="rpv3" />
                    </Tabs>
                </telerik:RadTabStrip>
                <telerik:RadMultiPage ID="rmp" SelectedIndex="0" CssClass="RadTabStripMultipage" runat="server">
                    <telerik:RadPageView ID="rpv1" runat="server">
                        <asp:TextBox ID="tb" Text='<%# Bind("Name") %>' runat="server" />
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="rpv2" runat="server">
                        B
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="rpv3" runat="server">
                        C
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
                <asp:Button ID="Button1" CommandName="Update" Text="Save" runat="server" />
            </EditItemTemplate>
        </asp:FormView>
        <asp:ObjectDataSource ID="odsDS" runat="server" SelectMethod="GetData" TypeName="TestTabStrip.Default" UpdateMethod="UpdateData" />
    </div>
    </form>
</body>
</html>

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;
using System.Collections;
 
namespace TestTabStrip
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected override void OnPreRender(EventArgs e)
        {
            ((RadTabStrip)fvSystemConfig.Row.FindControl("rts")).Tabs[1].Visible = false;
            base.OnPreRender(e);
        }
 
        public IEnumerable GetData()
        {
            return new List<object> { new { Name = "testing text" } };
        }
 
        public void UpdateData(string name)
        {
        }
    }
}

The version that I am using is 2010 Q3. Please let me know, if the bug has been repaired in the newer version, but in the very moment, I cannot test it in newer one.

Thank you for your response.

Best regards,
    LeoÅ¡
Leoš
Top achievements
Rank 1
 answered on 04 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?