Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
163 views
I am attempting to display aggregates in the group header.

I am attempting to use the example from this link:
http://www.telerik.com/help/aspnet-ajax/grid-group-header-footer-templates.html

However I keep getting the following error:

Compiler Error Message: BC30108: 'GridGroupHeaderItem' is a type and cannot be used as an expression.

Source Error:

Line 130: <asp:Label ID="Label7" runat="server" Text='<%# Eval("IDIssueCategory") %>'>

Line 131: </asp:Label>

Line 132: <asp:Label runat="server" ID="Label2" Width="200px" Text='<%# "Number of units: "+ (((GridGroupHeaderItem)Container).AggregatesValues["Subject"]) %>'

Line 133: Visible='<%# ((((GridGroupHeaderItem)Container).AggregatesValues["Subject"]) != null)%>'>

Line 134: </asp:Label>


Here is my code.
<telerik:RadGrid ID="rgd_OpenTickets" runat="server" Skin="WebBlue" CellSpacing="0"
                                    DataSourceID="sds_OpenTickets" GridLines="None" ShowFooter="True" FooterStyle-HorizontalAlign="Left">
                                    <MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="IDIssueCategory"
                                        DataKeyNames="IDIssueCategory" DataSourceID="sds_OpenTickets" HeaderStyle-HorizontalAlign="Center"
                                        ShowFooter="True" ShowGroupFooter="True">
                                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                        </RowIndicatorColumn>
                                        <GroupByExpressions>
                                            <telerik:GridGroupByExpression>
                                                <SelectFields>
                                                    <telerik:GridGroupByField FieldName="CategoryName" HeaderText=" " />
                                                </SelectFields>
                                                <GroupByFields>
                                                    <telerik:GridGroupByField FieldName="IDIssueCategory" />
                                                </GroupByFields>
                                            </telerik:GridGroupByExpression>
                                        </GroupByExpressions>
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="IDIssueCategory" DataType="System.Int32" FilterControlAltText="Filter IDIssueCategory column"
                                                HeaderText="IDIssueCategory" SortExpression="IDIssueCategory" UniqueName="IDIssueCategory"
                                                Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="CategoryName" DataType="System.Int32" FilterControlAltText="Filter CategoryName column"
                                                HeaderText="CategoryName" SortExpression="CategoryName" UniqueName="CategoryName"
                                                Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="IDTicket" DataType="System.Int32" FilterControlAltText="Filter IDTicket column"
                                                HeaderText="ID" ReadOnly="True" SortExpression="IDTicket" UniqueName="IDTicket"
                                                ItemStyle-Width="20px" ItemStyle-HorizontalAlign="Center">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="RequestorUserName" FilterControlAltText="Filter RequestorUserName column"
                                                HeaderText="Requestor" SortExpression="RequestorUserName" UniqueName="RequestorUserName"
                                                ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Left">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="EnteredDate" HeaderText="Enter Date" ItemStyle-Width="65px"
                                                SortExpression="EnteredDate" UniqueName="EnteredDate" FilterControlAltText="Filter EnteredDate column"
                                                HeaderStyle-HorizontalAlign="Center" DataType="System.DateTime" DataFormatString="{0:MM/dd/yy}"
                                                ItemStyle-HorizontalAlign="Center">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Priority" FilterControlAltText="Filter Priority column"
                                                HeaderText="Priority" SortExpression="Priority" UniqueName="Priority" ItemStyle-Width="20px"
                                                ItemStyle-HorizontalAlign="Center" DataType="System.Decimal">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Status" FilterControlAltText="Filter Status column"
                                                HeaderText="Status" SortExpression="Status" UniqueName="Status" ReadOnly="True"
                                                ItemStyle-Width="70px">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Subject" FilterControlAltText="Filter Subject column"
                                                HeaderText="Subject" SortExpression="Subject" UniqueName="Subject" ItemStyle-HorizontalAlign="Left"
                                                FooterStyle-HorizontalAlign="Left" FooterText="Tickets " Aggregate="Count">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="AssignedTech" FilterControlAltText="Filter AssignedTech column"
                                                HeaderText="Tech" ReadOnly="True" SortExpression="AssignedTech" UniqueName="AssignedTech"
                                                ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Right">
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                        <GroupHeaderTemplate>
                                            <asp:Label ID="Label7" runat="server" Text='<%# Eval("IDIssueCategory") %>'>
                                            </asp:Label>
                                            <asp:Label runat="server" ID="Label1" Width="200px" Text='<%# "Total: "+ (((GridGroupHeaderItem)Container).AggregatesValues["Subject"]) %>'
                                                Visible='<%# ((((GridGroupHeaderItem)Container).AggregatesValues["Subject"]) != null)%>'>
                                            </asp:Label>
                                        </GroupHeaderTemplate>
                                    </MasterTableView>
                                    <FooterStyle BackColor="#CCFF99" Font-Bold="True"></FooterStyle>
                                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                                    <FilterMenu EnableImageSprites="False">
                                    </FilterMenu>
                                </telerik:RadGrid>


