Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
165 views

 

 

Hi,
I have a grid where I am dynamically creating all of my columns because I do not know the columns that will be returned at design time.  I also want to add a Total column at the end that is going to summarize the particular month range the user has selected.  My column is created correctly if I hardcode the months (see commented line below); however, if I try to build a similar string and pass that in the datafields, I get the error "Telerik.Web.UI.GridException: DataField "JAN10","FEB10","MAR10","APR10","MAY10","JUN10" for GridCalculatedColumn "Total" does not exist in current DataSource.".  You can see from the error message that my string is in the correct format.  I have seen posts on the forum regarding similar issues and it said that it was fixed in the latest release, but mine is still failing.  I am using 10.2. 

Thanks,
Tami

 

private void CreateCalcColumn(GridTableView oTableView, string sMonths) 
       { 
           GridCalculatedColumn totalColumn; 
           totalColumn = new GridCalculatedColumn(); 
           oTableView.Columns.Add(totalColumn); 
           totalColumn.UniqueName = "Total"; 
           totalColumn.Expression = "{0}+{1}"; 
           totalColumn.DataType = typeof(double); 
           totalColumn.DataFields = new string[] { lstMonths }; 
           //totalColumn.DataFields = new string[] { "JAN10", "FEB10" }; 
           totalColumn.Aggregate = Telerik.Web.UI.GridAggregateFunction.Sum; 
           totalColumn.HeaderText = "Total"; 
           totalColumn.HeaderStyle.CssClass = "gridheader"; 
       }

Martin
Telerik team
 answered on 31 Aug 2010
2 answers
129 views
I have a page that is using a RadAjaxManager to update some controls on the page. The controls that get updated can either be visible or not depending on some condition when the page is first loaded. The RadAjaxManager however still lists both of the controls as being p[art of the updated controls. I have found that if an invisible control is part of the updated controls, the AjaxControl for which it belongs will be incorreclty fired on the second postback, even though no event has been raised. Below is a simple page reproducing the problem (i took a while to track it down!)

ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FayezTest.aspx.cs" Inherits="Utilities_FayezTest" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="script1" runat="server">
    </asp:ScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="WorkClassificationValue">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="WorkClassificationValue" />
                    <telerik:AjaxUpdatedControl ControlID="EmployeeValue" />
                    <telerik:AjaxUpdatedControl ControlID="SitesValue" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="EmployeeValue">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="EmployeeValue" />
                    <telerik:AjaxUpdatedControl ControlID="Test" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadComboBox ID="WorkClassificationValue" runat="server" CssClass="DatabaseFieldName"
            AutoPostBack="true" Width="100%" AllowCustomText="true">
            <CollapseAnimation Duration="200" Type="OutQuint" />
            <ExpandAnimation Type="OutQuart" />
        </telerik:RadComboBox>
        <asp:Panel ID="EmployeeSection" runat="server" Visible="false">
            <table class="DatabaseField" id="Table2" runat="server">
                <tr>
                    <td class="DatabaseFieldLeft">
                        <asp:Label ID="Label3" Text="Add Employees:" runat="server" CssClass="" />
                    </td>
                    <td class="DatabaseFieldRight">
                        <telerik:RadComboBox ID="EmployeeValue" runat="server" AutoPostBack="true" Width="100%"
                            ShowToggleImage="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                            Height="120px" AllowCustomText="true" EmptyMessage="Please type or select employee name">
                            <CollapseAnimation Duration="200" Type="OutQuint" />
                            <ExpandAnimation Type="OutQuart" />
                        </telerik:RadComboBox>
                    </td>
                </tr>
            </table>
            <br />
        </asp:Panel>
        <asp:Panel ID="SiteSection" runat="server">
            <telerik:RadComboBox ID="SitesValue" runat="server">
            </telerik:RadComboBox>
        </asp:Panel>
        <asp:Label ID="Test" runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>

This is the code behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LogicRoster.Business;
using Telerik.Web.UI;
using EmpowerIT.Applications;
using System.Collections;
 
public partial class Utilities_FayezTest : System.Web.UI.Page
{
     
    protected void Page_Load(object sender, EventArgs e)
    {
       
        EmployeeValue.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(EmployeeValue_SelectedIndexChanged);
 
        WorkClassificationValue.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(WorkClassificationValue_SelectedIndexChanged);
 
       if(!this.IsPostBack)
       {
           EmployeeSection.Visible = true;
           SiteSection.Visible = false;
 
           WorkClassificationValue.Items.Add(new RadComboBoxItem("Item #1", "1"));
           WorkClassificationValue.Items.Add(new RadComboBoxItem("Item #2", "2"));
           WorkClassificationValue.Items.Add(new RadComboBoxItem("Item #3", "3"));
 
           EmployeeValue.Items.Add(new RadComboBoxItem("Item 1", "1"));
           EmployeeValue.Items.Add(new RadComboBoxItem("Item 2", "2"));
           EmployeeValue.Items.Add(new RadComboBoxItem("Item 3", "3"));
       }
    }
 
  
 
    void WorkClassificationValue_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        EmployeeValue.ClearSelection();
        EmployeeValue.Text = "";
    }
 
    void EmployeeValue_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
     
        Test.Text += String.Format("Selected value is: '{0}'<br/>", e.Value);
    }
 
}


