Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
110 views

I have used a RadTreeView control in an aspx page, where the Root element has been associated an "Add " context menu.

While the ContextMenuItemClick event is fired on the server side when viewed from Opera 11, Firefox 11, Chrome 17, Internet Explorer 8, it does not fire when viewed from Internet Explorer 9 - it only adds a # tag at the end of the URL and no PostBack is executed.

I have tried to set the PostBack property of the Context menu item to true, to false - to no avail.

Please let me know if there is something that I am missing.

Thank you.
Zoltan

PS. Below is the mark-up used in my page:

<telerik:RadTreeView ID="CollectiveNameTree" runat="server"
    EnableDragAndDrop="true"
    EnableDragAndDropBetweenNodes="true"
    MultipleSelect="false"
    EnableViewState="true"
    OnNodeEdit="CollectiveNameTree_NodeEdit"
    OnClientNodeEditing="onClientNodeEditing"
    OnNodeDrop="CollectiveNameTree_HandleDrop"
    OnClientContextMenuItemClicking="onClientContextMenuItemClicking"
    OnClientContextMenuShowing="onClientContextMenuShowing"
    OnClientDoubleClick="onClientNodeDoubleClicking"
    OnClientNodeDragStart="onClientNodeDragStart"
    OnClientNodeDropping="onClientNodeDropping"
    OnClientNodeDragging="onClientNodeDragging"
    >
    <WebServiceSettings Path="~/WebServices/Substances.asmx" Method="GetTreeViewCategories" />
    <Nodes>
        <telerik:RadTreeNode Text="<%$ Resources:Buttons,ClassificationsRootNodeTitle %>" PostBack="true"
            Expanded="false" ExpandMode="WebService" Value="1" ContextMenuID="RootContextMenu" />
    </Nodes>
    <ContextMenus>
        <telerik:RadTreeViewContextMenu ID="RootContextMenu" runat="server">
            <Items>
                <telerik:RadMenuItem Value="AddClassification"
                    Text="<%$ Resources:Buttons,AddClassification %>" />
            </Items>
        </telerik:RadTreeViewContextMenu>
    </ContextMenus>
</telerik:RadTreeView>

 

Zoltan
Top achievements
Rank 1
 answered on 15 May 2012
10 answers
367 views
I am trying to dynamically resize the grid to fill an area on the screen when the user resizes the browser.
In order to determine the 'GridData' area, I need to know the height of the static header row ('GridHeader').
When I create the control, the height is always 20.
Once I resize the browser, the header height is 33. 
Why the difference and how can I get the 33 when the control is created?

Thanks,
Eric
wnl
Top achievements
Rank 1
 answered on 15 May 2012
3 answers
58 views
After upgrading to the recent build we have noticed a problem with spaces being stripped on paste (somewhat randomly)

We are able to duplicate the problem in our system AND on your demo.

Browser: Chrome 18.0.1025.168 m
Build: Telerik.Web.UI_2012_1_411_Dev_hotfix

If you paste the following content directly from a word doc (or Outlook email)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec elementum vehicula condimentum. Vivamus sed neque arcu. Proin mattis tristique ante, ac tincidunt sem vulputate sed. Vestibulum et elit ac lorem sagittis blandit a vitae dui. Sed aliquet fermentum pulvinar. Nunc erat ante, euismod sit amet blandit pulvinar, semper sed orci. Pellentesque egestas tempus magna, vitae interdum dui feugiat a. Duis a vestibulum arcu. Nam arcu turpis, fringilla in consectetur pulvinar, hendrerit sed sem. Phasellus id sem odio. Nam quis ante lectus. In non sapien vitae turpis pulvinar congue. Ut porta auctor nisl non hendrerit. Proin eget odio at nibh faucibus laoreet.


Some words lose the spaces between them.  For example "Donec elementum vehicula" goes to "Donec elementumvehicula"

Pasting into THIS editor (the forum) works fine.  Pasting into the demo (http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx) the problem exists.

The editor on the demo alerts me if I'd like to strip formatting. If I say yes, the problem exists.  If I say cancel, it pastes ok.

Reverting to the previous build in our app resolved the problem.  I notice it doesn't always occur depending on where I paste from.  But it can be duplicated every time by pasting from word. Its just pasting directly from Word into the demo editor.

