Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
175 views
Hi there,

I am trying to get the total items onto the footer at the bottom, however, I cannot make it when I do grouping based on a jobID.
I've attached my grid's look. It has got the each item's total, however, I want to have the last total at the bottom.
thank you

html code:
<telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid4" AllowFilteringByColumn="True" AllowSorting="True" runat="server" OnItemCommand="RadGrid4_ItemCommand" OnItemCreated="RadGrid4_ItemCreated" EnableLinqExpressions="false" HtmlEncode="true" OnNeedDataSource="RadGrid4_NeedDataSource" GroupingSettings-RetainGroupFootersVisibility="true"
                        ShowGroupPanel="True" CellSpacing="-1" GridLines="Both" Skin="Office2010Silver" EnableViewState="true" Width="100%">
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <GroupingSettings CaseSensitive="false" />
                        <ClientSettings AllowKeyboardNavigation="true">
                        </ClientSettings>
                        <ExportSettings OpenInNewWindow="true" FileName="i-Dispatch Job Part Used Report" ExportOnlyData="true">
                            <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm"
                                BorderStyle="Medium" BorderColor="#666666" PaperSize="A4" >
                            </Pdf>
                        </ExportSettings>
                        <MasterTableView Width="100%" DataKeyNames="JobID" HierarchyLoadMode="ServerOnDemand" ShowGroupFooter="true" AllowMultiColumnSorting="true">
                            <Columns>
                                <telerik:GridMaskedColumn DataField="JobID" HeaderText="JobID#"
                                    FilterControlWidth="50px" AutoPostBackOnFilter="false" CurrentFilterFunction="EqualTo"
                                    FilterDelay="2000" ShowFilterIcon="false" Mask="#####" GroupByExpression="JobID Group By JobID">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridMaskedColumn>
                                <telerik:GridBoundColumn DataField="JobTitle" FilterControlAltText="Filter JobTitle column" HeaderText="Job Title" SortExpression="JobTitle" UniqueName="JobTitle">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text="" />
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>
                                <telerik:GridDateTimeColumn DataField="JobBookedDate" PickerType="DatePicker" EnableTimeIndependentFiltering="true"
                                    DataFormatString="{0:dd/MM/yyyy HH:mm }" DataType="System.DateTime" FilterControlAltText="Filter JobBookedDate column" HeaderText="Job Booked Date" SortExpression="JobBookedDate" UniqueName="JobBookedDate">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text="" />
                                    </ColumnValidationSettings>
                                </telerik:GridDateTimeColumn>
                                <telerik:GridTemplateColumn DataField="AssignedStaffID" HeaderText="Mobile Staff" UniqueName="AssignedStaffID"
                                    HeaderStyle-Width="200px" SortExpression="AssignedStaffID">
                                    <FilterTemplate>
                                        <telerik:RadComboBox ID="comboStaff" DataTextField="StaffName"
                                            DataValueField="StaffID" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("AssignedStaffID").CurrentFilterValue %>'
                                            runat="server" OnClientSelectedIndexChanged="StaffIndexChanged">
                                            <Items>
                                                <telerik:RadComboBoxItem Text="All" />
                                            </Items>
                                        </telerik:RadComboBox>
                                        <telerik:RadScriptBlock ID="RadScriptBlock10" runat="server">
                                            <script type="text/javascript">
                                                function StaffIndexChanged(sender, args) {
                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                    tableView.filter("AssignedStaffID", args.get_item().get_value(), "EqualTo");
                                                }
                                            </script>
                                        </telerik:RadScriptBlock>
                                    </FilterTemplate>
                                    <ItemTemplate>
                                        <%# Eval("Staff") %>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="CreatedBy" HeaderText="Added By" UniqueName="CreatedBy"
                                    HeaderStyle-Width="200px" SortExpression="CreatedBy">
                                    <FilterTemplate>
                                        <telerik:RadComboBox ID="comboAdded" DataTextField="StaffName"
                                            DataValueField="StaffID" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CreatedBy").CurrentFilterValue %>'
                                            runat="server" OnClientSelectedIndexChanged="AddedByIndexChanged">
                                            <Items>
                                                <telerik:RadComboBoxItem Text="All" />
                                            </Items>
                                        </telerik:RadComboBox>
                                        <telerik:RadScriptBlock ID="RadScriptBlock11" runat="server">
                                            <script type="text/javascript">
                                                function AddedByIndexChanged(sender, args) {
                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                    tableView.filter("CreatedBy", args.get_item().get_value(), "EqualTo");
                                                }
                                            </script>
                                        </telerik:RadScriptBlock>
                                    </FilterTemplate>
                                    <ItemTemplate>
                                        <%# Eval("AddedBy") %>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="PartCode" FilterControlAltText="Filter PartCode column" HeaderText="Part Code" SortExpression="PartCode" UniqueName="PartCode">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text="" />
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="PartName" FilterControlAltText="Filter PartName column" HeaderText="Part Name" SortExpression="PartName" UniqueName="PartName">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text="" />
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>
 
                                <telerik:GridNumericColumn DataFormatString="{0:$###,##0.00}" DataField="PartPurchasePrice" DataType="System.Double" NumericType="Currency"
                                    HeaderText="PurchasePrice" SortExpression="PartPurchasePrice" UniqueName="PartPurchasePrice" Aggregate="Sum" FooterAggregateFormatString="{0:C}">
                                    <FooterStyle Font-Bold="true"></FooterStyle>
                                </telerik:GridNumericColumn>
                                <telerik:GridNumericColumn DataFormatString="{0:$###,##0.00}" DataField="PartSalePrice" DataType="System.Double" NumericType="Currency"
                                    HeaderText="SalePrice" SortExpression="PartSalePrice" UniqueName="PartSalePrice" FooterText="Total:" Aggregate="Sum" FooterAggregateFormatString="{0:C}">
                                    <FooterStyle Font-Bold="true"></FooterStyle>
                                </telerik:GridNumericColumn>
                                <telerik:GridNumericColumn DataFormatString="{0:$###,##0.00}" DataField="JobPartUnitPrice" DataType="System.Double" NumericType="Currency"
                                    HeaderText="Unit Price" SortExpression="JobPartUnitPrice" UniqueName="JobPartUnitPrice" Aggregate="Sum" FooterAggregateFormatString="{0:C}">
                                    <FooterStyle Font-Bold="true"></FooterStyle>
                                </telerik:GridNumericColumn>
                                <telerik:GridNumericColumn DataField="JobPartQuantity" DataType="System.Double"
                                    HeaderText="Quantity" SortExpression="JobPartQuantity" UniqueName="JobPartQuantity" Aggregate="Sum" FooterAggregateFormatString="{0:n}">
                                    <FooterStyle Font-Bold="true"></FooterStyle>
                                </telerik:GridNumericColumn>
                                <telerik:GridNumericColumn DataFormatString="{0:$###,##0.00}" DataField="JobPartGST" DataType="System.Double" NumericType="Currency"
                                    HeaderText="JobPartGST" SortExpression="JobPartGST" UniqueName="JobPartGST" Aggregate="Sum" FooterAggregateFormatString="{0:C}">
                                    <FooterStyle Font-Bold="true"></FooterStyle>
                                </telerik:GridNumericColumn>
                                <telerik:GridNumericColumn DataFormatString="{0:$###,##0.00}" DataField="JobPartTotal" DataType="System.Double" NumericType="Currency"
                                    HeaderText="JobPartTotal" SortExpression="JobPartTotal" UniqueName="JobPartTotal" Aggregate="Sum" FooterAggregateFormatString="{0:C}">
                                    <FooterStyle Font-Bold="true"></FooterStyle>
                                </telerik:GridNumericColumn>
                            </Columns>
                            <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldName="JobID"></telerik:GridGroupByField>
                                    </GroupByFields>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldName="JobID" HeaderText="JobID#"></telerik:GridGroupByField>
                                    </SelectFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                        </MasterTableView>
                        <ClientSettings AllowDragToGroup="true">
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                        </ClientSettings>
                    </telerik:RadGrid>
