Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
154 views
Hello Telerik support team,

I have a RadHTMLChart that will eventually need to perform a drill-down. Following the documentation examples I created a sample application to try and sent a request to the server for the next set of line series to be drawn on the chart.

The server receives the request and goes through all the appropriate code-behind without errors, however the browser closes the connection between it and the server before it receives the response from the server. The result from the user's perspective is that the graph does not change.

This was tested on the latest versions of FF, IE, GC
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SeriesClickedIndependant.aspx.cs"
    Inherits="SeriesClicked.SeriesClickedIndependant" %>
 
<%@ 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">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadHtmlChart ID="RadHtmlChart1" OnClientSeriesClicked="OnClientSeriesClicked" runat="server">
        </telerik:RadHtmlChart>
        <script type="text/javascript">
            function OnClientSeriesClicked(sender, eventArgs) {
                //alert("You clicked on a series item with value '" + eventArgs.get_value() + "' from category '" + eventArgs.get_category() + " and Series:" + eventArgs.get_seriesName() + '.');
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(eventArgs.get_seriesName());
 
            }
        </script>
    </div>
    </form>
</body>
</html>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Reports.ReportPresenter;
using Telerik.Web.UI;
 
namespace SeriesClicked
{
    public partial class SeriesClickedIndependant : System.Web.UI.Page
    {
        private ReportsDataSource _radDataSource;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PreFetch();
                FetchData(ReportsStoredProcedures.StoredProcedures.Company, new ReportsParameters(1356, "01/01/2011", "05/30/2011"));
                PostFetch();
            }
        }
 
        public void FetchData(ReportsStoredProcedures.StoredProcedures storedProcedure, ReportsParameters parameters)
        {
            //Populates the DataSource that will be used by the RADHTMLChart
            _radDataSource = new ReportsPresenter().GetReportsDataSource(storedProcedure, parameters);
        }
 
        public void PostFetch()
        {
            foreach (LineSeries lS in _radDataSource.ReportsRadHtmlSource.SeriesCollection)
            {
                RadHtmlChart1.PlotArea.Series.Add(lS);
            }
 
            foreach (string s in _radDataSource.ReportsRadHtmlSource.LabelsArray)
            {
                RadHtmlChart1.PlotArea.XAxis.Items.Add(s);
            }
        }
 
        public void PreFetch()
        {
            RadHtmlChart1.PlotArea.Series.Clear();
        }
 
 
 
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            PreFetch();
            FetchData(ReportsStoredProcedures.StoredProcedures.Region, new ReportsParameters(1356, 1356, 0, Reports.DataAccess.Facility.FacilityType.Regional, "01/01/2011", "05/30/2011"));
            PostFetch();
        }
 
 
        public void FetchData()
        {
        }
    }
}
Michael
Top achievements
Rank 1
 answered on 16 Aug 2013
1 answer
575 views
Hi,

I am using a radcombobox and populating it using webservice. However the combobox is not loaded when the page loads the first time. when i start typing the combobox gets loaded fine with the values. i want the combobox to contain top 100 rows when the page loads so that by just clicking on the dropdown arrow it can see the option with out typing anything in the box.
Please find my code below:-

<telerik:RadComboBox runat="server" ID="RadComboBox1" Width="300px" Height="550px" AllowCustomText="true" OnClientItemsRequesting="OnClientItemsRequesting"
                EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" MarkFirstMatch="true" ItemsPerRequest="100"
                EnableAutomaticLoadOnDemand="true" AutoPostBack="true">
                <WebServiceSettings Path="~/Controls/ManagerListService.asmx" Method="GetManagerNames" />
            </telerik:RadComboBox>

javascript
function OnClientItemsRequesting(sender, eventArgs) {
        var context = eventArgs.get_context();
    }

web srevice code

 <WebMethod()>
    Public Function GetManagerNames(context As RadComboBoxContext) As RadComboBoxData
        Dim data As DataTable = Employee.LineManagersForUser(context.Text)

        Dim result As New List(Of RadComboBoxItemData)()
        Dim dropDownData As New RadComboBoxData()
        Dim itemOffset As Integer = context.NumberOfItems
        Dim endOffset As Integer = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count)
        dropDownData.EndOfItems = endOffset = data.Rows.Count

        result = New List(Of RadComboBoxItemData)(endOffset - itemOffset)

        For i As Integer = itemOffset To endOffset - 1
            Dim itemData As New RadComboBoxItemData()
            itemData.Text = data.Rows(i)("Name").ToString()
            itemData.Value = data.Rows(i)("EmplID").ToString()

            result.Add(itemData)
        Next

        dropDownData.Items = result.ToArray()
        Return dropDownData
    End Function