Thanks for any input you can provide.
Rumen
Telerik team
 answered on 15 May 2012
1 answer
208 views
Hi , I'm trying to use RadScriptManager
on my project
I know that I'm using the framework 4.5 but I would like to know if this is an error of my installation or 
is something will be fix in the future

When I use the radScriptmanager set as below 
I get error 404 on fiddler 
for these two files

http://ajax.aspnetcdn.com/ajax/4.5/3/MicrosoftAjax.debug.it.js

http://ajax.aspnetcdn.com/ajax/4.5/3/MicrosoftAjaxWebForms.debug.it.js 

---
Thanks
Giovanni

 <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableCdn="true">
         <Groups>
        <telerik:ScriptReferenceGroup>
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"   />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryPlugins.js" />
            </Scripts>
        </telerik:ScriptReferenceGroup>
    </Groups>
    </telerik:RadScriptManager>



Genady Sergeev
Telerik team
 answered on 15 May 2012
2 answers
104 views
Hi

I use detailedtable in radgrid. Everything goes well as screenshot shows. However, when I try to set dataformat of column in Grid, the detailedtable does not show anymore. It seems expand icon does trigger event DetailTableDataBind and detailedtable.datasource does has data. It confuses me that why the detailedtable disappears.

Can anyone help me? Thank you in advance.

here is my code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Control.UserRequest;
using Control.Global;
using Control.Position_C;
using Control.Salesman_C;
using Control.Depart_C;
using Model;
using Telerik.Web.UI;
using Control.Bill_C;
 
namespace ERP.SalesAnalysis
{
    public partial class BillByCustMonth : Is_Login
    {
        private UserRequestController urc = null;
        IList<Cust> custList = null;
        IList<Dept> departList = null;
        IList<Salesman> salesList = null;
        static string digit = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                urc = GlobalUserController.get_login_user_request_controller(Session["userID"].ToString());
                string permitString = urc.getBillByCustMonthPermit();
 
