Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
1.0K+ views
I am trying to create a web service using the demo "Boosting Performance with WebServices". When I try to implement the web service, I keep getting this error.

The type Telerik.Web.UI.RadComboBoxContext is not supported because it implements IDictionary.

Does anyone know how I can get around this or what I am doing wrong from the demo?

Thanks.

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.Services;  
using Telerik.Web.UI;  
using System.Collections;  
using System.Runtime.Serialization;  
using System.Runtime.Serialization.Formatters.Soap;  
 
 
namespace testCombo  
{  
    /// <summary>  
    /// Summary description for TestWebService  
    /// </summary>  
    [WebService(Namespace = "http://tempuri.org/")]  
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]  
    [System.ComponentModel.ToolboxItem(false)]  
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.   
    //[System.Web.Script.Services.ScriptService]  
    public class TestWebService : System.Web.Services.WebService  
    {  
          
        [WebMethod]  
        public IEnumerable GetItems(RadComboBoxContext context)  
        {  
            int numberOfItems = 1000;  
            List<ComboBoxItemData> items = new List<ComboBoxItemData>();  
            for (int i = 0; i < numberOfItems; i++)  
            {  
                ComboBoxItemData itemData = new ComboBoxItemData();  
                itemData.Text = "Item " + i;  
                items.Add(itemData);  
            }  
 
            return items;  
        }  
 
 
        class ComboBoxItemData  
        {  
            private string text;  
 
            public string Text  
            {  
                get { return text; }  
                set { text = value; }  
            }  
        }  
 
 
    }  


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="testCombo._Default" %> 
 
<%@ 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"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
        <telerik:RadComboBox ID="RadComboBox1" runat="server"   
         EnableLoadOnDemand="true">  
        <ExpandAnimation Type="none" /> 
                    <CollapseAnimation Type="none" /> 
                    <WebServiceSettings Path="TestWebService.asmx" Method="GetItems" /> 
        </telerik:RadComboBox> 
    </div> 
    </form> 
</body> 
</html> 
Rick
Top achievements
Rank 2
 answered on 11 Feb 2010
