Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
137 views
Hello.
I have grid with custom aggregate in one column and export to PDF/Excel abilities. When I view in browser aggregation works ok, but there is no aggregation in exported documents. Here is my code:

<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
    OnItemCreated="RadGrid1ItemCreated" OnNeedDataSource="RadGrid1NeedDataSource"
    OnCustomAggregate="RadGrid1CustomAggregate" OnExcelMLExportRowCreated="RadGrid1ExcelMlExportRowCreated"
    OnExcelMLExportStylesCreated="RadGrid1ExcelMlExportStylesCreated" AllowFilteringByColumn="True"
    AllowSorting="True" CellSpacing="0" OnItemDataBound="RadGrid1ItemDataBound">
    <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
        <Excel Format="ExcelML" />
        <Pdf PageTitle="Charity Print-Out" Title="Charity Print-Out" PageHeight="210mm" PageWidth="500mm"
            DefaultFontFamily="Arial Unicode MS" PageBottomMargin="20mm" PageTopMargin="20mm"
            PageLeftMargin="20mm" PageRightMargin="20mm" />
    </ExportSettings>
    <PagerStyle Mode="NextPrevAndNumeric" />
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="DonationId" CommandItemDisplay="Top"
        Width="100%" AllowPaging="True" NoDetailRecordsText="" NoMasterRecordsText=""
        ShowGroupFooter="true" UseAllDataFields="True">
        <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="False"
            ShowRefreshButton="False" ShowExportToPdfButton="True" />
        <PagerStyle Mode="NextPrevAndNumeric" />
        <Columns>
            <telerik:GridBoundColumn DataField="CHR_CHARITY_NAME" HeaderText="Charity Name" ReadOnly="True"
                UniqueName="CHR_CHARITY_NAME" Visible="False" />
            <telerik:GridBoundColumn DataField="DonationInternalId" HeaderText="Client Donation ID"
                ReadOnly="True" UniqueName="DonationInternalId" />
            <telerik:GridBoundColumn DataField="DonorName" HeaderText="Donor's Name" ReadOnly="True"
                UniqueName="DonorName" />
            <telerik:GridBoundColumn DataField="DonorAddress" HeaderText="Donor's Address" ReadOnly="True"
                UniqueName="DonorAddress" />
            <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="Email" ReadOnly="True"
                UniqueName="EmailAddress" />
            <telerik:GridBoundColumn DataField="PermissionToContact" HeaderText="Permission To Contact"
                ReadOnly="True" UniqueName="PermissionToContact" />
            <telerik:GridBoundColumn DataField="DateOfDonation" HeaderText="Donation Date" ReadOnly="True"
                UniqueName="DateOfDonation" />
            <telerik:GridBoundColumn DataField="NotesToCharity" HeaderText="Donor Notes" ReadOnly="True"
                UniqueName="NotesToCharity" />
            <telerik:GridBoundColumn DataField="DonationAmount" HeaderText="Donation Amount"
                ReadOnly="True" UniqueName="DonationAmount" DataFormatString="{0:C}" Aggregate="Custom"
                FooterText=" " />
        </Columns>
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="CHR_CHARITY_NAME" />
                </GroupByFields>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="CHR_CHARITY_NAME" HeaderText=" " HeaderValueSeparator=" " />
                    <telerik:GridGroupByField FieldName="CHR_BN_NUMBER" HeaderText="-" HeaderValueSeparator=" " />
                </SelectFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
    </MasterTableView>
</telerik:RadGrid>

And code-behind:

