Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
99 views
I have a PanelBar that is getting populated client-side via JS.  Below is a code example:

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(); 
}

This seems to serve it's purpose, I can inspect the root item after the loop and can see all the added child items.  

The problem is when I click on this RadPanelBar root item, nothing happens.  The "expand/collapse" icon switches on click and any expand/collapse/click events are fired as normal, just no child Items are shown.  I have tried almost everything.

Even when adding the RadPanelItems statically at design time, I see the same problem.  
<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>

This also has the same outcome, can't expand to see the child item.

Any ideas?  Am I missing something?
Kate
Telerik team
 answered on 30 Jul 2012
2 answers
488 views
Having some problems with the javascript to get all nodes using the sample code provided here:

http://www.telerik.com/help/aspnet-ajax/treeview-client-objects-radtreenode.html

Am getting the error

Error: TypeError: tree is null
Source File: http://localhost/Edit/CategorySelection.aspx
Line: 48

I thought jQuery might be causing some problems, it is in no conflict mode. have tried changing
var tree = $find("<%= RadTreeView1.ClientID %>");
to
var tree = jQuery("<%= RadTreeView1.ClientID %>");
but i get the error

Error: TypeError: tree.get_nodes is not a function
Source File: http://localhost/Edit/CategorySelection.aspx
Line: 48

Any idea whats causing this error? (code below, js to get nodes contained in nodetest and loaded on document load

Master Page:

<%@ 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">
<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

<%@ 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>

Craig
Top achievements
Rank 1
 answered on 30 Jul 2012
1 answer
39 views
The following code iterates through all of the groupheaderitems in my RadGrid. I was originally having trouble expanding groups programmatically because I was attempting to expand based on sequential item.groupindex indexes, e.g. if (item.groupindex == "0" || item.groupindex == "1".

However, I found that the groupindex == "1" wasn't working so I wrote the following method to append all of the indexes to a stringbuilder:

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);
           }           
       }

When I run the application, the stringbuilder contains {02468} and so on rather than what I thought should be {01234}

Does anyone know why the GroupHeaderItem indexes increase by two rather than by 1? This doesn't affect my code, as now I know what to look for, but I was just wondering about the reasoning behind this.

Thanks,

Josh
Andrey
Telerik team
 answered on 30 Jul 2012
3 answers
259 views
I am using a repeater within my RadListView which has the data source set like DataSource='<%# Bind("ContactDetails") %>'.

So then I can loop through the different properties of the ContactDetails and use them, but when I update any data in these fields the data is lost on post back.

I have read quite a lot of different blog posts etc and they seem to think I need to bind in the Onint method, but since I don't bind in the code behind, I have no idea how to do this, or if this will actually solve my problem.

The data source for the RadListView is calling a WCF web Service that expects JSON.

Here is an example of the code I am using....
Please ignore any small syntax errors, I have quickly shortend this code for putting on the forums.

<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>

Any help would be great, I am totally stuck on this one. Is it even possible to do what I want?

Vasil
Telerik team
 answered on 30 Jul 2012
1 answer
79 views
Is there any ATM?

Thank you.
Vasil
Telerik team
 answered on 30 Jul 2012
5 answers
728 views
Hi All,

I am using hierarchical grid which shows categories and its details.
Now i want to show / hide columns which are in detail table depending on category.

as follows, C1, C2 are categories and A, B, C are columns...

-C1
    A  B  C
-C2
    A C

Please help me to solve my problem.

Thanks,
Amol Wable


Shinu
Top achievements
Rank 2
 answered on 30 Jul 2012
1 answer
37 views
We recently upgraded Telerik ASP.NET controls from version 2011 Q3 to version 2012 Q2.

In the main company project (Metro skin set) this resulted in the filter boxes within RadGrids to increase from 13 to 25 characters in width.
This effect is evident with the style sheet removed from the project.

How can the width of the filter boxes be reset to 13 characters please ?

Andrey
Telerik team
 answered on 30 Jul 2012
1 answer
387 views
Hi,

I have a radtooltip that I am displaying on each datarow of the grid.  The tooltip is a usercontrol that I am loading on the RadGrid_ItemDatabound event.  I am trying to give the user the option of either hiding or displaying the tooltip.  I have a button (toggle) in the command item template to show/hide the tooltip.  I am setting a session variable based on the toggle state of the button on the buttons ToggleStateChanged event and then am using the variable to set the visibility of the tooltip.  My problem is that this isn't working, the item databound event of the grid is firing before the buttons togglestatechanged event.

Can you tell me how I can show or hide the tooltip.  I am doing this server side but if it can be done client side that would be great.

    <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

Any help will be appreciated.

Tracy
Tsvetina
Telerik team
 answered on 30 Jul 2012
1 answer
65 views
Hi,

I am using a RadCalendar control in my web page, to allow users to select/deselect non working days. I have it so there are 12 views displayed at once (3 x 4 grid). This means I can get a whole year's worth into one page.