Any help much appreciated.

Kostadin
Telerik team
 answered on 19 Sep 2013
3 answers
99 views
I have a very unusual problem.After adding the property ShowContentDuringLoad="False" at rad window a scroll bar appears at radgrid inside the rad window.Can you please help. My telerik version is Q2 2013. Please check the attached image.
Marin Bratanov
Telerik team
 answered on 19 Sep 2013
3 answers
74 views
Hello Telerik Team,

I'm using your scheduler, and found a problem when adding an appointment to the scheduler using context menu.
I was able to reproduce the same problem in your online example: http://demos.telerik.com/aspnet-ajax/scheduler/examples/contextmenu/defaultcs.aspx.
To debug the problem, please set the scheduler to "Month View" and "Group by Calendar", next select 2 or 3 days using dragging on the timeslot and click in context option "New Appointment", in your example I'm redirected to this page "http://demos.telerik.com/ErrorPageResources/error.aspx?aspxerrorpath=/aspnet-ajax/scheduler/examples/contextmenu/defaultcs.aspx", I'm my code I get the error:
Resource index out of range: 6
at Telerik.Web.UI.Scheduler.Views.Month.GroupedByResource.Model.GetSlotByIndex(String index)
   at Telerik.Web.UI.Scheduler.Views.SchedulerModel.ProcessPostBackCommand(SchedulerPostBackEvent postBack)
   at Telerik.Web.UI.Scheduler.Views.SchedulerModel.<GetTimeSlotContextMenuCommands>b__1(ISchedulerModel ActiveModel, SchedulerPostBackEvent postBack)
   at Telerik.Web.UI.RadScheduler.ProcessTimeSlotContextMenuItemCommand(SchedulerPostBackEvent postBack)
   at Telerik.Web.UI.RadScheduler.ProcessPostBackCommand(SchedulerPostBackEvent postBack)
   at Telerik.Web.UI.RadScheduler.RaisePostBackEvent(String eventArgument)
   at Telerik.Web.UI.RadScheduler.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
.......

Is this a bug, or something I'm doing wrong?

Thanks for the fast reply.
Alexandre Pereira
Plamen
Telerik team
 answered on 19 Sep 2013
1 answer
112 views
Hi,

When using IE10 in compability mode the scheduler shrinks the days as you can see in attached file 1.jpg. In the 2.jpg file you can see how the scheduler is displayed compatibility mode disabled.

This scheduler is running as a client web part (provider hosted app) in a Sharepoint.

Telerik version: 2013.2.717.45
Plamen
Telerik team
 answered on 19 Sep 2013
1 answer
101 views
I have a very unusual problem.After adding the property ShowContentDuringLoad="False" at rad window a scroll bar appears at radgrid inside the rad window.Can you please help. My telerik version is Q2 2013. Please check the attached image.
Venelin
Telerik team
 answered on 19 Sep 2013
3 answers
278 views
After spending 2 days trying to refresh the parent page when the rad window is closed. I was finally able to get somewhere. If I set the OnClientClose in the RadWindowManager my javascript function fires if I set it in the RadWindow it does not fire. Is this intended? What is the point of the OnClientClose in the RadWindow?
Shinu
Top achievements
Rank 2
 answered on 19 Sep 2013