                LoadPosition();
                LoadCustomerComboBox(urc);
                LoadDepartment();
                LoadSalesman();
                setPermit(permitString, urc);
                YearComboBox.SelectedValue = DateTime.Now.Year.ToString();
                decimal p = SystemParamController.param.amt_point;
                //decimal p = 2; for test
                digit = "";
                for (decimal i = 0; i < p; i++)
                {
                    digit += "0";
                }
                if (digit != "")
                {
                    digit = "{0:#,#." + digit + "}";
                }
                else
                {
                    digit = "{0:#,#}";
                }
            }
        }
 
        
 
        private void LoadSalesman()
        {
 
            salesList = SalesmanController.getAllSalesmanList();
            if (salesList.Count != 0)
                for (int i = 0; i < salesList.Count; i++)
                {
                    SalesmanComboBox1.Items.Add(new RadComboBoxItem(salesList[i].salesmanId.deptcode + "\t" + salesList[i].salesmanId.name, salesList[i].salesmanId.name));
                    SalesmanComboBox2.Items.Add(new RadComboBoxItem(salesList[i].salesmanId.deptcode + "\t" + salesList[i].salesmanId.name, salesList[i].salesmanId.name));
                }
 
            SalesmanComboBox1.ClearSelection();
            SalesmanComboBox2.ClearSelection();
              
        }
 
        private void LoadDepartment()
        {
            departList = DepartController.getDepartList();
            DepartComboBox1.DataSource = departList;
            DepartComboBox1.DataTextField = "deptcode";
            DepartComboBox1.DataValueField = "deptcode";
            DepartComboBox1.DataBind();
 
            DepartComboBox2.DataSource = departList;
            DepartComboBox2.DataTextField = "deptcode";
            DepartComboBox2.DataValueField = "deptcode";
            DepartComboBox2.DataBind();
 
        }
 
        private void setPermit(string permitString, UserRequestController urc)
        {
             
        }
 
        protected void LoadPosition()
        {
            PositionComboBox.DataSource = PositionController.getPositionList();
            PositionComboBox.DataTextField = "p_code";
            PositionComboBox.DataValueField = "p_code";
            PositionComboBox.DataBind();
 
        }
 
        protected void LoadCustomerComboBox(UserRequestController urc)
        {
 
            custList = urc.getCustomerListByUser();
            CustomerComboBox1.HighlightTemplatedItems = true;
            CustomerComboBox1.DataSource = custList;
            CustomerComboBox1.DataTextField = "c_code";
            CustomerComboBox1.DataValueField = "c_code";
            CustomerComboBox1.DataBind();
 
            CustomerComboBox2.HighlightTemplatedItems = true;
            CustomerComboBox2.DataSource = custList;
            CustomerComboBox2.DataTextField = "c_code";
            CustomerComboBox2.DataValueField = "c_code";
            CustomerComboBox2.DataBind();
 
        }
        protected void BillGrid_PreRender(object sender, System.EventArgs e)
        {
            setFormat();
        }
 
        protected void setFormat()
        {
            string format = digit;
            if (!StandardCurrency.Checked)
            {
                format = "{0:#,#.00}";
            }
            foreach (GridColumn column in BillGrid.Columns)
            {
                if (column.UniqueName == "Sales1" || column.UniqueName == "Sales2" || column.UniqueName == "Sales3" ||
                    column.UniqueName == "Sales4" || column.UniqueName == "Sales5" || column.UniqueName == "Sales6" ||
                    column.UniqueName == "Sales7" || column.UniqueName == "Sales8" || column.UniqueName == "Sales9" ||
                    column.UniqueName == "Sales10" || column.UniqueName == "Sales11" || column.UniqueName == "Sales12")
                {
 
                    (column as GridBoundColumn).DataFormatString = format;
                }
                else if (column.UniqueName == "Sum" || column.UniqueName == "Avg")
                {
 
                    (column as GridCalculatedColumn).DataFormatString = format;
                }
            }
            BillGrid.Rebind(); 
        }
        protected void BillGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            if (!e.IsFromDetailTable)
            {
                string year = YearComboBox.SelectedValue;
                string position = PositionComboBox.SelectedValue;
                string startDept = DepartComboBox1.SelectedValue;
                string endDept = DepartComboBox2.SelectedValue;
                string startSales = SalesmanComboBox1.SelectedValue;
                string endSales = SalesmanComboBox2.SelectedValue;
                string startCust = CustomerComboBox1.SelectedValue;
                string endCust = CustomerComboBox2.SelectedValue;
                bool standard = true;
                if (!StandardCurrency.Checked)
                {
                    standard = false;
                }
                BillGrid.DataSource = BillController.getBill(year, position, startDept, endDept, startSales, endSales, startCust, endCust, standard);
                 
            }
        }
 
        protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "BillDetails":
                    {
                        string year = YearComboBox.SelectedValue;
                        string position = PositionComboBox.SelectedValue;
                        string startCust = CustomerComboBox1.SelectedValue;
                        string endCust = CustomerComboBox2.SelectedValue;
                        bool standard = true;
                        if (!StandardCurrency.Checked)
                        {
                            standard = false;
                        }
                        string salesman = dataItem.GetDataKeyValue("Salesman").ToString();
                         
                        e.DetailTableView.DataSource = BillController.getBillBySaleman(year, position, salesman, startCust, endCust,standard);
                        //e.DetailTableView.Rebind();
 
                        break;
                    }
 
            }
        }
 
        protected void SearchButton_Click(object sender, EventArgs e)
        {
            string year = YearComboBox.SelectedValue;
            string position = PositionComboBox.SelectedValue;
            string startDept = DepartComboBox1.SelectedValue;
            string endDept = DepartComboBox2.SelectedValue;
            string startSales = SalesmanComboBox1.SelectedValue;
            string endSales = SalesmanComboBox2.SelectedValue;
            string startCust = CustomerComboBox1.SelectedValue;
            string endCust = CustomerComboBox2.SelectedValue;
            bool standard = true;
            if (!StandardCurrency.Checked) {
                standard = false;
            }
 
            BillGrid.DataSource = BillController.getBill(year, position, startDept, endDept, startSales, endSales, startCust, endCust, standard);
            BillGrid.Rebind();
            setFormat();
        }
 
    }
}


<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="BillByCustMonth.aspx.cs" Inherits="ERP.SalesAnalysis.BillByCustMonth" %>
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=6.0.12.302, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="SearchButton">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="BillGrid"  />
                    </UpdatedControls>
                </telerik:AjaxSetting>
     </AjaxSettings>
