Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
65 views
I want to expand child grid in heriarchical grid when some items are drag on it.

Could you please provide solution  ?

Pavlina
Telerik team
 answered on 04 Aug 2011
4 answers
202 views
Hi,

I am populating the radgrid by attaching a datasource where I have a dropdownlist in it.  My code goes something like mentioned below.

the value of the designation for the datasource from database has something like L1, L2, L3........

So I want to set the dropdown for the designation of the employee .

Ex :
EmployeeID=1
EmployeeName="safar"
EmpDesignation="L2"

So the dropdown should set to Level2 for the employeeid 1 and so on. I assume it can be done in ItemBound.

         <telerik:RadGrid ID="EmployeeGrid" runat="server"
                    AutoGenerateColumns="False" Width="455px"
                    onitemdatabound="EmployeeGrid_ItemDataBound" >
                    <ClientSettings AllowDragToGroup="True">
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                        <Selecting AllowRowSelect="True"></Selecting>
                    </ClientSettings>
                    <MasterTableView AllowFilteringByColumn="False">
                        <Columns>
                            <telerik:GridBoundColumn ReadOnly="true" ItemStyle-Width="150px"  HeaderText="Employee Id"
                             DataField="EmployeeId"><ItemStyle Width="150px" ></ItemStyle>
                             </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn ReadOnly="true"  HeaderText="Employee Name"
                            DataField="EmployeeName" ItemStyle-Width="150px"><ItemStyle Width="150px"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText ="Designation" Visible="true">
                                <ItemTemplate>
                                     <asp:DropDownList ID="DesignationDropdownList" runat="server" >
                                        <asp:ListItem Text="Level1" Value="1"/>
                                        <asp:ListItem Text="Level2" Value="2"/>
                                        <asp:ListItem Text="Level3" Value="3"/>
                                        <asp:ListItem Text="Level4" Value="4"/>
                                     </asp:DropDownList>
                         </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>

                </telerik:RadGrid>
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 Aug 2011
1 answer
134 views
Hi

I set the Date Time picker invalid style to my own custom class and it keeps insisting to use the default
:html body .RadInput_Default .riError, html body .RadInput_Error_Default

I override the RadDateTimePicker and set the class on the init

 protected override void OnInit(EventArgs e)
 {
DateInput.InvalidStyle.CssClass = "dateInputInvalid";
}

I use the following client side code to set the input invalid

fieldObj.get_dateInput()._invalid = true;
fieldObj.get_dateInput().updateCssClass();

Any Ideas what could be causing this?

Thanks
Rafal
Tsvetina
Telerik team
 answered on 04 Aug 2011
5 answers
102 views
Hello Telerik Team,
I am using RadDateTime Picker Control now i would like render this control based on some Criteria.
first If WeekDay of Selected Date is M-F then generate timeSlot 5:30 PM,8:30 PM in TimePicker
Second if its Saturday then 12:30 P.M. etc and Third if its sunday then some other timeslot.

Last i want to gray out all Past Date from CurrentDate so user cant select past Date

Please advise

Thank
Ronak
Tsvetina
Telerik team
 answered on 04 Aug 2011
3 answers
66 views
Hey Guys,
I've just updated our Telerik DLL to version 2011.2 712.
Now in a radScheduler that was working fine previously, no time slots are showing up when it loads in.
Only the "All Day" slot shows, followed by the "Show 24 hours" bar.
If I click "Show 24 Hours" they all appear.
Going back to business hours, the also appear just fine.
If I navigate days, they all appear on subsequent navigations
It seems it is the initial load which is blank.
The error does not appear to present with IE8.
My Firefox version is 3.6.18

Do you think this is a bug or am I needing to do something differently with my scheduler set up for the newer version?

thanks
Mark.
Nikolay Tsenkov
Telerik team
 answered on 04 Aug 2011
1 answer
135 views
Hi Friends,

I have two radgrids.

On click of a movebutton i am moving items from grid1 to grid2. and on click of removebutton the selected item from grid2 will be moved to grid1.
This will happen only on clientside and doesnot effect my database untill i click on Savebutton.

This should happen using ajax call.

Can anyone provide me any link or sample code for this?

Thanks,
Tsvetina
Telerik team
 answered on 04 Aug 2011
1 answer
81 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
161 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
230 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
170 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?