1 answer
94 views
i have the following grid that i am trying to export to PDF
<telerik:RadGrid ID="RadGrid1" runat="server" OnItemCreated="RadGrid1_ItemCreated" OnItemCommand="RadGrid1_ItemCommand" AutoGenerateColumns="false"<br>        AllowSorting="True" CellSpacing="0" GridLines="None" ShowHeader="false"><br>        <GroupingSettings RetainGroupFootersVisibility="True" /><br>        <ClientSettings><br>            <Scrolling UseStaticHeaders="false" /><br>        </ClientSettings><br>        <MasterTableView CommandItemDisplay="Top"><br>            <CommandItemSettings ShowExportToExcelButton="false" ShowAddNewRecordButton="false" ShowRefreshButton="false" ShowExportToPdfButton="true"></CommandItemSettings><br><ItemTemplate><br>                <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'<br>                    runat="server"><br>                    <table class="no-border"><br>                        <tbody><br>                            <tr><br>                                <td class="catalog-item-img"><br>                                    <img id="Img1" runat="server" src='<%# ResolveUrl("~/Service.ashx?model=document&action=DOWNLOAD&currentLanguageId="+Eval("ProducedLanguage.Id")+"&Type=Cover") %>' width="150" height="200" /><br>                                </td><br>                                <td class="catalog-item"><br>                                    <h5><br>                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "~/ViewPublication.aspx?id="+Eval("MasterPublication.Id")+"&tab=i&ln="+Eval("PublicationId")%>'><%#Eval("ProducedLanguage.Title") %> </asp:HyperLink><br>                                    </h5><br>                                    <p><br>                                        <strong>Language: </strong><br>                                        <asp:Label runat="server" ID="lblLanguage" Text='<%#Eval("ProducedLanguage.Language.Name") %>'></asp:Label><br>                                        - <strong>Isbn: </strong><br>                                        <asp:Label runat="server" ID="lblIsbn" Text='<%#Eval("ProducedLanguage.Isbn") %>'></asp:Label><br>                                        - <strong>Year: </strong><br>                                        <asp:Label runat="server" ID="Label3" Text='<%#Eval("Year") %>'></asp:Label><br>                                        - <strong>Pages: </strong><br>                                        <asp:Label runat="server" ID="lblPages" Text='<%#Eval("Pages") %>'></asp:Label><br>                                        <br /><br>                                        <strong>Category: </strong><br>                                        <asp:Label runat="server" ID="Label1" Text='<%#GetContentGroups(Eval("MasterPublication") as ItcPublications.Models.MasterPublication) %>'> </asp:Label><br>                                        - <strong>Sales price: </strong><br>                                        <asp:Label runat="server" ID="Label2" Text='<%#Eval("UnitPrice")+" $" %>'></asp:Label><br>                                    </p><br>                                    <div><br>                                        <asp:Label runat="server" ID="lblBlurb" Text='<%#Eval("ProducedLanguage.MarketingBlurb") %>'></asp:Label><br>                                    </div><br>                                </td><br>                            </tr><br>                        </tbody><br>                    </table><br>                </asp:Panel><br>            </ItemTemplate><br></MasterTableView><br>        <ExportSettings SuppressColumnDataFormatStrings="false" IgnorePaging="true" FileName="MostPopularPublications"><br>            <Pdf Author="ITC" Creator="ITC" Subject="Marketing Catalog" Title="Marketing Catalog" DefaultFontFamily="Arial, Helvetica, Geneva, Swiss, SunSans-Regular" PageLeftMargin="10" PageRightMargin="7" /><br>        </ExportSettings><br>        <ItemStyle ForeColor="#0066cc" /><br>    </telerik:RadGrid>
This always renders an empty page. whenever i remove the table, it works.
does anyone know how to achieve this?

thanks
Princy
Top achievements
Rank 2
 answered on 19 Sep 2013
0 answers
112 views
Hi,

Recently want to increase the speed of my website so I plan to use Scriptmanager to imports from CDN. But I receive error 'WebForm_InitCallBack' for RadCombobox on my page. I have a scriptmanager and updatepanel, inside the updatepanel have few controls and one of the control is radcombobox. The EnabledCDN property of the Scriptmanager set to True.
Can anybody help me? Thanks in advance.
Dylan
Top achievements
Rank 2
 asked on 19 Sep 2013