</telerik:RadAjaxManager>
<table width="100%">
<tr>
<td><asp:label id="PositionLabel" runat="server" Text="<%$ Resources:language,position%>"></asp:label></td>
<td>
 <telerik:RadComboBox ID="PositionComboBox" Runat="server"
        Width="150px" Height="150px">
        <headertemplate>
       <table style="width:100px;">
           <tr>
               <td style="width:40px;">编码</td>
               <td style="width:60px;">名称</td>
           </tr>
       </table>                               
    </headertemplate>
     <itemtemplate>
       <table style="width:100px;">
           <tr>
               <td style="width:40px;"><%# DataBinder.Eval(Container.DataItem, "p_code") %></td>
               <td style="width:60px;"><%# DataBinder.Eval(Container.DataItem, "p_name") %></td>
           </tr>
       </table>
    </itemtemplate>
    </telerik:RadComboBox>
</td>
<td><asp:label id="Label1" runat="server" Text="<%$ Resources:language,department%>"></asp:label></td>
<td><telerik:RadComboBox ID="DepartComboBox1" Runat="server" Width="150px" AllowCustomText="True"
        Height="150px"
       >
        <headertemplate>
       <table style="width:100px;">
           <tr>
               <td style="width:40px;">编码</td>
               <td style="width:60px;">名称</td>
           </tr>
       </table>                               
    </headertemplate>
     <itemtemplate>
       <table style="width:100px;">
           <tr>
               <td style="width:40px;"><%# DataBinder.Eval(Container.DataItem, "deptcode")%></td>
               <td style="width:60px;"><%# DataBinder.Eval(Container.DataItem, "deptname")%></td>
           </tr>
       </table>
    </itemtemplate>
    </telerik:RadComboBox>
</td>
<td><telerik:RadComboBox ID="DepartComboBox2" Runat="server" Width="150px" AllowCustomText="True"  Height="150px">
        <headertemplate>
       <table style="width:100px;">
           <tr>
               <td style="width:40px;">编码</td>
               <td style="width:60px;">名称</td>
           </tr>
       </table>                               
    </headertemplate>
     <itemtemplate>
       <table style="width:100px;">
           <tr>
               <td style="width:40px;"><%# DataBinder.Eval(Container.DataItem, "deptcode")%></td>
               <td style="width:60px;"><%# DataBinder.Eval(Container.DataItem, "deptname")%></td>
           </tr>
       </table>
    </itemtemplate>
    </telerik:RadComboBox>
</td>
<td><asp:label id="Label2" runat="server" Text="<%$ Resources:language,salesman%>"></asp:label></td>
<td><telerik:RadComboBox ID="SalesmanComboBox1" Runat="server" Height="150px" Width="100px" AllowCustomText="True" >
    </telerik:RadComboBox>
</td>
<td><telerik:RadComboBox ID="SalesmanComboBox2" Runat="server" Height="150px" Width="100px" AllowCustomText="True" >
    </telerik:RadComboBox>
</td>
</tr>
<tr>
<td><asp:label id="Label3" runat="server" Text="<%$ Resources:language,year%>"></asp:label></td>
<td>
<telerik:RadComboBox ID="YearComboBox" Runat="server"  Filter="StartsWith"
 Width="100px"  Height="150px"   DataTextField="Text" DataValueField="Value"
        DataSourceID="XmlDataSource1" >
</telerik:RadComboBox>
    <asp:XmlDataSource ID="XmlDataSource1" runat="server"
        DataFile="~/Common/year.xml"></asp:XmlDataSource>