Thanks,
Vineet
Plamen
Telerik team
 answered on 16 Aug 2013
1 answer
245 views
Hi
I have already add a toggle button in grid's each row to expand or collapse the grid hierarcy, I also want to add a toggle button on the grid header that control expand or collapse all grid rows. How to implement this.In attachment is my grid screen-shot. Below is some of my source code:
    <telerik:RadGrid ID="gridActions" runat="server" AutoGenerateColumns="false" GridLines="Both"
                                                            AllowPaging="True" AllowSorting="true" AllowFilteringByColumn="false" Width="100%"
                                                            Skin="SL" OnPageIndexChanged="GridPageChangedEventArgs"                                                                                                                   OnSortCommand="GridPageSorting"
                                                            EnableEmbeddedSkins="False">
                                                            <PagerStyle Mode="NextPrevAndNumeric" />
                                                            <GroupingSettings CaseSensitive="false" />
                                                            <HeaderContextMenu EnableEmbeddedSkins="False">
                                                            </HeaderContextMenu>
                                                            <HeaderStyle Height="20px" Font-Size="XX-Small" />
                                                            <%--<SortingSettings EnableSkinSortStyles="false" />--%>
                                                            <ExportSettings Excel-FileExtension="xls" Excel-Format="Html" ExportOnlyData="true"
                                                                FileName="FCPASearchResult" HideStructureColumns="true" IgnorePaging="true"   OpenInNewWindow="true">
                                                            </ExportSettings>
                                                            <MasterTableView TableLayout="Fixed"  DataKeyNames="ActionID" AutoGenerateColumns="false"
                                                                CommandItemDisplay="None" NoMasterRecordsText='<%#NoRecordsToDisplayText%>' ItemStyle-HorizontalAlign="Left"
                                                                HeaderStyle-HorizontalAlign="Center" ExpandCollapseColumn-ButtonType="ImageButton"
                                                                ExpandCollapseColumn-CollapseImageUrl="../../MasterPages/images/collapser.gif"
                                                                ExpandCollapseColumn-ExpandImageUrl="../../MasterPages/images/expander.gif"
                                                                HeaderStyle-Font-Bold="true"
                                                                CellPadding="0" CellSpacing="0" HierarchyLoadMode="Client">
Princy
Top achievements
Rank 2
 answered on 16 Aug 2013
4 answers
294 views
This is how I load rad window

<script type="text/javascript">
        function openRadWin(code, bookingdate, category) {
            radopen("MyPage.aspx", "RadWindow1");
        }
</script>
 
 <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
        VisibleStatusbar="false">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Width="400px"
                Height="400px" Title="Telerik RadWindow" Behaviors="Default" >
            </telerik:RadWindow>
        </Windows>
</telerik:RadWindowManager>

The rad window pop-up and it show "MyPage.aspx" correctly . But , In "MyPage.aspx" , I have a RadGrid with "AllowFilteringByColumn="true" " . When I filter RadGrid , it shows me the error

Server Error in '/' Application.
Failed to load viewstate.  The control tree into which viewstate
is being loaded must match the control tree that was used to save
viewstate during the previous request.  For example, when adding
controls dynamically, the controls added during a post-back must
match the type and position of the controls added during the initial request.

How can I fix it ?
Marin Bratanov
Telerik team
 answered on 16 Aug 2013
3 answers
220 views
Has anyone had any success with displaying a RadToolTip on the ModalPopupExtender of the AjaxControlToolkit?

In IE, it works as expected, but in Firefox the RadToolTip consistently displays undernead the modal popup.

I have tried to set the z-index on the RadToolTip explicitly to be higher than the modalpopup's script, but this doesn't do the job.
Marin Bratanov
Telerik team
 answered on 16 Aug 2013