2 answers
198 views
I can format the items using the following code:
 protected void RadGrid1_ExcelExportCellFormatting(object source, ExcelExportCellFormattingEventArgs e)  
    {  
        GridDataItem item = e.Cell.Parent as GridDataItem;  
 
        item.Style["background-color"] = "#ffffff";  
        item.Style["font-size"] = "11px";  
        item.Style["font-family"] = "Verdana";  

How do I format the footer and my grouped headers?
Mike
Top achievements
Rank 1
 answered on 11 Feb 2010
1 answer
93 views
Hello
I have a problem with the grid.
I want to give the user can decide how the results have on the page.
I want always the height of the grid will be fixed, and will change following the results page.
If the user chooses, for example 50 per page. Added scroll record.

How do you do? Please!
Dimo
Telerik team
 answered on 11 Feb 2010
3 answers
112 views
Howdy,

I am trying to create my TreeView's context menu after the TreeView has been bound and do so on the server.  I am running into an issue however.  The code below results in an empty Items collection on the contextMenu object.  If I break in the code, after the DataBind(), I can see that the DataSource on the contextMenu has a collection of objects, but nothing is in the Items collection.  Therefor, there is no context menu once the page renders.

    protected void tabTreeView_OnDataBound(object sender, EventArgs e) 
    { 
        RadTreeViewContextMenu contextMenu = new RadTreeViewContextMenu(); 
 
        contextMenu.DataFieldID = "MenuItemId"
        contextMenu.DataFieldParentID = "ParentId"
        contextMenu.DataTextField = "DisplayText"
        contextMenu.DataValueField = "DisplayText"
        contextMenu.DataSource = this.GetUnusedMenuItems(); 
        contextMenu.DataBind(); 
 
        tabTreeView.ContextMenus.Add(contextMenu); 
    } 

Why is the Items collection not being populated when I call DataBind?  I can load the items in manually with a foreach loop (tested it and it works fine), but I didn't want to have to figure out the underlying hierarchy (the menu items I am using can be nested).

Thanks for any help,
Seth
Veselin Vasilev
Telerik team
 answered on 11 Feb 2010
1 answer
191 views
Hi

When using the JAWS screen reading software drop down menus are not read. Is there any way to make JAWS read each menu item when the drop down button is pressed? I know that javascript is used to display the div that contains the menu items, I have a feeling this is the problem.

Thanks

Antony
T. Tsonev
Telerik team
 answered on 11 Feb 2010
1 answer
109 views
Hello, I have a custom dropdown column editor that implements the GridDropDownColumnEditor using a RadComboBox.  Also, I am using an autogenerated popup edit form where that custom editor is working perfectly.  However the OnComboBind and DataBind subs of my custom dropdown editor are empty but, nevertheless, as I said, the dropdown is working perfectly... How come?? Where does the RadGrid binds it?? Is there any special setting I have missed that does this without the need of defining the OnComboBind and DataBind subs?? For what is the OnComboBind() for?? I have done a lot of research trying to find what does this procedure do but haven't found anything about it yet.

Thank you for your help.
Manuel
Radoslav
Telerik team
 answered on 11 Feb 2010
1 answer
503 views
Is there a way to only allow one row to be expanded in a hierachical RadGrid. if one row is expanded and then you expand another it collapses the former and expands the later.
Daniel
Telerik team
 answered on 11 Feb 2010
1 answer
99 views
Hi,

It's possible to use one dataset or table as source client side and how to. I searching one solution to use one dataset loaded from session as source for my grid. It's possible to use one dataset and update values client side and save client side. Other solution using webservices are tested and not working in my cms generating error 500 and server side generating many postback.

Thanks for u help. Romi
Tsvetoslav
Telerik team
 answered on 11 Feb 2010
2 answers
72 views

When opening a RadWindow for the second time, it throws an Unspecified Error.

 

function

 

OpenNewLocationWindow(Location, StopOffNum, url, offsetElementID) {

 

 

if (StopOffNum == null)

 

StopOffNum = 0;

StopValue = StopOffNum;

 

if (url == null)

 

    url =

"../../CustomerWebUI/NewLocations/CreateNewIntransShipperLocation.aspx";

 

 

    var oWnd = radopen(url + "?Location=" + Location + "&SeqNum=" + StopOffNum, "RadWindow1");

 

 

if (offsetElementID != null) {

 

    oWnd.set_offsetElementID(offsetElementID);

}

}
If the offsetElementID exists, the error is thrown.  If the offsetElementID does not exist, the program functions properly however the placement of the window is at the bottom of the page and the user must scroll down to find the window.

Clem
Top achievements
Rank 1
 answered on 11 Feb 2010
2 answers
134 views
I have a RadAjaxManager and an event handler for the OnResponseEnd event. In this event I am trying to use the $find() method to get the RadGrid object. I also must state that it is being used in a SharePoint environment. The problem is that when the page is being loaded it can find the RadGrid successfully, but in the OnResponseEnd event it returns a null. I have tried placing the function in a RadScriptBlock, as well as a RadCodeBlock. I have tried placing the scripts inside and outside the panel that the grid is in, which is updating when the grids selectedindexchanged event is fired. The code seems to work perfectly in a web-app, but when placed in the SharePoint environment it breaks. I have seen some blogs and posts where the client id is the problem, but in this situation the id is correct. As stated before, the find method does return the object on initial page load. But when an ajax update occurs, it's like the grid is not initialized until after the ResponseEnd event fires. 

Please help, the deadline is fast approaching in a few hours. I will greatly appreciate any advice. Thanks.


    <rad:RadAjaxManager ID="AjaxManager1" runat="server"
        <AjaxSettings> 
            <rad:AjaxSetting AjaxControlID="grdCustomerAssignments"
                <UpdatedControls> 
                    <rad:AjaxUpdatedControl ControlID="pnlCustomerAssignments"/> 
                </UpdatedControls> 
            </rad:AjaxSetting> 
            <rad:AjaxSetting AjaxControlID="grdCustomerAssignments"
                <UpdatedControls> 
                    <rad:AjaxUpdatedControl ControlID="pnlDetails"  /> 
                </UpdatedControls> 
            </rad:AjaxSetting> 
        </AjaxSettings> 
        <ClientEvents OnResponseEnd="ResponseEnd" OnRequestStart="RequestStart" /> 
 
<asp:Panel ID="pnlCustomerAssignments" runat="server" > 
        <rad:RadGrid ID="grdCustomerAssignments" runat="server" Skin="WebBlue" AutoGenerateColumns="false" AllowMultiRowSelection="false" 
            OnNeedDataSource="grdCustomerAssignments_NeedDataSource" 
            OnSelectedIndexChanged="grdCustomerAssignments_SelectedIndexChanged"
         
            <ClientSettings EnablePostBackOnRowClick="true" > 
                    <ClientEvents OnRowSelected="RowSelected"/> 
                    <Scrolling AllowScroll="true" ScrollHeight="350" UseStaticHeaders="true" SaveScrollPosition="true" /> 
                    <Selecting AllowRowSelect="true" /> 
                    <Resizing AllowColumnResize="true" /> 
            </ClientSettings> 
                 
            <MasterTableView DataKeyNames="ID" > 
 
                <HeaderStyle Wrap="false" HorizontalAlign="Center" VerticalAlign="Middle" Font-Bold="true" /> 
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" /> 
                <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" /> 
                 
                <NoRecordsTemplate> 
                    <div style="font-size:80%; color:Maroon;">No Items Were Found</div> 
                </NoRecordsTemplate> 
 
            </MasterTableView> 
                     
        </rad:RadGrid> 
         
 
    </asp:Panel> 
 
 
 

        <rad:RadCodeBlock ID="RadCodeBlock1" runat="server"
        <script type="text/javascript"
            var grid1; 
            Sys.Application.add_load(function() { 
                grid1 = $find('<%= grdCustomerAssignments.ClientID %>'); 
                var tmp = "asdf"
            }); 
            var SelectedItemIsReseting = false
            var SelectedIndexes = new Object(); 
 
            function RowSelected(sender, eventArgs) { 
                if (!SelectedItemIsReseting) { 
                    SelectedIndexes = eventArgs.get_itemIndexHierarchical(); 
                } 
            } 
 
            function RequestStart(sender, eventArgs) { 
                if (SelectedItemIsReseting) { 
                    eventArgs.set_cancel(true); 
                } 
            } 
 
             
 
        </script>     
    </rad:RadCodeBlock> 
     
            <rad:RadScriptBlock ID="RadScriptBlock1" runat="server"
            <script type="text/javascript"
 
                 
                function ResponseEnd(sender, eventArgs) { 
                    SelectedItemIsReseting = true
                    var gridID = eventArgs.get_eventTargetElement().id; 
                    var grid = $find(gridID); 
                        if (!grid) alert("No Grid"); 
                        var MasterTableView = grid.get_masterTableView(); 
                        if (!MasterTableView) alert("No Table"); 
                        MasterTableView.selectItem(MasterTableView.get_dataItems()[SelectedIndexes].get_element()); 
                        SelectedItemIsReseting = false
                        clearTimeout(t); 
                     
                } 
            </script> 
        </rad:RadScriptBlock> 

Yavor
Telerik team
 answered on 11 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?