</td>
<td><asp:label id="Label4" runat="server" Text="<%$ Resources:language,customerID%>"></asp:label></td>
<td><telerik:RadComboBox ID="CustomerComboBox1" Runat="server" AllowCustomText="True"
        Height="250px" >
     <headertemplate>
       <table style="width:160px">
           <tr>
               <td style="width:60px;">编码</td>
               <td style="width:100px;">名称</td>
           </tr>
       </table>                               
    </headertemplate>
     <itemtemplate>
       <table style="width:160px">
           <tr>
               <td style="width:60px;"><%# DataBinder.Eval(Container.DataItem, "c_code") %></td>
               <td style="width:100px;"><%# DataBinder.Eval(Container.DataItem, "c_abrname") %></td>
           </tr>
       </table>
    </itemtemplate>
    </telerik:RadComboBox></td>
    <td><telerik:RadComboBox ID="CustomerComboBox2" Runat="server"
        Height="250px"  AllowCustomText="True" >
     <headertemplate>
       <table style="width:160px">
           <tr>
               <td style="width:60px;">编码</td>
               <td style="width:100px;">名称</td>
           </tr>
       </table>                               
    </headertemplate>
     <itemtemplate>
       <table style="width:160px">
           <tr>
               <td style="width:60px;"><%# DataBinder.Eval(Container.DataItem, "c_code") %></td>
               <td style="width:100px;"><%# DataBinder.Eval(Container.DataItem, "c_abrname")%></td>
           </tr>
       </table>
    </itemtemplate>
    </telerik:RadComboBox></td>
<td><asp:label id="Label5" runat="server" Text="<%$ Resources:language,currency%>"></asp:label></td>
<td>
<asp:RadioButton ID="StandardCurrency" runat="server" Text="<%$ Resources:language,standardCurrency%>" Checked="true" GroupName="currency"></asp:RadioButton>
<asp:RadioButton ID="ForeCurrency" runat="server" Text="<%$ Resources:language,foreCurrency%>" GroupName="currency"></asp:RadioButton>
</td>
</tr>
<tr>
<td colspan="8" align="right">
<telerik:RadButton runat="server"  ID="SearchButton" Text="<%$ Resources:language,search%>"
        onclick="SearchButton_Click"></telerik:RadButton>