3 answers
238 views
I am trying to use the logic from the demo project listed here (http://demos.telerik.com/aspnet-ajax/tabstrip/examples/multipage/dynamic-pageview-creation/defaultvb.aspx), but It's not working as expected.

First, the onTabSelecting javascript is not finding previous pageViewId's and it keeps posting back.
Second, the code "e.Tab.PageView.Selected = True" in the TabClick event in the codebehind is throwing an error, "Object reference not set to an instance of an object." Upon inspection, e.Tab is showing it is a valid RadTab, but the PageView is Nothing.

I looked at everything, and it all looks correct. I have some logic to dynamically create the tabs and load the ascx into pageviews based upon a saved path in the database. The default.aspx uses a nested master, with the AjaxManager in the child master. It's setup like this:

Site.Master ---> Child.Master ---> Default.aspx

Here is the Default.aspx page.
<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Child.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="MainApp._Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<asp:Content runat="server" ID="LeftNav" ContentPlaceHolderID="ChildContentLeftPanel">
        <telerik:RadCalendar ID="RadCalendar1" runat="server" Skin="Forest" >
            <WeekendDayStyle CssClass="rcWeekend" />
            <CalendarTableStyle CssClass="rcMainTable"/>
            <OtherMonthDayStyle CssClass="rcOtherMonth"/>
            <OutOfRangeDayStyle CssClass="rcOutOfRange"/>
            <DisabledDayStyle CssClass="rcDisabled"/>
            <SelectedDayStyle CssClass="rcSelected"/>
            <DayOverStyle CssClass="rcHover"/>
            <FastNavigationStyle CssClass="RadCalendarMonthView RadCalendarMonthView_Forest"/>
            <ViewSelectorStyle CssClass="rcViewSel"/>           
        </telerik:RadCalendar>
</asp:Content>
 
<asp:Content runat="server" ID="NavigationContent" ContentPlaceHolderID="ChildContent1">
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" Skin="Forest"/>
 
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="NavTabStrip">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="NavTabStrip"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
 
    <script type="text/javascript">
        function onTabSelecting(sender, args) {
 
            if (args.get_tab().get_pageViewID()) {
                args.get_tab().set_postBack(false);
            }
        }
    </script>
 
    <div class="exampleWrapper">
        <telerik:RadTabStrip ID="NavTabStrip" runat="server" SelectedIndex="0" MultiPageID="RadMultipPage1" Skin="Forest" Align="Justify"
            OnTabClick="NavTabStrip_TabClick" OnClientTabSelecting="onTabSelecting" />
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated" />
 
    </div>
 
 
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="ChildContent2">
 
</asp:Content>


Here is the VB code.
Imports System
Imports Telerik.Web.UI
 
Partial Public Class _Default
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            SetStoreID(Page.Master)
            Dim dal As Navigation = New Navigation
 
            Dim ds As DataSet = dal.NavigationSelect(0)
            Dim bAddPageView As Boolean = True
            Dim sObjectPath As String = String.Empty
 
            For Each row As DataRow In ds.Tables(0).Rows
                If IsDBNull(row.Item("ObjectPath")) Then
                    sObjectPath = String.Empty
                Else
                    sObjectPath = row.Item("ObjectPath")
                End If
                AddTab(row.Item("NavName"), sObjectPath, bAddPageView)
                bAddPageView = False
            Next
        End If
 
    End Sub
    Private Sub SetStoreID(ByVal sender As Object)
        Dim sStoreID As String
 
        Dim DAL As Store = New Store
        sStoreID = DAL.StoreCurrentStoreIDSelect
 
        Dim StoreID As HiddenField = FindControlRecursive(sender, "StoreID")
 
        StoreID.Value = sStoreID
 
    End Sub
 
    Private Sub AddTab(ByVal tabName As String, ByVal ObjectPath As String, ByVal bAddPageView As Boolean)
        Dim tab As RadTab = New RadTab
 
        tab.Text = tabName
        tab.Attributes.Add("ObjectPath", ObjectPath)
 
        NavTabStrip.Tabs.Add(tab)
        If bAddPageView Then
            AddPageView(tab)
        End If
 
    End Sub
    Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated
        Dim tab As RadTab = NavTabStrip.SelectedTab
 
        Dim userControlName As String = tab.Attributes("ObjectPath")
 
        Dim userControl As Control = Page.LoadControl(userControlName)
 
        userControl.ID = e.PageView.ID & "_userControl"
        e.PageView.Controls.Add(userControl)
    End Sub
 
    Private Sub AddPageView(ByVal tab As RadTab)
        Dim pageView As RadPageView = New RadPageView
 
        pageView.ID = tab.Text
        RadMultiPage1.PageViews.Add(pageView)
        tab.PageViewID = pageView.ID
        pageView.Selected = True
    End Sub
    Protected Sub NavTabStrip_TabClick(ByVal sender As Object, ByVal e As RadTabStripEventArgs) Handles NavTabStrip.TabClick
        'Dim pageView As RadPageView = RadMultiPage1.FindControl(e.Tab.Text.Replace(" ", ""))
 
        'If IsNothing(pageView) Then
 
        AddPageView(e.Tab)
        'End If
        e.Tab.PageView.Selected = True
    End Sub
 
    Private Shared Function FindControlRecursive(Root As Control, Id As String) As Control
 
        If Root.ID = Id Then
            Return Root
        End If
 
        For Each Ctl As Control In Root.Controls
 
            Dim FoundCtl As Control = FindControlRecursive(Ctl, Id)
 
            If FoundCtl IsNot Nothing Then
                Return FoundCtl
            End If
        Next
 
        Return Nothing
 
    End Function
End Class
Steve
Top achievements
Rank 1
 answered on 18 Sep 2013
5 answers
292 views
Hi i want a watermark on the filter in the RadGridview.

How to make water mark as "search" in the filter textbox in RadGrid in asp.net?
Monte
Top achievements
Rank 1
 answered on 18 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?