3 answers
478 views
I have a page that runs in a RadWindow.  There is a RadButton on this page, that has both an OnClientClicking event (which sets a Tab control index) and an OnClick event which fires logic on the server through the RadAjaxManager.

In Chrome and IE, the OnClientClicking fires, then the OnClick makes the postback.

On Firefox however, the OnClientClicking is the end of the line.  OnClick does not get fired.

If I run this same page directly, instead of from the RadWindow - it works as expected in FireFox...

This is my OnClientClicking routine - pretty simple - I can't see why Firefox would stop.  I get no errors in the Console, etc...

function setResultsTab(sender, args)
{
    var tabStrip = $find('<%=tabCriteria.ClientID%>');
    var tab = tabStrip.findTabByValue('1');
    tab.select();
}
<telerik:RadButton ID="bAdvancedSearch" runat="server" Text="Search" SkinID="defaultButtonLargeSearch"
    OnClick="click_AdvancedSearch" meta:resourcekey="bAdvancedSearchResource2" OnClientClicking="setResultsTab"/>
Danail Vasilev
Telerik team
 answered on 16 Aug 2013
3 answers
140 views
Hey, I know this should have been solved already, just want some quick tips to figure out what is wrong in my settings of the telerik Radgrid control.

the page using a master page, and inside one telerik ajaxpanel. here is the aspx code. and the issue is the top on the scroll bar missing a inline style for margin-right: 17px, but without any clue why it is missing. the screenshots are attached as well.

<%@ Page Language="C#" MasterPageFile="~/MasterPages/LOLA.Master" AutoEventWireup="true" CodeBehind="ReportCellTypePropertyManagement.aspx.cs" Inherits="TSi.LOLA.ReportCellTypePropertyManagement" Culture="auto" meta:resourcekey="Page" UICulture="auto" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <%--<link href="Styles\LabelManagement.css" type="text/css" rel="stylesheet" id="CSSFileCT" />--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="Wrapper" style="margin-left:10px;margin-right:10px;">
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            <div style="float: left; width: 100%">
                <tsi:TSiDropDownList runat="server" ID="DropDown_CellTypes" Meta:resourceKey="DropDown_CellTypes" DropDown-CssClass="TSIDropDownListStyle"
                    DataTextField="Name" DataValueField="ID" AutoPostBack="false"  DropDownHeight="180" Skin="Sunset" />
                <tsi:TSiButton runat="server" ID="btnGetMapForCellType" meta:resourcekey="Button_GetMapForCellType"
                    RadButton-Width="9%" OnClick="GetMapForCellType_Click" ButtonType="SkinnedButton" Skin="Sunset" />
            </div>
            <div style="float: left; width: 100%">
                <tsi:TSiDropDownList runat="server" ID="DropDown_CellProperties" DefaultMessage="<%$ Resources:DropDown_CellProperties.DefaultMessage %>" DropDown-CssClass="TSIDropDownListStyle"
                    DataTextField="Name" DataValueField="ID" AutoPostBack="false" DropDownHeight="180" Skin="Sunset" />
                <tsi:TSiButton runat="server" ID="btnGetMapForProperty" meta:resourcekey="Button_GetMapForProperty"
                    RadButton-Width="9%" OnClick="GetMapForProperty_Click" ButtonType="SkinnedButton" Skin="Sunset" />
            </div>
            <br />
            <br />
            <br />
            <div class="SearchResults">
                <%--<tsi:TSIGrid runat="server" />--%>
                <telerik:RadGrid runat="server" ID="Grid_CellTypePropertyMap" ClientIDMode="Static"
                    AutoGenerateColumns="false" OnItemDataBound="GridCellTypePropertyMap_ItemDataBound" Skin="Sunset" >
                    <ClientSettings>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
 
                    <MasterTableView DataKeyNames="ID" ClientDataKeyNames="ID" TableLayout="Fixed">
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="<%$ Resources:ColumnAttached.HeaderText %>" UniqueName="AttachedCol" >
                                <ItemTemplate>
                                    <asp:CheckBox ID="chbAttached" runat="server" ClientIDMode="AutoID" ></asp:CheckBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="CellTypeName" HeaderText="<%$ Resources:ColumnCellTypeName.HeaderText %>" UniqueName="CellTypeNameCol" />
                            <telerik:GridBoundColumn DataField="CellTypeID" HeaderText="<%$ Resources:ColumnCellTypeID.HeaderText %>" UniqueName="CellTypeIDCol" />
                            <telerik:GridBoundColumn DataField="PropertyName" HeaderText="<%$ Resources:ColumnCellPropertyName.HeaderText %>" UniqueName="PropertyNameCol" />
                            <telerik:GridBoundColumn DataField="PropertyID" HeaderText="<%$ Resources:ColumnCellPropertyID.HeaderText %>" UniqueName="PropertyIDCol" />
                            <telerik:GridTemplateColumn HeaderText="<%$ Resources:ColumnDisplayOrder.HeaderText %>" UniqueName="DisplayOrderCol" >
                                <ItemTemplate>
                                    <asp:TextBox ID="txtDisplayOrder" runat="server" Width="26px" ></asp:TextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                <br />
                <br />
                <tsi:TSiButton runat="server" ID="Button_Save" Text="<%$ Resources:Button_Save.Text %>"
                    RadButton-Width="9%" OnClick="SaveCelltypePropertyMap_Click" Visible="false" />
            </div>
            <div>
                <br />
                <br />
                <asp:PlaceHolder runat="server" ID="CellTypePropertySaveDetailsTable" Visible="true">
                    <asp:Literal ID="LabelCellTypePropertyDetail" runat="server" />
                </asp:PlaceHolder>
            </div>
        </telerik:RadAjaxPanel>
        <script type="text/javascript">
        </script>
    </div>
 