</td>
</tr>
</table>
  <telerik:RadGrid ID="BillGrid" Width="100%" runat="server" Height="375px" 
        AllowPaging="true" AutoGenerateColumns="False" PageSize="10" AllowSorting="True"
        OnNeedDataSource="BillGrid_NeedDataSource" OnPreRender="BillGrid_PreRender"
        OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
        Skin="Office2010Blue"  >
    <MasterTableView Width="100%" AllowMultiColumnSorting="false" GroupLoadMode="Server" DataKeyNames="Salesman"  ShowFooter="true"  CssClass="number">
    <DetailTables>
        <telerik:GridTableView DataKeyNames="Salesman" Name="BillDetails" Width="100%" ShowFooter="false" ShowHeader="false" CssClass="number" >
            <Columns>
                <telerik:GridBoundColumn HeaderStyle-Width="80px" DataField="Blanck"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderStyle-Width="80px" DataField="Blanck"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderStyle-Width="90px" DataField="Custcode"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderStyle-Width="90px" DataField="Custname"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales21" HeaderStyle-Width="80px" DataField="Sales1" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales22" HeaderStyle-Width="80px" DataField="Sales2" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales23" HeaderStyle-Width="80px" DataField="Sales3" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales24" HeaderStyle-Width="80px" DataField="Sales4" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales25" HeaderStyle-Width="80px" DataField="Sales5" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales26" HeaderStyle-Width="80px" DataField="Sales6" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales27" HeaderStyle-Width="80px" DataField="Sales7" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales28" HeaderStyle-Width="80px" DataField="Sales8" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales29" HeaderStyle-Width="80px" DataField="Sales9" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales210" HeaderStyle-Width="80px" DataField="Sales10" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn   UniqueName="Sales211" HeaderStyle-Width="80px" DataField="Sales11" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn  UniqueName="Sales212" HeaderStyle-Width="80px" DataField="Sales12" DataFormatString="{0:###,###.##}"></telerik:GridBoundColumn>
                <telerik:GridCalculatedColumn  UniqueName="Sum2" HeaderStyle-Width="80px" DataFields="Sales1,Sales2,Sales3,Sales4,Sales5,Sales6,Sales7,Sales8,Sales9,Sales10,Sales11,Sales12" Expression="{0}+{1}+{2}+{3}+{4}+{5}+{6}+{7}+{8}+{9}+{10}+{11}" DataFormatString="{0:###,###.##}"></telerik:GridCalculatedColumn>
                <telerik:GridCalculatedColumn   UniqueName="Avg2" HeaderStyle-Width="80px" DataFields="Sales1,Sales2,Sales3,Sales4,Sales5,Sales6,Sales7,Sales8,Sales9,Sales10,Sales11,Sales12" Expression="({0}+{1}+{2}+{3}+{4}+{5}+{6}+{7}+{8}+{9}+{10}+{11})/12" DataFormatString="{0:###,###.##}"></telerik:GridCalculatedColumn>
            </Columns>
        </telerik:GridTableView>
      </DetailTables>
 
        <Columns>
        <telerik:GridBoundColumn HeaderText="<%$ Resources:language,department%>" HeaderStyle-Width="80px" DataField="Depart"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="<%$ Resources:language,salesman%>" HeaderStyle-Width="80px"  DataField="Salesman"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="<%$ Resources:language,customerId%>" HeaderStyle-Width="90px"  DataField="Custcode"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="<%$ Resources:language,customerName%>" HeaderStyle-Width="90px"  DataField="Custname"></telerik:GridBoundColumn>
        <telerik:GridNumericColumn HeaderText="1月份" UniqueName="Sales1" HeaderStyle-Width="80px" DataField="Sales1" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="2月份" UniqueName="Sales2" HeaderStyle-Width="80px" DataField="Sales2" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="3月份" UniqueName="Sales3" HeaderStyle-Width="80px" DataField="Sales3" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="4月份" UniqueName="Sales4" HeaderStyle-Width="80px" DataField="Sales4" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="5月份" UniqueName="Sales5" HeaderStyle-Width="80px" DataField="Sales5" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="6月份" UniqueName="Sales6" HeaderStyle-Width="80px" DataField="Sales6" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="7月份" UniqueName="Sales7" HeaderStyle-Width="80px" DataField="Sales7" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="8月份" UniqueName="Sales8" HeaderStyle-Width="80px" DataField="Sales8" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="9月份" UniqueName="Sales9" HeaderStyle-Width="80px" DataField="Sales9"  Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="10月份" UniqueName="Sales10" HeaderStyle-Width="80px" DataField="Sales10" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="11月份" UniqueName="Sales11" HeaderStyle-Width="80px" DataField="Sales11" Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridNumericColumn HeaderText="12月份" UniqueName="Sales12" HeaderStyle-Width="80px" DataField="Sales12"  Aggregate="Sum"></telerik:GridNumericColumn>
        <telerik:GridCalculatedColumn HeaderText="总计" UniqueName="Sum" HeaderStyle-Width="80px"  DataFields="Sales1,Sales2,Sales3,Sales4,Sales5,Sales6,Sales7,Sales8,Sales9,Sales10,Sales11,Sales12" Expression="{0}+{1}+{2}+{3}+{4}+{5}+{6}+{7}+{8}+{9}+{10}+{11}" ></telerik:GridCalculatedColumn>
        <telerik:GridCalculatedColumn HeaderText="月平均" UniqueName="Avg" HeaderStyle-Width="80px"  DataFields="Sales1,Sales2,Sales3,Sales4,Sales5,Sales6,Sales7,Sales8,Sales9,Sales10,Sales11,Sales12" Expression="({0}+{1}+{2}+{3}+{4}+{5}+{6}+{7}+{8}+{9}+{10}+{11})/12"></telerik:GridCalculatedColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings>
           <Selecting AllowRowSelect="True"></Selecting>
           <Resizing AllowColumnResize="true" EnableRealTimeResize="True"/>
           <Scrolling UseStaticHeaders="true" AllowScroll="true" />
     </ClientSettings>
  </telerik:RadGrid>
</asp:Content>

Wenting
Top achievements
Rank 1
 answered on 15 May 2012
1 answer
376 views
            I need to hide the filter icon, enable the AutoPostBackOnFilter and set the default filter function value.
The default filter function may be different for each column depending on what the client wants.

I have a problem. 
When the application loads, the filters are exactly what I specified in the CurrentFilterFunction property.
When I filter the first column, the filters reset to something else.

<telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" DataSourceID="SqlDataSource1" AllowFilteringByColumn="True" PageSize="15" AllowPaging="True" runat="server" >           
    <MasterTableView >
       
<Columns>
           