As you can see, in the Page_Load event, I intially set the SiteSection.Visible property to false. However, the control in this section, SiteValue, is listed as an item that will be updated by WorkClassificationValue. In this example it is not updated at all, however its updated was goverened by wether or not the section it was in was visible. If you select an item from the WorkClassificationCombo, and then select an item from the EmployeeCombo, you will notice that on the post back for the EmployeeCombo, the WorkClassificationValue_SelectedIndexChanged will fire incorrectly and end up clearing the selected value for the EmployeeValue combo.
If i remove the RadAjaxManager and use full postbacks, everything behaves as expected. Also, if set the SiteSection.Visible property to true, everything also behaves as expected.

Could someone please help or let me know if this is expected behavior or a known bug.

Thanks,
Iana Tsolova
Telerik team
 answered on 31 Aug 2010
1 answer
58 views
When using radEditor I open the image manager and it loads everything fine.
As soon as i select a folder it shows the animated waiting circle and hangs for a few minutes then it times out.
this only happens on some browsers using IE. it doesn't happen when I use fire fox.
This has been happening for months and I need to resolve the issue immediately.

Regards,

Trevor
Rumen
Telerik team
 answered on 31 Aug 2010
6 answers
209 views
Hello,
We are having a problem with RadGrid export to CSV format,
we have a grid with a template column containing textbox bound to a string field,
When exporting to excel or to word or to pdf, it works fine,
but exporting to CSV doesn't export template columns
Below is the template column.
<telerik:GridTemplateColumn DataField="Field1" SortExpression="Field1"
                                  UniqueName="Field1
"
HeaderText="<%$ Resources:Distributor_resource, Field1%>"
                                  AllowFiltering="true" 
                                  <ItemTemplate>
                                      <asp:TextBox ID="txtField1
"
runat="server" Text='<%#Bind("Field1")%>'></asp:TextBox>
                                  </ItemTemplate>
                              </telerik:GridTemplateColumn>
Thanks in advance
Stanislav Dudnyk
Top achievements
Rank 1
 answered on 31 Aug 2010
1 answer
161 views
Is there a way to change the color of the red box around the red number in the pager of the grid?
I'd like to change the color of the chosen page number (from red) and the red box around that number (pic attached).

Thanks!
Shinu
Top achievements
Rank 2
 answered on 31 Aug 2010
1 answer
64 views
Hi 

i am working small example on rad grid form template.when  edit the row then i select the rad combo box then i click submit.it is showing error.

the Code i user is ...

 RadComboBox ddList = editedItem.FindControl("ddladdress") as RadComboBox;
                    string ddltext = ddList.SelectedItem.Text;

Give me any example  or any solution.where i am struck.



thanks



Shinu
Top achievements
Rank 2
 answered on 31 Aug 2010
3 answers
176 views

Hi, I would like to display footer with total record. I am successfully display it. However, when i am export to pdf, the correct total show in the footer however, the export does not exporting all record even in the radgrid itself the record has more than one page. Please advise

 

 

 

 

private int parentAccountWithChildTotalCount = 0;

 

 

 protected void ParentAccountGridWithChild_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridFooterItem)
        {
            GridFooterItem footer = (GridFooterItem)e.Item;
            Label lblTotalRowCount = new Label();
            lblTotalRowCount.Text = "Total Record: " + this.parentAccountWithChildTotalCount.ToString();
            footer["Firstname"].Controls.Add(lblTotalRowCount);
        }
    }
 

public int ParentAccountWithChildTotalCount
    {
        set { parentAccountWithChildTotalCount = value; }
    }

protected void ParentExportPDFButton_Click(object sender, EventArgs e)
    {
        ParentAccountWithChild.ExportSettings.ExportOnlyData = true;
        ParentAccountWithChild.MasterTableView.ExportToPdf();
       
    } 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Mark de Torres
Top achievements
Rank 1
 answered on 31 Aug 2010
8 answers
513 views
I have a RadDatePicker control on a form.  If I input a date manually by typing it it and then immediately click on the form's submit button (so the date picker doesn't lose focus until I click on the button), the date picker on the server side doesn't see the newly inputed value. The IsEmpty is set to false and the SelectedDate is null.  However, the ValidationDate property is set to the correct date, but your documentation says not to use this member so I am not.  If I was to tab out of the date picker before clicking on the button, everything works the way it should. How can I validate and consume this control?

I searched through support for help, but didn't see anything.

Thanks,
Seth
Seth
Top achievements
Rank 1
 answered on 31 Aug 2010
3 answers
207 views
I am using Radcombobox version 2009.1.311.35.
In this i wanted to increase the dropdown width as some of the text were of larger length, so i set the DropDownWidth size to 240px and the width of my ComboBox is 150px (standard i am using in all my pages).
The question is this how can i make sure that the DropDownWidth will increase and decrease itself based on the size of the Items in the list. I found this http://www.telerik.com/help/winforms/combo_propertiessizing.html which looks pretty cool, where i can set the maximum and minimum DroDownSIze for the ComboBox, but this is for winforms.
Can you tell me how i can achieve the same for ASP.NET AJAX ComboBox.
Senthil ramna
Top achievements
Rank 1
 answered on 31 Aug 2010
3 answers
110 views
Could you take a look at this image I've prepared: http://mwtech.com/downloads/public/RadSlidingPaneExample.jpg

With the RadSlidingPane is there a way to have different text on the side than on the top?

Robert
Robert
Top achievements
Rank 1
 answered on 31 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?