Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
141 views
Dear Telerik,

I'm experiencing a small problem regarding the radgrid in combination with filtering, paging and using a custom aggregate function.

The scenario is as following:

We have a grid with 1 mastertableview. The columns are not auto generated, but are either bound or a template.
The grid supports filtering (both textbox and combobox filering in the column headers). Also paging is enabled.

In the grid we have 3 columns, named ColumnA, ColumnB, ColumnC.
ColumnC is the calculated result of ColumnA x ColumnB.
Below ColumnA and ColumnC we show 2 total footers. For this we used the aggregate function SUM. This works like a charm, and the totals are shown in the footer of the grid.This is the total of ALL items currently available in the grid. In other words, the total does both respect the filter and the paging. (say my datasource has 100 items, my filter reduces it to 70, and my page shows 50 items, the sum is calculated over 70 items, this is what we want).

In the footer of the ColumnB we want to show an average in the form of SUM(ColumnC) / SUM(ColumnA). For this we can't simply use the aggregate function AVG on ColumnB as it would give a different result than the one we need.

Whats the best approach to get the desired functionality?

I've tried to use the item databound event, but then it ignores the filter and i get to many items.
I've tried to use the custom aggregate function, but when i access the items from the masterviewtable, it only returns me the items of the current page i am in.

Atm i solved it in the pre render method. There i accesed the footer items for ColumnA and ColumnC, parsed the text properties back to values and calculated the result, and then set it to the footer of ColumnB.

But i am sure there must be some other approach.

Thanks in advance,

Ramon
RR SoftSol
Top achievements
Rank 1
 asked on 10 May 2012
0 answers
101 views

hi, 
when I export my radGrid which contain French character in column title , titles appears in chine character in excel result . 

This is my export config and event code .

Thank’s 



public void ConfigureExport()
  {
      try
      {
 
          
          GridPJ.ExportSettings.FileName = getExcelFileName((CImport)Session["CImport"]);
          GridPJ.ExportSettings.IgnorePaging = true;
          GridPJ.ExportSettings.OpenInNewWindow = true;
           
          GridPJ.ExportSettings.ExportOnlyData = true;
          GridPJ.DataBind();
          foreach (GridColumn col in GridPJ.MasterTableView.RenderColumns)
          {
              col.Visible = true;
              col.Display = true;
 
          }
 
          GridPJ.Rebind();
      }
      catch (Exception e)
      {
 
      }
 
 
 
  }
 
  protected void GridPJ_ItemCommand(object source, GridCommandEventArgs e)
  {
      if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName ||
         e.CommandName == Telerik.Web.UI.RadGrid.ExportToPdfCommandName ||
         e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
              {
                  ConfigureExport();               
              }
   }
Sofiene
Top achievements
Rank 1
 asked on 10 May 2012
3 answers
253 views
hi all,

well i have a question, i am using a telerik RadGrid to bind the data from the server end and i need the filter that data on the client end without hitting the server again i.e. without getting the data back from database.

i know it is possible with using columns and binding the data back with GridBoundColumn but my problem is that i am using ItemTemplate within which i am creating the table to make it look just like my client needs, so is it possible to filter the data in the ItemTemplate without columns(gridboundcolumns).

i hope i make sense out of it.

Thanks in advance, 

waiting for the possible solution asap.

Gaurav Sharma
Eyup
Telerik team
 answered on 10 May 2012
3 answers
207 views
Hello,

As I know it is not possible to upload the whole folder/directory using RadAsyncUpload control.
However, when I drag and drop folder, it is accepted, but upload fails of course.

Is there any way to cancel drop folder event?

I tried something like this:
function OnClientFileUploaded(sender, eventArgs) {
   if (eventArgs.get_fileInfo().ContentLength == 0 && eventArgs.get_fileInfo().ContentType == null) {
                $("#" + "<%= hfRemoveFileIndex.ClientID %>").val(eventArgs.get_fileInfo().Index);
                $("#" + "<%= btnRemoveFile.ClientID %>").click();          
            }
        }
And on server side
protected void btnRemoveFile_OnClick(object sender, EventArgs e)
{
    int indexID = int.Parse(hfRemoveFileIndex.Value);
    RadAsyncUpload1.UploadedFiles.RemoveAt(indexID);
}
But then all uploaded files are lost, not just the problematic folder.

Alternately I when process uploaded files I can ignore those where the ContentLength is 0, but this also makes problems when user wants to upload empty file.

Thanks
Marko
Plamen
Telerik team
 answered on 10 May 2012
9 answers
299 views
I am using the RadTabastrip on demand load example. I have one RadDatePicker in the first usercontrol, which works fine. I want to have 2 raddatepickers in second usercontrol, but when second user control loads by clicking on the second tab, javascript needed to show the popup calender for those 2 raddatepickers does not load, so the raddatepickers don't work.
Can you please suggest how can I make that work?