<telerik:GridNumericColumn DataField="OrderID" HeaderText="OrderID" AutoPostBackOnFilter="true" CurrentFilterFunction="LessThanOrEqualTo" />
            <telerik:GridBoundColumn  DataField="ShipName" HeaderText="ShipName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" />
            <telerik:GridDateTimeColumn  DataField="OrderDate" HeaderText="OrderDate" AutoPostBackOnFilter="true" CurrentFilterFunction="LessThanOrEqualTo" />                   
        </Columns>                                             
   
</MasterTableView>           
</telerik:RadGrid>


<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Orders" runat="server">
</asp:SqlDataSource>


In this example, when I filter the shipName with the letter 'a', it is filtered correctly with the "Contains" filter expression.
Then I filter the OrderId with the value 10300. 
I expect the filter function to be "LessThanOrEqualTo" as I specified, but instead, it is set to "EqualTo". 
Is it a bug ?
Is there a workaround ?
Shinu
Top achievements
Rank 2
 answered on 15 May 2012
1 answer
179 views
when you bring up this page you'll see a read only radnumerictextbox that is right-aligned in read only mode - it lets you click in the number area with the mouse or tab over to it.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <style type="text/css">
            .RadNumericTextBoxRules
    {
        text-align: right;
    }
    
        .Local_RadNumericTextBox
    {
        width: 120px ;
    }
    </style>




    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" AsyncPostBackTimeout="300">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>




 Read Only
                    <telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox2"
                        CssClass="Local_RadNumericTextBox RadNumericTextBoxRules" DataType="System.Int32"
                        NumberFormat-DecimalDigits="0" Width="120px" ReadOnly="true" ReadOnlyStyle-BackColor="White" ReadOnlyStyle-BorderColor="White"
    ReadOnlyStyle-BorderStyle="None" ReadOnlyStyle-BorderWidth="0" ReadOnlyStyle-ForeColor="#53626F"
    Border-Color="White" BorderStyle="None" border-width="0" Value="123.23" >
                    </telerik:RadNumericTextBox>




    </div>
    </form>
</body>
</html>
Vasil
Telerik team
 answered on 15 May 2012
3 answers
200 views
In my radgrid I want to display filter,grouping,sorting options for columns. So I made EnableHeaderContextMenu="true".
<rad:RadGrid ID="myGrid" runat="server" 
                               AllowSorting="True"
                               AutoGenerateColumns="false"
                               AllowPaging="True" GridLines="Both" GroupingEnabled="true" AllowFilteringByColumn="true"
                               EnableAJAX="True" EnableHeaderContextMenu="true" ShowGroupPanel="false" ShowFooter="True"
                               PageSize="20" EnableHeaderContextFilterMenu="true"
                               AllowMultiRowEdit="true" AllowMultiRowSelection="true"
                               OnNeedDataSource="myGrid_NeedDataSource"
                               OnDetailTableDataBind="myGrid_DetailedTableDataBind" 
                               OnItemDataBound="myGrid_OnItemDataBound"
                               OnPreRender="myGrid_OnPreRender">
                              <ClientSettings EnableRowHoverStyle="true" Resizing-AllowColumnResize="True" AllowColumnsReorder="True"
                                   ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true">
                                   <Selecting AllowRowSelect="True" />
                                   <ClientEvents OnGridCreated="OnGridCreated" />
</ClientSettings>

The problem here is , it doesnt show checkboxed for displaying/hiding columns.
Where as other pages are working fine.

Appriciate your help.



Thanks
Tsvetina
Telerik team
 answered on 15 May 2012
7 answers
198 views
I have a radgrid populated by an entitydatasource using a where paramter to limit the return to a predetermined Identity Value. If a user wants to add a new record to this collection how can I keep that identity value? In this case, the value is a foreign key on a many-to-one relationship - in this case the site of a project - so I have projectId and want to use that projectId as the value in the new record that is created. A user shouldn't be able to select this value because they already did.

I've tried using defaultvalue and that works, but it displays in the insert form and I don't want that. If I use ReadOnly it doesn't get used and my insert fails because of foreign key constraints.

I don't want to handle it in code because I'm writing everything declaratively - is there a way to do this?
Antonio Stoilkov
Telerik team
 answered on 15 May 2012
1 answer
69 views
Is it possible to specify mapped words for autocorrect like in the office products. For example if I type something like IT to get replaced by Information Technology?
Rumen
Telerik team
 answered on 15 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?