protected void RadGrid1CustomAggregate(object sender, GridCustomAggregateEventArgs e)
{
    if (e.Item.DataItem == null)
    {
        return;
    }
    const string result = "<table style=\"border-collapse:collapse;text-align:left;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" +
                          "<tr><td style=\"text-align:left;\">Total Donations:</td><td>${0}</td></tr>" +
                          "<tr><td style=\"text-align:left;\">Processing & Transaction Fees @ 8%:</td><td>${1}</td></tr>" +
                          "<tr><td style=\"text-align:left;\">Net Donation Amount:</td><td>${2}</td></tr>" +
                          "</table>";
    double totalDonations = 0, netDonationAmount = 0, fees = 0;
    foreach (DataRow row in dataTable.Rows)
    {
        if (row["CHR_CHARITY_NAME"].ToString() != ((DataRowView)e.Item.DataItem).Row.ItemArray[0].ToString())
        {
            continue;
        }
        if (row["DonationAmount"] != null)
        {
            totalDonations += (double)row["DonationAmount"];
        }
        if (row["NetDonationAmount"] != null)
        {
            netDonationAmount += (double)row["NetDonationAmount"];
        }
        if (row["Fees"] != null)
        {
            fees += (double)row["Fees"];
        }
    }
    e.Result = String.Format(result, totalDonations.ToString("0.00"), fees.ToString("0.00"), netDonationAmount.ToString("0.00"));
}

What I am doing wrong?
Daniel
Telerik team
 answered on 10 Aug 2012
1 answer
214 views

Is it possible to apply RadGrid Styles to asp.net Grid View? Any code sample?

I found this sample (BUT this one is for Generic HTML table)
http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/using-telerik-skin-on-generic-table.aspx 
 It is applying webblue theme and it is NOT applying hover color..

I am looking for Hay or Forest theme. Where can I download those files?
Tsvetina
Telerik team
 answered on 10 Aug 2012
3 answers
239 views
This is kind of an odd problem. I have two environments. Both running SharePoint 2010. Same software and configuration on both. In dev my combobox works fine but once it's deployed to test the combobox acts like it is disabled. The combobox is in a radgrid and there is a javascript error when the row is expanded that the combobox is in. The error is "TypeError: h is not a constructor
https://site.com/ScriptResource.axd?d=W3VnxZIztGbCDKsquF9usLpO8arHyM1n_yidsMg0IaOQVKbSAKbUEBJDrGFGi4-QgmAjM7HywJgZHYjTu0Tn5eaeE4RtTKrP8BaZjX7dJkBEMXpkn7vpFGr21ix6C_gWer2-t6UM1llpQNJr7X0qxaAfP7A1&t=ffffffffb868b5f4
Line 5" Now this doesn't tell me much but I believe it is coming from the MicrosoftAjax.js that is included with the Telerik controls. We are currently on version 2012.1.301.35. Does anyone have any ideas on what could be causing this? 
Plamen
Telerik team
 answered on 10 Aug 2012
3 answers
169 views
Does anyone know if we can filter dropdownlist in the resourcetype?  I was able to create dropdownlists with values but can't filter them.  I'm not sure if Telerik scheduler have that feature.
I need to be able to filter the selections from a dropdownlist in the radscheduler in the resource type collection.  Please help.

<

 

 

telerik:RadScheduler ID="RadScheduler1" runat="server"

 

 

 

DataDescriptionField="Description" DataEndField="End_Date" DataKeyField="ID"

 

 

 

DataSourceID="SqlDataSource1" DataStartField="Start_Date"

 

 

 

DataSubjectField="Subject" EnableDescriptionField="True">

 

 

 

<ResourceTypes>

 

 

 

<telerik:ResourceType DataSourceID="SqlDataProgramtype"

 

 

 

ForeignKeyField="Programs" KeyField="Programs" Name="Programtype"

 

 

 

TextField="Programs" />

 

 

 

<telerik:ResourceType DataSourceID="SqlDatastaff" ForeignKeyField="Users"

 

 

 

KeyField="Full_Name" Name="Staff" TextField="Full_Name" />

 

 

 

<telerik:ResourceType DataSourceID="SqlDataRooms" ForeignKeyField="ROOMS"

 

 

 

KeyField="ROOMNAME" Name="Rooms" TextField="ROOMNAME" />

 

 

 

</ResourceTypes>

 

<

 

 