What's quite annoying is that the previous/next months days sometimes appear in one view - which means in some cases the same day is repeated twice on the page, which is rather confusing and causes me trouble when determining if they have 'deselected' a day. Please select attached screenshot.

How can I make it so that each view only contains days for that month?

Princy
Top achievements
Rank 2
 answered on 30 Jul 2012
2 answers
103 views
I tried to recreate this demo: http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx

I copied the code given at the bottom of the page and made a few changes. I also changed the panel visibility to true since the panel and the items in it (the grid, tabs, panel background image) will not be displayed if the visibility is set to false. I don't know why you set the panel's visibility to false in the code given. Care to enlighten me on this?

However that's not the reason why I create this thread. When I tried to debug, I get this error message:

Could not find control 'Label1' in ControlParameter 'ParentID'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'Label1' in ControlParameter 'ParentID'.


I'm this close to tearing my hair out trying to debug this. Can you tell me what went wrong?

Here's my code:

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="MiniApp5b._Default" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
 
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to ASP.NET!
    </h2>
 
<asp:SqlDataSource ID="edata3" runat="server" ConnectionString="<%$ ConnectionStrings:GreenDataConnectionString %>" SelectCommand="SELECT * FROM [Category5Parent]">
</asp:SqlDataSource>
 
<asp:SqlDataSource ID="edata5" runat="server"
        ConnectionString="<%$ ConnectionStrings:GreenDataConnectionString %>"
        SelectCommand="
            SELECT *
            FROM Category5Child
                INNER JOIN Category5Parent
                ON Category5Child.ParentID = Category5Parent.ParentID
            WHERE ParentID = @ParentID
            ">
    <SelectParameters>
        <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="Int32" Name="ParentID" />
    </SelectParameters>
</asp:SqlDataSource>
 
    <telerik:RadGrid ID="RadGrid4" runat="server" CellSpacing="0" DataSourceID="edata3" GridLines="None">
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="ParentID"  DataSourceID="edata3">
            <NestedViewTemplate>
                <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap1" Visible="true">
                    <telerik:RadTabStrip runat="server" ID="TabStrip1" MultiPageID="Multipage1" SelectedIndex="0">
                        <Tabs>
                            <telerik:RadTab runat="server" Text="Sales" PageViewID="PageView1">
                            </telerik:RadTab>
                            <telerik:RadTab runat="server" Text="Contact Information" PageViewID="PageView2">
                            </telerik:RadTab>
                            <telerik:RadTab runat="server" Text="Statistics Chart" PageViewID="PageView3">
                            </telerik:RadTab>
                        </Tabs>
                    </telerik:RadTabStrip>
 
                    <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                        <telerik:RadPageView runat="server" ID="PageView1">
                            <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("ParentID") %>' Visible="false" runat="server" />
                            <telerik:RadGrid runat="server" ID="GridIntab" DataSourceID="edata5" ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false">
                                 
                                <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" DataKeyNames="ChildID" PageSize="7" HierarchyLoadMode="ServerOnDemand">
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="ChildID" DataType="System.Int32"
                                            FilterControlAltText="Filter ChildID column" HeaderText="ChildID"
                                            ReadOnly="True" SortExpression="ChildID" UniqueName="ChildID">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ChildName"
                                            FilterControlAltText="Filter ChildName column" HeaderText="ChildName"
                                            SortExpression="ChildName" UniqueName="ChildName">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="ParentID" DataType="System.Int32"
                                            FilterControlAltText="Filter ParentID column" HeaderText="ParentID"
                                            SortExpression="ParentID" UniqueName="ParentID">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </telerik:RadPageView>
 
                        <telerik:RadPageView runat="server" ID="PageView2" Width="460px">
                        <%--
                        TO DO
                        --%>
                        </telerik:RadPageView>
 
                        <telerik:RadPageView runat="server" ID="PageView3">
                        <%--
                        TO DO
                        --%>
                        </telerik:RadPageView>
 
                    </telerik:RadMultiPage>
                </asp:Panel>
            </NestedViewTemplate>
 
            <CommandItemSettings ExportToPdfText="Export to PDF">
            </CommandItemSettings>
 
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
 
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
 
            <Columns>
                <telerik:GridBoundColumn DataField="ParentID" DataType="System.Int32"
                    FilterControlAltText="Filter ParentID column" HeaderText="ParentID"
                    ReadOnly="True" SortExpression="ParentID" UniqueName="ParentID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ParentName"
                    FilterControlAltText="Filter ParentName column" HeaderText="ParentName"
                    SortExpression="ParentName" UniqueName="ParentName">
                </telerik:GridBoundColumn>
            </Columns>
 
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
</telerik:RadGrid>
</asp:Content>

Iris
Top achievements
Rank 1
 answered on 30 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?