Eyup
Telerik team
 answered on 01 Apr 2015
1 answer
106 views
I may be going about my solution the wrong way since I'm still quite a newb with Telerik Scheduler control. I am using the ajax + web service binding of appointments to the scheduler. I have two questions:
1. How do I get the new visible date range included in the new call to retrieve appointments? I am assuming that I can somehow get the new date range and set this in my ISchedulerInfo criteria object before the component issues a call to the GetAppointments(PortalSchedulerInfo schedulerInfo) web method;
2. Is it possible to manually maintain the list of appointments in the client for caching across navigations?
Plamen
Telerik team
 answered on 01 Apr 2015
1 answer
76 views
Hi,

I have one issue in radgrid, that is when resizing columns, the columns resize to a dimension not selected.
For eg: (screenshot attached), If I resize the column to say 240px, it will  expand to more than that and also in minimizing its size increases.

I have used the below code in client script.
<Resizing AllowColumnResize="true" AllowResizeToFit="false" />

Thanks,
Pavan
Venelin
Telerik team
 answered on 01 Apr 2015
2 answers
142 views
Hi. When I type in 29.10.38 into radcalendar and tab out it is assuming I mean 29 Oct 1938. But i mean 29 Oct 2038. How can I fix this?

Thanks
Chris
Chris
Top achievements
Rank 1
 answered on 31 Mar 2015