WebServiceSettings>

 

<

 

 

ODataSettings InitialContainerName=""></ODataSettings>

 

</

 

 

WebServiceSettings>

 

 

 

</telerik:RadScheduler>

 

Ivana
Telerik team
 answered on 10 Aug 2012
1 answer
97 views
Hi, I was testing the upload on your site and it worked fine in Motzilla, Chrome and Firefox but did not function properly in IE. I am using IE 8 on Windows 7 and the only thing I see is the Check Box, Gray Text box , and a remove button but no "Select button". However, when I click on the gray box I get the dialog with my files and if I select a file and click open nothing happens. In the other browsers the file name would appear in the box but not in IE. I tried in compatability mode as well but get the same results.

http://demos.telerik.com/aspnet-ajax/upload/examples/customizingraduploadui/defaultcs.aspx?RadUrid=c5d68f5f-7e5d-488b-a2d1-8b4fa981e412

Thanks,
Paul
Plamen
Telerik team
 answered on 10 Aug 2012
1 answer
486 views
Hi everyone,
I'm trying to do something I thought was quite simple. I have a RadGrid bound to a webservice (working fine!). For different reasons, I need a custom edit command for the grid. With Serverside-binding this is easily achieved using a simple GridButtonColumn and a custom CommandName. On the server I was used to get the edited row via 
Dim dataItem As GridDataItem = DirectCast(e.Item, GridDataItem)
dataItem.GetDataKeyValue("id")

However, due to the client-side binding to a webservice, that is no longer possible. So I thought I'd get it client-side instead and send it to the server separately (using RadAjaxManager for instance). However, the client-side OnCommand event does not seem to offer any way of getting a dataKeyValue, dataItem or even rowIndex of the gridRow that was clicked. I tried something like this:
function OnCommand(sender, args) {
     if (args.get_commandName() == "Edit1") {
          var CommandArg = args.getDataKeyValue("id");
     }
}

Obviously to no avail...

I guess my question boils down to:
Is there any practical way of getting a reference to the dataItem or even a rowIndex to the server on ItemCommand when the RadGrid is bound to a webservice?

Thanks in advance!
Tsvetoslav
Telerik team
 answered on 10 Aug 2012
2 answers
284 views
I've been reading the posts on how you get the radgrid to fill it's container to 100% som that when the user expands the browser window, the grid expands with it. The problem I'm getting is that when set to height=100%, the grid is outside the page. If I make it smaller so it's all visible, then the visible margin to the bottom of the window shrinks when I decrease the window height. Fine, it's percent, right? But you would think the radgrid would stay withing the window, which it doesn't.

When all parent containers and the grid is set to 100%, the grid displays larger than the window. It's contained in a pageview, in a tabstrip.
I believe that the height of 100% set on the grid is somehow not taking the fixed header into account or maybe my user control menu at the very top is offseting the container?

I would appreciate help. My desired look is of true Height = Auto, where the grid would keep a fixed distance from the bottom of the window.

Robert
Top achievements
Rank 1
 answered on 10 Aug 2012
1 answer
101 views
Hello

I would like to check whether Telerik 2009.2.701.20 supports IE 9. Currently we are using Telerik 2009.2.701.20 with IE 7 and 8. We would like upgrade to IE 9.

Please check and let me know the feasibility. Also let me know the list of compatible browsers with their version for above mentioned Telerik release.

Thanks
Prasanna
BabaYa
Top achievements
Rank 1
 answered on 10 Aug 2012
3 answers
214 views
I need do the radwindows that i attach in the second file
I set height = 150px but does not work.

How I can do this??
rdmptn
Top achievements
Rank 1
 answered on 10 Aug 2012
3 answers
193 views
Hello,

I'm trying to change the text in the filter control in RadGrid,such as "NoFilter","Contains","DoesNotContain","StartWith" and so on.
How can I change these texts?
And I needn't change the functions.

Thank you.
Radu
Top achievements
Rank 1
 answered on 10 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?