</asp:Content>
Venelin
Telerik team
 answered on 16 Aug 2013
1 answer
366 views
Hi
I have an ASP.Net MasterPage, with a custom control ("uc1') that has a rad date picker in it ( "myCal')

I want to add a jquery change event on my aspx page but the below code wont work


$(document).ready(function(){

 $('#myCal').change(function(){
        alert('Found');
 });
 
});


Thanks for the help
Shinu
Top achievements
Rank 2
 answered on 16 Aug 2013
1 answer
284 views
Hi..i have a question about radmonthyearpicker control..if i set MinDate='2010-07-15' and MaxDate='2013-09-20'..it's ok..but all months are enabled always not the same than years..it's possible disable the other month by depending selected year?..for example if i click 2010 year only enabled valid months
Shinu
Top achievements
Rank 2
 answered on 16 Aug 2013
1 answer
284 views
Hi All,

I need to put a fdropdown filter in the radgrid. I tried to follow the radgrid demo. But in my case, i need to bind the filter dropdown only in codebehind.

The grid is bound in the needdatasource with an arraylist.

the aspx code is like below,

<telerik:GridTemplateColumn UniqueName="Column1" SortExpression="Column1" HeaderStyle-ForeColor="#245E9E"
HeaderText="Column 1" ItemStyle-Wrap="true" Resizable="true" AutoPostBackOnFilter="true"
CurrentFilterFunction="EqualTo" DataField="Column1">
<FilterTemplate>
<telerik:RadComboBox ID=
"RadComboBoxColumn1" DataTextField="Column1" DataValueField="Column1"
Height="200px" AppendDataBoundItems="true" 
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Column1").CurrentFilterValue %>' 
runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
<Items>
<telerik:RadComboBoxItem Text=
"All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID=
"RadScriptBlock1" runat="server">
<script type=
"text/javascript">
function TitleIndexChanged(sender, args)
{
var tableView = $find(
"<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter(
"Column1", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
<ItemTemplate>
<asp:Label ID=
"LblColumn1" Text='<%#Eval("Column1")%>' runat="server">
</asp:Label>
<asp:Label ID=
"LblDataSourceType" Text='<%#Eval("DataSourceType")%>' runat="server" Visible="false">
</asp:Label>
</ItemTemplate>
<HeaderStyle Width=
"280px" />
<ItemStyle Font-Names=
"Arial" Font-Size="11px" Wrap="true" />
</telerik:GridTemplateColumn>


Can anybody please help on this an explain me how can i bind the filter dropdown from codebehind?

Thanks in advance

Thanks,
Mahesh O A


Eyup
Telerik team
 answered on 16 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?