2 answers
245 views
The Grid has four columns (50%,15%,20%,15%) which are correct in width if there is data returned to fill the grid.  
If there is no data and the grid displays "No records to display" message the column width no longer is the same.  
How can I force the correct width of the columns regardless of getting records back or not?


<telerik:RadGrid ID="rgOptional" runat="server" AllowSorting="True" 
AutoGenerateColumns="False" DataSourceID="pdsOptional" Width="100%">
<MasterTableView OverrideDataSourceControlSorting="true" AllowSorting="true" DataKeyNames="EducationId" >
<Columns >
<telerik:GridTemplateColumn HeaderText='Optional Education Offerings' ItemStyle-Width="50%" >
<ItemTemplate>
<asp:LinkButton CommandName='SelectEducation' Runat='server' ID="lb_selectEducation1" ><%#DataBinder.Eval(Container.DataItem, "Name") %> </asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>                            
<telerik:GridBoundColumn DataField="Status" HeaderText="Status" HtmlEncode="False" SortExpression="Status" ItemStyle-Width="15%" />
<telerik:GridBoundColumn DataField="CompletionDate" DataFormatString="{0:g}" HeaderText="Completion Date" HtmlEncode="False" SortExpression="CompletionDate" ItemStyle-Width="20%" />
<telerik:GridBoundColumn DataField="PC" HeaderText="PC" SortExpression="PC" ItemStyle-Width="15%" />
</Columns>
</MasterTableView>
</telerik:RadGrid> 

<FHS:PageDataSource ID="pdsOptional" runat="server" SelectMethod="GetAllOptionalEducationOfferings" />
            








Patrick
Top achievements
Rank 1
 answered on 31 Mar 2015
0 answers
123 views
I am facing issue with new telerik control and external jquery please advace us how  to use it


Unhandled exception at line 6982, column 65 in http://localhost/MaestroWebSite/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en-US:f319b152-218f-4c14-829d-050a68bb1a61:ea597d4b:b25378d2;Telerik.Web.UI, Version=2015.1.225.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en-US:d3cd47d0-4d93-4bad-8b9f-f9fea0aa4c69:16e4e7cd:f7645509:24ee1bba:6d43f6d9:2003d0b8:f46195d3:c128760b:88144a7a:1e771326:aa288e2d:258f1c72:2bef5fcc:e06b58fd:583660290x800a138f - JavaScript runtime error: Unable to get property 'scrollHeight' of undefined or null reference
Srinivas
Top achievements
Rank 1
 asked on 31 Mar 2015
1 answer
106 views
Hi all,

As per our requirement, I am analysing Telerik Rad Ajax grid features, I observed, “Grid Resize” feature are not supporting.

Can you please provide sample code or suggestion, how can implement "Grid Resize" feature in Rad Grid.

 

Regards
Vasu.

Pavlina
Telerik team
 answered on 31 Mar 2015
5 answers
427 views
I have a RadGrid that is bound to a objectDataSource and everything is working when using the save/cancel buttons for initiating a change; however when the user presses enter after supplying a value... the data will not submit; it just refreshes the datasource.

