or

var panel = $find('RadPanelBar');var rootItem = panel.findItemByText("RootItem");for (var i = 0; i < array.length; i++) { var item = new Telerik.Web.UI.RadPanelItem(); item.set_text(array[i].someText); panel.trackChanges(); rootItem.get_items().add(item); panel.commitChanges(); }<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="100%" Height="600px"> <Items> <telerik:RadPanelItem runat="server" Text="TestRoot" Expanded="True"> <Items> <telerik:RadPanelItem Text="TestChild"> </telerik:RadPanelItem> </Items> </telerik:RadPanelItem> </Items> </telerik:RadPanelBar><%@ Master Language="C#" AutoEventWireup="true" CodeFile="Main1.master.cs" Inherits="Main1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <link rel="stylesheet" href="~/css/style.css" /> <script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script> <script type="text/javascript">jQuery.noConflict();</script> <asp:ContentPlaceHolder id="ContentHead" runat="server"> </asp:ContentPlaceHolder></head><body> <div id="wrapper"> <form id="form1" runat="server"> <asp:Literal ID="test1" runat="server"></asp:Literal> <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> <div class="headercon"> <asp:Panel id="header" CssClass="header" runat="server"> <asp:HyperLink ID="HyperLink1" NavigateUrl="~/?reset=global" runat="server"> <div class="logo"> </div> </asp:HyperLink> <div class="fascia"></div> <div class="topmenu"> <ul> <li class="on"><asp:HyperLink ID="HyperLink2" NavigateUrl="~/" runat="server">Dashboard</asp:HyperLink></li> <li class="list"> <asp:Label ID="LabelFascia" runat="server" AssociatedControlID="FasciaDropDown" Text="Fascia" /> <telerik:RadComboBox ID="FasciaDropDown" runat="server" Width="140px" AutoPostBack="True" OnSelectedIndexChanged="Fascia_SelectedIndexChanged" /> </li> <li><asp:HyperLink ID="HyperLink3" NavigateUrl="~/Edit/Default.aspx" runat="server">Style</asp:HyperLink></li> <li><asp:HyperLink ID="HyperLink4" NavigateUrl="~/Reports/Default.aspx" runat="server">Reports</asp:HyperLink></li> <li><asp:HyperLink ID="HyperLink5" NavigateUrl="~/Admin/Default.aspx" runat="server">Admin</asp:HyperLink></li> </ul> </div> </asp:Panel> </div> <div class="content"> <asp:Panel id="breadcrumbs" runat="server"></asp:Panel> <asp:ContentPlaceHolder id="ContentMain" runat="server"> </asp:ContentPlaceHolder> </div> <div class="footer"> </div> </form> </div></body></html><%@ Page Title="" Language="C#" MasterPageFile="~/Main1.master" AutoEventWireup="true" CodeFile="CategorySelection.aspx.cs" Inherits="CategoryEditor" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentHead" Runat="Server"> <script type="text/javascript"> //<!-- function nodeDropping(sender, args) { // set target to the element on which the node is dropped var target = args.get_htmlElement(); // check whether target is in the panel or tree view // by working up the parent chain to a known element try { while (target) { var targetID = target.id; var className = target.className; // we reached the tree view -- this is a good target if (targetID == "<%# RadTreeView1.ClientID %>") return; // the "between nodes" lines are not actually in the tree view, // but they have class names that begin "rtDrop" else if (className.startsWith("rtDrop")) return; // we are inside the panel -- this is a good target else if (targetID == "<%# Panel1.ClientID %>") { args.set_htmlElement(target); return; } target = target.parentNode; } } catch (e) { } // we were not in a good target, cancel the drop args.set_cancel(true); } function nodeCheck(sender, args) { var target = args.get_selectedNodes(); } function nodetest() { var tree = $find("<%= RadTreeView1.ClientID %>"); var allNodes = tree.get_nodes().getNode(0).get_allNodes(); for (var i = 0; i < allNodes.length; i++) { var node = allNodes[i]; alert(node.get_text()); } } jQuery(document).ready(function () { nodetest(); }); //--> </script></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" Runat="Server"> <h1>Category Editor</h1> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> <asp:Label ID="treeSearchLabel" runat="server">Refine</asp:Label> <asp:TextBox ID="treeSearch" runat="server"></asp:TextBox> <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"> <telerik:RadTreeView ID="RadTreeView1" runat="server" EnableDragAndDrop="true" OnNodeDrop="TreeView_NodeDrop" OnClientNodeDropping="nodeDropping" TriStateCheckBoxes="true" CheckBoxes="true" CheckChildNodes="false" > <Nodes> </Nodes> </telerik:RadTreeView> </telerik:RadAjaxPanel> <asp:Panel ID="Panel1" runat="server" ForeColor="#7799FF" BorderColor="#7799FF" BorderStyle="Double" BorderWidth="4px" GroupingText="Details" > <asp:Label ID="Label1" runat="server" ></asp:Label> <asp:Label ID="WhatsChecked" runat="server" ></asp:Label> </asp:Panel> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadTreeView1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadTreeView1" /> <telerik:AjaxUpdatedControl ControlID="Panel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager></asp:Content>protected void WeeklyGoalsGrid_PreRender(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); foreach (GridGroupHeaderItem item in WeeklyGoalsGrid.MasterTableView.GetItems(GridItemType.GroupHeader)) { sb.Append(item.GroupIndex); } }<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="ObjectDataSource1" Skin="Hay"> <ItemTemplate> <asp:Repeater ID="ContactDetails" runat="server" DataSource='<%# Bind("ContactDetails") %>'> <ItemTemplate> <asp:Label ID="ContactDetailLabel" runat="server" AssociatedControlID="ContactDetailTextBox" Text='<%# Bind("ContactDetailType") %>'></asp:Label> <asp:TextBox ID="ContactDetailTextBox" runat="server" CssClass="rlvInput" Text='<%# Bind("Value") %>' /> </ItemTemplate> </asp:Repeater> <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update Profile" ToolTip="Update" /> </ItemTemplate></telerik:RadListView> <telerik:RadAjaxPanel ID="rapMainGrid" runat="server"><telerik:RadGrid ID="rgvMainGrid" runat="server" DataSourceID="SQLDS_ForecastedCostEntry" EnableEmbeddedSkins="true" Skin="Office2010Silver" Height="400px" Width="1230px" EnableViewState="true" AutoGenerateColumns="false" AllowMultiRowSelection="false" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" EnableLinqExpressions="false" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" AllowFilteringByColumn="false" AllowSorting="true" AllowPaging="true" PageSize="1000"> <HeaderStyle Font-Bold="true" HorizontalAlign ="Center" VerticalAlign="Middle" Wrap="false" font-size="10px"/> <ItemStyle HorizontalAlign="Right" /> <AlternatingItemStyle HorizontalAlign="Right" /> <HeaderStyle HorizontalAlign="Center" Width="40px"/> <HeaderContextMenu Skin="WebBlue" EnableEmbeddedSkins="true" /> <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced" /> <FooterStyle HorizontalAlign="Right" Font-Bold="true"/> <ClientSettings AllowColumnsReorder="true" AllowDragToGroup="false" AllowColumnHide="false" ReorderColumnsOnClient="true" EnablePostBackOnRowClick="false" AllowExpandCollapse="true" EnableRowHoverStyle = "true" > <ClientEvents OnRowClick="RowSelected" OnCommand="GridCommand" OnRowDblClick="RowDblClick" OnGridCreated ="GridScroll" /> <Selecting AllowRowSelect="true" /> <Resizing AllowColumnResize="True" AllowRowResize="False" ResizeGridOnColumnResize="false" EnableRealTimeResize="True" ></Resizing> <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="4" /> <KeyboardNavigationSettings AllowSubmitOnEnter="false" /> </ClientSettings> <ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" /> <MasterTableView DataSourceID="SQLDS_ForecastedCostEntry" Name="MasterGrid" EnableViewState="true" AllowMultiColumnSorting="true" ShowFooter="true" ShowGroupFooter="true" ShowHeadersWhenNoRecords="true" EditMode="InPlace" CommandItemDisplay="Top" DataKeyNames="LaborTrxKey" > <CommandItemTemplate> <asp:Table ID="tblCommandTemplate" runat="server" Width="1230px" CellSpacing="0" CellPadding="0" > <asp:TableRow ID="trowCommandTemplate1" runat="server" Height="30px" style="display:block;margin-bottom:2px" > <asp:TableCell> <telerik:RadButton ID="rbtAdd" runat="server" CommandName="InitInsert" OnClientClicked="DisableSelectionFields" Skin="Transparent" Text="Add" Icon-PrimaryIconURL="<%$ Resources:Images,AddRecord16%>" style="position:absolute;left:10px;font-size:12px;" ToolTip="Add New Record" Visible='<%# rgvMainGrid.EditIndexes.Count=0 and Not rgvMainGrid.MasterTableView.IsItemInserted %>' /> <telerik:RadButton ID="rbtCancel" runat="server" OnClientClicked="CancelEdit" Skin="Transparent" Text="Cancel" Icon-PrimaryIconURL="<%$ Resources:Images,CancelRecord16%>" style="position:absolute;left:10px;font-size:12px;" ToolTip="Cancel Add/Edit" Visible='<%# rgvMainGrid.EditIndexes.Count > 0 Or rgvMainGrid.MasterTableView.IsItemInserted %>' AutoPostBack="false" /> <telerik:RadButton ID="rbtSaveNew" runat="server" CommandName="PerformInsert" Skin="Transparent" Text="Save" Icon-PrimaryIconURL="<%$ Resources:Images,SaveRecord16%>" style="position:absolute;left:80px;font-size:12px;" ToolTip="Save New Record" Visible='<%# rgvMainGrid.MasterTableView.IsItemInserted%>' /> <telerik:RadButton ID="rbtSave" runat="server" OnClientClicked="EnableSelectionFields" CommandName="UpdateEdited" Skin="Transparent" Text="Save" Icon-PrimaryIconURL="<%$ Resources:Images,SaveRecord16%>" style="position:absolute;left:80px;font-size:12px;" ToolTip="Save Edited Record" Visible='<%# rgvMainGrid.EditIndexes.Count > 0 AND Not rgvMainGrid.MasterTableView.IsItemInserted%>'/> <telerik:RadButton ID="rbtShowHideToolTip" runat="server" Skin="Transparent" ButtonType="StandardButton" ToggleType="CustomToggle" OnToggleStateChanged="rbtShowHideTooltip_ToggleStateChanged" AutoPostBack="true" ToolTip="Show/Hide Line Item Tooltip" style="position:absolute;left:650px;font-size:12px;" EnableViewState="true"> <ToggleStates> <telerik:RadButtonToggleState Text=" Hide Tooltip" PrimaryIconUrl="<%$ Resources:Images,YellowTooltip16%>" /> <telerik:RadButtonToggleState Text=" Show Tooltip" PrimaryIconUrl="<%$ Resources:Images,YellowTooltip16%>" Selected="true" /> </ToggleStates> </telerik:RadButton> <telerik:RadButton ID="rbtShowHideTotals" runat="server" Skin="Transparent" ButtonType="StandardButton" ToggleType="CustomToggle" OnClientToggleStateChanged="ShowHideTotals" AutoPostBack="false" ToolTip="Show/Hide Job/Cost Code Totals" style="position:absolute;left:968px;font-size:12px;" OnClientLoad="ShowTotalsLoad" Visible='<%# rgvMainGrid.EditIndexes.Count=0 and Not rgvMainGrid.MasterTableView.IsItemInserted %>'> <ToggleStates> <telerik:RadButtonToggleState Text=" Hide Totals" PrimaryIconUrl="<%$ Resources:Images,BlueTotals16%>" Selected="true" /> <telerik:RadButtonToggleState Text=" Show Totals" PrimaryIconUrl="<%$ Resources:Images,BlueTotals16%>" /> </ToggleStates> </telerik:RadButton> <telerik:RadButton ID="rbtPrevious" runat="server" CommandName="PreviousWeek" Skin="Transparent" Text="Previous" Icon-PrimaryIconURL="<%$ Resources:Images,ArrowGrayLeft%>" style="position:absolute;left:1075px;font-size:12px;" ToolTip="Show Previous 8 Weeks" Visible='<%# rgvMainGrid.EditIndexes.Count=0 and Not rgvMainGrid.MasterTableView.IsItemInserted %>'/> <telerik:RadButton ID="rbtNext" runat="server" CommandName="NextWeek" Skin="Transparent" Text="Next" Icon-PrimaryIconURL="<%$ Resources:Images,ArrowGrayRight%>" style="position:absolute;left:1155px;font-size:12px;" ToolTip="Show Next 8 Weeks" Visible='<%# rgvMainGrid.EditIndexes.Count=0 and Not rgvMainGrid.MasterTableView.IsItemInserted %>'/> </asp:TableCell> </asp:TableRow> </asp:Table></CommandItemTemplate> <Columns> <telerik:GridBoundColumn UniqueName="LaborTrxKey" DataField="LaborTrxKey" Display="false" /> <telerik:GridBoundColumn UniqueName="ArgusDBID" DataField="ArgusDBID" Display="false" /> <telerik:GridBoundColumn UniqueName="JobName" DataField="JobName" Display="false" /> <telerik:GridBoundColumn UniqueName="ExtraDescription" DataField="ExtraDescription" Display="false" /> <telerik:GridBoundColumn UniqueName="CostCodeDescription" DataField="CostCodeDescription" Display="false" /> <telerik:GridBoundColumn UniqueName="CostCodeDiscipline" DataField="CostCodeDiscipline" Display="false" /> <telerik:GridBoundColumn UniqueName="ContractType" DataField="ContractType" Display="false" /> <telerik:GridBoundColumn UniqueName="ProjectManager" DataField="ProjectManager" Display="false" /> <telerik:GridBoundColumn UniqueName="LaborRateTable" DataField="LaborRateTable" Display="false" /> <telerik:GridBoundColumn UniqueName="EmployeeNumber" DataField="EmployeeNumber" Display="false" /> <telerik:GridBoundColumn UniqueName="EmployeeIdentity" DataField="EmployeeIdentity" Display="false" /> <telerik:GridBoundColumn UniqueName="EmployeeDiscipline" DataField="EmployeeDiscipline" Display="false" /> <telerik:GridBoundColumn UniqueName="LaborType" DataField="LaborType" Display="false" /> <telerik:GridBoundColumn UniqueName="TransactionType" DataField="TransactionType" Display="false" /> <telerik:GridTemplateColumn UniqueName="gtcJob" DataField="Job" HeaderText="Job" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:Image ID="imgTrxType" runat="server" ImageURL='<%# Bind("TrxImage") %>' /> <asp:Label ID="lblJob" runat="server" Text='<%# Bind("Job") %>' /> <telerik:RadToolTip runat="server" Width="400" RenderInPageRoot="true" ShowEvent="OnMouseOver" HideEvent="LeaveTargetAndToolTip" ID="RadToolTip1" Position= "TopRight" Animation="Resize" RelativeTo="Mouse" OffsetX="10" OffsetY="10" > </telerik:RadToolTip> </ItemTemplate> <EditItemTemplate> <asp:Image ID="imgTrxTypeEdit" runat="server" ImageURL='<%# Bind("TrxImage") %>' /> <asp:Label ID="lblJobEdit" runat="server" Text='<%# Bind("Job") %>' /> </EditItemTemplate> <InsertItemTemplate> <telerik:RadComboBox runat="server" ID="rcbInsertJob" DataSourceID="SQLDS_JobNumber" DataValueField="Job" DataTextField="Job" AllowCustomText="false" AutoPostBack="true" MarkFirstMatch="true" HighlightTemplatedItems="true" ItemsPerRequest="200" ShowMoreResultsBox="true" Skin="Default" EnableEmbeddedSkins="true" Width="105px" DropDownWidth="120px" OnItemDataBound="rcbInsertJob_ItemDataBound" OnSelectedIndexChanged="rcbInsertJob_SelectedIndexChanged" > </telerik:RadComboBox> </InsertItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="gtcExtra" HeaderText="Extra" HeaderStyle-Width="80px" ItemStyle-HorizontalAlign="Left" > <ItemTemplate> <asp:Label ID="lblExtra" runat="server" Text='<%# Bind("Extra") %>' /> </ItemTemplate> <EditItemTemplate> <asp:Label ID="lblExtraEdit" runat="server" Text='<%# Bind("Extra") %>' /> </EditItemTemplate> <InsertItemTemplate> <telerik:RadComboBox runat="server" ID="rcbInsertExtra" DataValueField="Extra" DataTextField="Extra" EnableViewState="true" EnableLoadOnDemand="true" AllowCustomText="true" AutoPostBack="false" MarkFirstMatch="true" HighlightTemplatedItems="true" EnableEmbeddedSkins="true" Skin="Default" Width="100px" DropDownWidth="100px" OnItemsRequested="rcbInsertExtra_ItemsRequested" > </telerik:RadComboBox> </InsertItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="gtcCostCode" HeaderText="Cost Code" HeaderStyle-Width="80px" ItemStyle-HorizontalAlign="Left" > <ItemTemplate> <asp:Label ID="lblCostCode" runat="server" Text='<%# Bind("CostCode") %>' /> </ItemTemplate> <EditItemTemplate> <asp:Label ID="lblCostCodeEdit" runat="server" Text='<%# Bind("CostCode") %>' /> </EditItemTemplate> <InsertItemTemplate> <telerik:RadComboBox runat="server" ID="rcbInsertCostCode" DataValueField="CostCode" DataTextField="CostCode" EnableViewState="true" EnableLoadOnDemand="true" AllowCustomText="true" AutoPostBack="false" MarkFirstMatch="true" HighlightTemplatedItems="true" EnableEmbeddedSkins="true" Skin="Default" Width="100px" DropDownWidth="100px" OnItemsRequested="rcbInsertCostCode_ItemsRequested" > </telerik:RadComboBox> </InsertItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="gtcEmployeeName" HeaderText="Employee Name" HeaderStyle-Width="150px" ItemStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:Label ID="lblEmployeeName" runat="server" Text='<%# Bind("EmployeeName") %>' Width="130px" /> </ItemTemplate> <EditItemTemplate> <asp:Label ID="lblEmployeeNameEdit" runat="server" Text='<%# Bind("EmployeeName") %>' Width="130px" /> </EditItemTemplate> <InsertItemTemplate> <telerik:RadComboBox runat="server" ID="rcbInsertEmployee" DataSourceID="SQLDS_EmployeeName" DataValueField="EmployeeIdentity" DataTextField="EmployeeName" AllowCustomText="false" AutoPostBack="false" MarkFirstMatch="true" HighlightTemplatedItems="true" EnableEmbeddedSkins="true" Skin="Default" Width="170px" DropDownWidth="170px" OnItemDataBound="rcbInsertEmployee_ItemDataBound" > </telerik:RadComboBox> </InsertItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="BeginningHours" UniqueName="BeginningHours" HeaderText="JTD" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="70px" ReadOnly="true"/> <telerik:GridNumericColumn DataField="HoursWeek1" UniqueName="HoursWeek1" HeaderText="Week1" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor1" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek2" UniqueName="HoursWeek2" HeaderText="Week2" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor2" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek3" UniqueName="HoursWeek3" HeaderText="Week3" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor3" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek4" UniqueName="HoursWeek4" HeaderText="Week4" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor4" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek5" UniqueName="HoursWeek5" HeaderText="Week5" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor5" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek6" UniqueName="HoursWeek6" HeaderText="Week6" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor6" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek7" UniqueName="HoursWeek7" HeaderText="Week7" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor7" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek8" UniqueName="HoursWeek8" HeaderText="Week8" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor8" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek9" UniqueName="HoursWeek9" HeaderText="Week8" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor9" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek10" UniqueName="HoursWeek10" HeaderText="Week8" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor10" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek11" UniqueName="HoursWeek11" HeaderText="Week8" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor11" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeek12" UniqueName="HoursWeek12" HeaderText="Week8" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="55px" ColumnEditorID="HrsEditor12" DefaultInsertValue="0.00"/> <telerik:GridNumericColumn DataField="HoursWeekFuture" UniqueName="HoursWeekFuture" HeaderText="WeekFuture" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="65px" ReadOnly="true" /> <telerik:GridNumericColumn DataField="HoursTotal" UniqueName="HoursTotal" HeaderText="Total" DataFormatString="{0:F2}" Aggregate="Sum" HeaderStyle-Width="60px" ReadOnly="true" /> <telerik:GridBoundColumn DataField="CostTotals" UniqueName="CostTotals" HeaderText="CostTotals" Display="false"/> </Columns> <FooterStyle /> </MasterTableView> </telerik:RadGrid> <telerik:GridNumericColumnEditor ID="HrsEditor1" runat="server" > <NumericTextBox runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor2" runat="server" > <NumericTextBox runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor3" runat="server" > <NumericTextBox runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor4" runat="server" > <NumericTextBox runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor5" runat="server" > <NumericTextBox runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor6" runat="server" > <NumericTextBox runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor7" runat="server" > <NumericTextBox runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor8" runat="server" > <NumericTextBox runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor9" runat="server" > <NumericTextBox ID="NumericTextBox1" runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor10" runat="server" > <NumericTextBox ID="NumericTextBox2" runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor11" runat="server" > <NumericTextBox ID="NumericTextBox3" runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor> <telerik:GridNumericColumnEditor ID="HrsEditor12" runat="server" > <NumericTextBox ID="NumericTextBox4" runat="server" Width="55px" DataType="System.Decimal" Font-Size="12px" MinValue ="0" MaxValue="80" > <NumberFormat DecimalDigits="2" KeepTrailingZerosOnFocus="true" /> <EnabledStyle HorizontalAlign="Right" /> <FocusedStyle HorizontalAlign="Right" BackColor="#FAF1B1"/> <DisabledStyle HorizontalAlign="Right" BackColor ="<%$ Resources:Colors,BlueBright%>" /> </NumericTextBox> </telerik:GridNumericColumnEditor></telerik:RadAjaxPanel>Protected Sub rbtShowHideTooltip_ToggleStateChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.ButtonToggleStateChangedEventArgs) If e.SelectedToggleStateIndex.ToString = "0" Then Session("ShowToolTip") = True Else Session("ShowToolTip") = False End If 'Force Grid Item Databound Event rgvMainGrid.Rebind() End Sub Private Sub rgvMainGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgvMainGrid.ItemDataBound Dim gciItem As GridCommandItem = TryCast(Me.rgvMainGrid.MasterTableView.GetItems(GridItemType.CommandItem)(0), GridCommandItem) Dim rbtToolTip As RadButton = TryCast(gciItem.FindControl("rbtShowHideToolTip"), RadButton) If TypeOf e.Item Is GridDataItem Or TypeOf e.Item Is GridEditableItem Then Dim Row As GridDataItem = DirectCast(e.Item, GridDataItem) Dim strExtra As String = Nothing 'Set the ToolTip for each grid row If Not TypeOf e.Item Is GridDataInsertItem Then MsgBox(rbtToolTip.SelectedToggleState.Text) Dim ToolTip As RadToolTip = DirectCast(e.Item.FindControl("RadToolTip1"), RadToolTip) ToolTip.Visible = Session("ShowToolTip") If Session("ShowToolTip") = True Then If Not (TryCast(Row.FindControl("lblExtra"), Label).Text.Trim().Equals(" ") Or TryCast(Row.FindControl("lblExtra"), Label).Text.Trim().Length = 0) Then strExtra = TryCast(Row.FindControl("lblExtra"), Label).Text Else strExtra = "*" End If Dim strParameters As String = TryCast(Row.FindControl("lblJob"), Label).Text + "," + _ Row("JobName").Text + "," + _ TryCast(Row.FindControl("lblExtra"), Label).Text + "," + _ Row("ExtraDescription").Text + "," + _ TryCast(Row.FindControl("lblCostCode"), Label).Text + "," + _ Row("CostCodeDescription").Text + "," + _ Row("CostCodeDiscipline").Text + "," + _ TryCast(Row.FindControl("lblEmployeeName"), Label).Text + "," + _ Row("EmployeeDiscipline").Text ToolTip.IsClientID = True ToolTip.TargetControlID = e.Item.ClientID Dim ToolTipInfo As WUC_PRJ_Forecasting_Tooltip = DirectCast(Page.LoadControl("WUC PRJ Forecasting ToolTip.ascx"), WUC_PRJ_Forecasting_Tooltip) ToolTipInfo.prpPageParameters = strParameters ToolTip.Controls.Add(ToolTipInfo) MsgBox("Tooltip Visible") Else MsgBox("Tooltip Hidden") End If End If 'Set the Background color of the Hours fields based on the type of hours (Actual or Forecasted) and if the field has a value. Dim strColumn As String Dim i As Integer = 0 For i = 0 To 14 Select Case i Case 12 strColumn = "BeginningHours" Case 13 strColumn = "HoursWeekFuture" Case 14 strColumn = "HoursTotal" Case Else strColumn = "HoursWeek" + (i + 1).ToString End Select If Not (Row(strColumn).Text.Trim().Equals(" ") Or Row(strColumn).Text.Trim().Length = 0) Then If Row(strColumn).Text <> 0 Then Row(strColumn).Font.Bold = "true" Select Case Me.rcbTrxType.SelectedValue.ToString Case "A", "F", "B" If Row("TransactionType").Text = "A" Then Row(strColumn).BackColor = ColorTranslator.FromHtml(HttpContext.GetGlobalResourceObject("Colors", "BlueBright")) Else Row(strColumn).BackColor = ColorTranslator.FromHtml(HttpContext.GetGlobalResourceObject("Colors", "GreenBright")) End If Case "C" Dim intDay As Integer = DateDiff(DateInterval.Day, Convert.ToDateTime(Me.txtLastPayroll.Text), Convert.ToDateTime(Me.txtBeginDate.Text)) If intDay >= 0 Then Row(strColumn).BackColor = ColorTranslator.FromHtml(HttpContext.GetGlobalResourceObject("Colors", "GreenBright")) Else Dim intWeek = Math.Abs(intDay) / 7 If intWeek >= i Then Row(strColumn).BackColor = ColorTranslator.FromHtml(HttpContext.GetGlobalResourceObject("Colors", "BlueBright")) Else Row(strColumn).BackColor = ColorTranslator.FromHtml(HttpContext.GetGlobalResourceObject("Colors", "GreenBright")) End If End If End Select Else Row(strColumn).BackColor = Color.White End If Else Row(strColumn).BackColor = Color.White Row(strColumn).Font.Bold = "false" End If Next End If 'If Grid is in Insert/Edit mode disable any hour columns that are less than or equal to the the Last Payroll Date If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Or TypeOf e.Item Is GridEditFormInsertItem Then Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem) Dim txtHours As RadNumericTextBox Dim strColumn As String Dim i As Integer = 0 'Convert.ToDateTime Dim intWeeks As Integer = DateDiff("w", Convert.ToDateTime(Me.txtBeginDate.Text), Convert.ToDateTime(Me.txtLastPayroll.Text)) If intWeeks >= 0 Then For i = 0 To 10 strColumn = "HoursWeek" + (i + 1).ToString txtHours = DirectCast(item(strColumn).Controls(0), RadNumericTextBox) If i <= intWeeks Then txtHours.Enabled = False Else txtHours.Enabled = True If i = intWeeks + 1 Then txtHours.Focus() End If End If Next i Else txtHours = DirectCast(item("HoursWeek1").Controls(0), RadNumericTextBox) End If End If End Sub