Thanks.
Om
Top achievements
Rank 1
 answered on 10 May 2012
1 answer
90 views
I am using the office2010black skin with my radbuttons.  I wanted the button to stay the orange color it turns to after the user clicks on it.   how do I do this?
Slav
Telerik team
 answered on 10 May 2012
7 answers
120 views
Hi,

I am using RadScheduler with websevice (v.2012.1.411). I use args.get_schedulerInfo() to pass extra info to the webservice on event OnClientAppointmentsPopulating,  it is working well.

But when I try to use args.get_schedulerInfo() in event OnClientAppointmentWebServiceInserting, It pops up javascrip undefined error. I checked the online document http://www.telerik.com/help/aspnet-ajax/p_telerik_web_ui_radscheduler_onclientappointmentwebserviceinserting.html , This property should be supported in this event. here is the code,
function OnClientAppointmentWebServiceInserting(sender, args) {
    var schedulerInfo = args.get_schedulerInfo();
    alert(schedulerInfo);
    var userName = '<%=UserName %>';               
    schedulerInfo.UserName = userName;
}

Thanks in advance

Jason
Peter
Telerik team
 answered on 10 May 2012
1 answer
74 views
Hi,
        I have a Radcombo radItem and in item request event , binding the data according to the search type. My issue is , search a word with "fruit basket" and populate all  item name including the fruit basket . but i removing the fruit basket from search area then item populate first with name include "Fruit" and after sometime combo populate item with no search condition.....  Loading message notification not showing while deteting the text from search area.... this is my issue...  Please help.....

Thanks in advance
Jesmon Joseph
Ivana
Telerik team
 answered on 10 May 2012
1 answer
64 views
Here is my code :

<%@ Page Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false" CodeBehind="Calendar.aspx.vb" Inherits="Digicontacts_Web_Final.Calendar" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<asp:Content ID="content1" ContentPlaceHolderID="MainContent" runat="server">

    <div id="settings-container">
    <script type="text/javascript">
        
        function rebindScheduler() {
            var scheduler = $find('<%=RadScheduler1.ClientID %>');
            scheduler.rebind();
        }
    
    
    </script>
    <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Width="200px"
            Skin="Transparent">
            
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Mes Agendas" ForeColor="#404040">
                        <Items>
                            <telerik:RadPanelItem runat="server" ForeColor="#404040">
                                <ItemTemplate>
                                    <div class="rpCheckBoxPanel">
                                        <telerik:RadTreeView ID="RadTreeView2" Runat="server" CheckBoxes="True"
                                            DataSourceID="SqlDataSource1" DataTextField="calendar_name"
                                            TriStateCheckBoxes="False">
                                        </telerik:RadTreeView>
                                        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                                            ConnectionString="<%$ ConnectionStrings:vicidial_V4ConnectionString %>"
                                            ProviderName="<%$ ConnectionStrings:vicidial_V4ConnectionString.ProviderName %>"
                                            SelectCommand="SELECT calendar_name FROM digi_calendar"></asp:SqlDataSource>
                                        
                                    </div>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
     </div>
    <div id="scheduler-container">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:vicidial_V4ConnectionString2 %>"
            ProviderName="<%$ ConnectionStrings:vicidial_V4ConnectionString2.ProviderName %>"
            SelectCommand="SELECT id, start_date_time, end_date_Time, subject, description, location FROM digi_calendar_events">
        </asp:SqlDataSource>
        <telerik:RadScheduler ID="RadScheduler1" runat="server" Culture="fr-FR"
            DataDescriptionField="location" DataEndField="end_date_Time" DataKeyField="id"
            DataSourceID="SqlDataSource1" DataStartField="start_date_time"
            DataSubjectField="subject" EnableDescriptionField="True" Height="600px"
            Width="1000px">
        </telerik:RadScheduler>
     </div>

</asp:Content>

I would like to view by appointment only if I check the box on my agenda but I do not know.
Can you help me?
Ivana
Telerik team
 answered on 10 May 2012
3 answers
68 views
i am using a popup web control as the edit form for my rad grid. i added  a RadAjaxLoadingPanel and a RadAjaxManager to display progress for a slow-loading combobox. now, when i attempt to close or click "cancel" in my web control i get the error below:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: A control with ID 'ctl00$ContentPlaceHolder1$RadGridProductionOrders$ctl00$ctl06$Detail10$ctl12$EditFormControl$RadComboBoxItemCodeFilters' could not be found for the trigger in UpdatePanel 'ctl00$ContentPlaceHolder1$RadGridProductionOrders$ctl00$ctl06$Detail10$ctl12$EditFormControl$PanelMainPanel'.
Andrey
Telerik team
 answered on 10 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?