Here is some sample code:
01.<%@ Page Title="Goods Received" Language="C#" MasterPageFile="~/App_Masterpage/PurchaseRequest.master" AutoEventWireup="true" CodeFile="Received.aspx.cs" Inherits="apps_rc_purchasing_my_Default" %>
02. 
03.<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
04.<asp:Content ID="Content2" ContentPlaceHolderID="main_content" runat="Server">
05.    <div class="container">
06.        <div class="row">
07.            <h3>Goods Received</h3>
08.            <p>
09.                This page has been configured to allow you to adjust the received quantity.
10.            </p>
11.        </div>
12.        <div class="row">
13.            <telerik:RadGrid ID="rgRequests" MasterTableView-DataKeyNames="DPO,DLINE" MasterTableView-EnableViewState="true"
14.                OnPreInit="rgRequests_PreInit" EnableViewState="true" ItemStyle-Font-Size="smaller" AlternatingItemStyle-Font-Size="smaller"
15.                EnableLinqExpressions="false" PageSize="20" AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="false" runat="server"
16.                CssClass="cat table table-bordered" DataSourceID="odsRequests" OnItemUpdated="rgRequests_ItemUpdated"
17.                AllowAutomaticInserts="false" AllowAutomaticUpdates="true" AutoGenerateColumns="false" Skin="Metro">
18.                <MasterTableView EditFormSettings-EditColumn-AutoPostBackOnFilter="true" HeaderStyle-CssClass="subhead" BatchEditingSettings-EditType="Row"
19.                    EditMode="Batch" CommandItemSettings-SaveChangesText="Save" CommandItemSettings-ShowSaveChangesButton="true"
20.                    CommandItemDisplay="TopAndBottom"  CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowRefreshButton="false">
21.                    <Columns>
22.                        <telerik:GridBoundColumn ReadOnly="true" AllowFiltering="false" HeaderStyle-Width="30px" HeaderText="PO #" DataField="DPO" Visible="true" />
23.                        <telerik:GridBoundColumn ReadOnly="true" AllowFiltering="false" HeaderStyle-Width="30px" HeaderText="Line #" DataField="DLINE" Visible="true" UniqueName="DLINE" />
24.                        <telerik:GridBoundColumn ReadOnly="true" AllowSorting="true" CurrentFilterFunction="Contains" HeaderStyle-Width="180px" AutoPostBackOnFilter="true" DataField="DITEM" HeaderText="Item" MaxLength="25" />
25.                        <telerik:GridNumericColumn ReadOnly="true" AllowSorting="true" CurrentFilterFunction="Contains" HeaderStyle-Width="180px" AutoPostBackOnFilter="true" DataField="DQTY" HeaderText="Quantity" MaxLength="25" />
26.                        <telerik:GridNumericColumn AllowSorting="true" CurrentFilterFunction="Contains" HeaderStyle-Width="180px" AutoPostBackOnFilter="true" DataField="DRQTY" HeaderText="Rcvd Quantity" MaxLength="25" UniqueName="DRQTY" />
27.                    </Columns>
28.                </MasterTableView>
29.            </telerik:RadGrid>
30.        </div>
31.        <div class="row" runat="server" id="dbInfo">
32.            <div class="text-danger" runat="server">
33.                <h3>Admin Information</h3>
34.                <div class="list-group">
35.                    <div id="notify" class="list-group-item" runat="server"></div>
36.                </div>
37.            </div>
38.            <div class="example">
39.                <strong>Database:</strong><small>Web.Config - LIBD31USR - POPPOD - INLINE DATASOURCE - <strong>Usage:</strong> <span class="bs bs-example text-success">RiggsCAT.Finance.PurchaseRequestDET.Search(string search), PurchaseRequestDET.Update(string POID, string DLINE, int DRQTY)</span></small>
40.                <asp:ObjectDataSource ID="odsRequests" runat="server" SelectMethod="GetRequestsByPO" TypeName="RiggsCAT.Finance.PurchaseRequestDET" UpdateMethod="UpdateReceivedQty">
41.                    <SelectParameters>
42.                        <asp:QueryStringParameter QueryStringField="POID" Type="String" Name="PO" />
43.                    </SelectParameters>
44.                    <UpdateParameters>
45.                        <asp:Parameter Name="DPO" Type="String"  />
46.                        <asp:Parameter Name="DLINE" Type="String" />
47.                        <asp:Parameter Name="DRQTY" Type="Int32" />
48.                    </UpdateParameters>
49.                </asp:ObjectDataSource>
50.            </div>
51.        </div>
52.    </div>
53.</asp:Content>

Konstantin Dikov
Telerik team
 answered on 31 Mar 2015
1 answer
71 views
I have attempted to recreate this demo on my local PC with the northwind DB:

http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultcs.aspx

Unfortunately, the clientside call in the client pageload event:

PageMethods.GetData(0, tableView.get_pageSize(),

does not initiate the following serverside code:

public static List<Employee> GetData(int startIndex, int maximumRows,

string sortExpressions, List<GridFilterExpression> filterExpressions)

this function fails here:

function RadGrid1_RowDataBound(sender, args) {

var radTextBox1 = args.get_item().findControl("LastName"); 

radTextBox1.set_value(args.get_dataItem()["LastName"]); fails here

}

Can someone please explain why the client side call does not work or provide me with a better example of clientside data binding.

Thanks in advance.

Mark
Pavlina
Telerik team
 answered on 31 Mar 2015
1 answer
124 views
Folks:

I have attempted to recreate the demo here: http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultcs.aspx. I have a blank and broken grid since this web method:
 public static List<Employee> GetData(int startIndex, int maximumRows,

string sortExpressions, List<GridFilterExpression> filterExpressions)

is not being called from this client script:
PageMethods.GetData(0, tableView.get_pageSize(),

tableView.get_sortExpressions().toString(), tableView.get_filterExpressions().toList(),

updateGrid);

Without this data the following client call is failing with a null error:

function RadGrid1_RowDataBound(sender, args) {

var radTextBox1 = args.get_item().findControl("LastName"); // find control

radTextBox1.set_value(args.get_dataItem()["LastName"]); fails here

}

Can anyone please explain why the server side portion is not being called or provide a better example of client side data binding.

Thanks in advance.

Mark


Pavlina
Telerik team
 answered on 31 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?