Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
117 views
Hi there,

I've wired up my radgrid to run off a webservice in the code behind file.
But when I create a webservice and place it into a different location then my radgrid doesn't populate. I'm obviously not connecting it properly.

Here is my ASPX:
            <ClientSettings> 
                <DataBinding Location="Default.aspx" SelectCountMethod="GetProductCount" SelectMethod="GetProducts"
                </DataBinding> 
                <Selecting AllowRowSelect="True" /> 
            </ClientSettings> 

That works but if I change Location="Default.aspx" to Location="Products.asmx" then my grid doesn't populate.

Here is my Products.asmx:
[WebService(Namespace = "Products")] 
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
// 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 Products : System.Web.Services.WebService { 
 
    [WebMethod] 
    public static IEnumerable GetProducts(int startRowIndex, int maximumRows) 
    { 
        var northwind = new NorthwindDataContext(); 
        var products = from p in northwind.Products 
                       select new 
                       { 
                           ProductID = p.ProductID, 
                           Name = p.ProductName, 
                           CategoryName = p.Category.CategoryName, 
                           Price = p.UnitPrice, 
                           UnitsInStock = p.UnitsInStock 
                       }; 
 
        return products.Skip(startRowIndex).Take(maximumRows); 
    } 
 
    [WebMethod] 
    public static int GetProductCount() 
    { 
        var northwind = new NorthwindDataContext(); 
        var count = northwind.Products.Count(); 
        return count; 
    } 
     

Thanks in advance for taking the time to help me out.
D
Darren
Top achievements
Rank 2
 answered on 01 Jul 2009
1 answer
102 views
Hi telerik,

Hopefully this one is easy...

I have a rad grid with following columns: Supplier, ProductName, Product Description.  These columns constitute an entity called line item.
On edit/insert I am using inline mode. Now, when in edit/insert mode users are able to search for supplier by supplier name or for a product by product name (I have a search icon next to each entry fields in edit/insert mode which will open a pop-up).  Once, values are selected for these fields I also need to store IDs for them behind the scene (for Supplier and for Product),
so for example my OnInsertCommand would look like this:
 
   protected void RadGrid1_OnInsertCommand(object source, GridCommandEventArgs e)
    {
        GridEditableItem item = null;
        string supplierID = String.Empty;
        string productID = string.Empty;

        item = this.RadGrid1.MasterTableView.GetInsertItem();

       // Get supplier ID for and assign to supplierID variable
          .................
        // Get product ID and assign to productID variable
       
        //Create new LIne Item
        LineItem llineItem = new LineItem();
        llineItem.GenerateALineItem(supplierID, productID, this.CurrentOrder.OrderID);
        this.CurrentOrder.Order.LineItem.Add(llineItem.GetItem());
        RadGrid1.MasterTableView.Rebind();
    }

How and where can I store these supplierID, productID for edited/new records to retrieve them in these methods (OnInsertCommand
OnItemUpdated)
Sebastian
Telerik team
 answered on 01 Jul 2009
1 answer
143 views
Please help!

We have been using telerik for some times now, we've been making this site using telerik. The site was OK until an error showed up.

Line: 6
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'Telerik.Web.UI 2009.'.

We have been using telerik but this is the first time we encountered this error.

Can anybody teach us how to solve this error

Thank you
Princy
Top achievements
Rank 2
 answered on 01 Jul 2009
1 answer
127 views
On the client, I'm perfoming the following treenode attribute update:
function onNodeClicking(sender, args) { 
    var treeNode = args.get_node(); 
    var attribs = treeNode.get_attributes(); 
    attribs.setAttribute("test""54321"); 
 
    attribs2 = treeNode.get_attributes(); 
    alert(attribs2.getAttribute("test")); 

After the PostBack, the treenode's "test" attribute hasn't been updated and the original is rendered in the TextBox.
protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack) {  
  
            RadTreeView1.Nodes.Add(new Telerik.Web.UI.RadTreeNode("Node1"));              
            RadTreeView1.Nodes.Add(new Telerik.Web.UI.RadTreeNode("Node2"));              
            RadTreeView1.Nodes.Add(new Telerik.Web.UI.RadTreeNode("Node3"));  
              
            RadTreeView1.Nodes[0].Attributes.Add("test""1234");  
            RadTreeView1.Nodes[1].Attributes.Add("test""1234");  
            RadTreeView1.Nodes[2].Attributes.Add("test""1234");  
        }  
    }  
    protected void RadTreeView1_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e) {  
        TextBox1.Text = e.Node.Attributes["test"];  
    }  

I would assume this is a fairly common task and I'm just overlooking something.

Any help is appreciated!

telerik control is version 2009.1.402.35
Atanas Korchev
Telerik team
 answered on 01 Jul 2009
11 answers
207 views

Hi,

I have a RadGrid inside an <asp:panel> in my page.
The grid has a 
GridButtonColumn that does some AJAX operation in the displayed page. here is definition in the grid:

<

radG:RadGrid ID="grdFavorites" runat="server" CssClass="RadGrid"

 

 

 

 

 

AllowPaging="True"

 

 

 

 

AllowSorting="True"

 

 

 

EnableAJAX="false" EnableAJAXLoadingTemplate="false"

 

 

 

AutoGenerateColumns="False"

 

 

 

Skin="None"  

 

 

LoadingTemplateTransparency="7"

 

 

 

 

PageSize="100" Width="100%" GridLines="None"

 

 

 

OnItemCommand="grdFavorites_ItemCommand"

 

 

 

 

 

OnItemDataBound="grdFavorites_ItemDataBound" onfocus="this.blur();"

 

 

 

 

AllowMultiRowEdit="true"

 

 

 

 

OnNeedDataSource="grdFavorites_NeedDataSource">  

 

 

<ClientSettings>

 

 

 

 

 

<ClientEvents OnRequestStart="RequestStart" />

 

 

 

 

 

</ClientSettings>

 

 

 

<MasterTableView

 

 

 

HeaderStyle-CssClass="RadGridHeader"

 

 

 

FooterStyle-CssClass="RadGridHeader"

 

 

 

ItemStyle-CssClass="RadGridItem"

 

 

 

AlternatingItemStyle-CssClass="RadGridAltItem"

 

 

 

Width="100%"

 

 

 

GridLines="none" DataKeyNames="Id" Style="cursor:pointer;"

 

 

 

AllowMultiColumnSorting="True"

 

 

BorderWidth="0">

 

 

<Columns>

 

 

.......
<radG:GridButtonColumn ItemStyle-Width="7%" ButtonType="ImageButton" ImageUrl="../Images/MyImage.gif"

    HeaderText="Remove"

    UniqueName="RemoveFavorites" CommandName="RemoveFromFavorites"

    Reorderable="False" Resizable="False">

    <ItemStyle Width="40px" />

    <HeaderStyle Width="40px" />

</radG:GridButtonColumn>

</

Columns>

 

 

 

This works ok on IE (tested versions 6-7). However, in Firefox I get an error, It seems the error is on the imagebutton (see the below NET error).

Can anyone help out on this one? Is this a known issue? I can debug the code, but I think it is useless...

 

 Thank you!

 

Server Error in 'xxx' Application.


Input string was not in a correct format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[FormatException: Input string was not in a correct format.]

   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2755599

   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +112

   System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) +138

   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +12

   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194

 


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

Sebastian
Telerik team
 answered on 01 Jul 2009
1 answer
120 views
Hi,
I have a small query regarding the telerik:RadSpell.

Is there any property exposed so that a developer can determine "Is any spell errors still exist" at runtime.

For example : Lets have this scenario.

User enters some text in a textbox
User click spell check button. spell check functionality is invoked.
Now user may change some errors or ignore (as he/she may like).
Now how a developer will know "Is there stil any error after runing the spell check".

please do the needful

Thanks,
Sushil
Rumen
Telerik team
 answered on 01 Jul 2009
1 answer
204 views
Hi,

We are currently developing an application that is using a ginormous amount of Telerik controls (a majority of which have been extended in some regard).  Every once in a while, we come across an error that is being churned up by MS Ajax and would like to figure out what exactly was going on with it.  It's a real pain because the Telerik DLL is using the release version of MS Ajax.  Has anyone in their travels come across a way to have Telerik use the debug version instead?  Is this because Telerik.Web.UI.dll was compiled using the release version?  Are there any workarounds?

Thanks.
Atanas Korchev
Telerik team
 answered on 01 Jul 2009
4 answers
200 views
Hi,

I am loading a usercontrol into a tooltip as per the example on your site. This all works fine techincally, however, it seems that the tooltip can only be of ONE set size height + width. 

So for example, I have 2 linkbuttons at the top of the page. One link button opens a tooltip and displays a small list of radiobuttons. The other linkbutton however needs to display a treeview - therefore we have 2 very different sizes here.

As per the example, I have using tooltipmanager and the targetControls collection - it seems that instead of being able to specify different sizes for different target controls in the collection, I can only specify width and height properties for the tooltip manager itself - and this sucks when he have more than one tooltip/different size tooltips on the page.

Is there any workaround for this? Maybe a way to set height and width dynamically onajaxupdate? 

As a feature it would definately be better to be able to specify tooltip height and width for each targetcontrolid.

Thanks,
Matt
Adam Hubble
Top achievements
Rank 1
 answered on 01 Jul 2009
1 answer
97 views
Hello,

I'm trying to bind some functionality (enable toolbar buttons) to RadEdtiror's TextChanged event, but event never gets fired. Any ideas?

Thanks
Rumen
Telerik team
 answered on 01 Jul 2009
2 answers
79 views
i have a tabstrip which is on a std panel the panel gets made visible and invisible via ajax updates ... all works fine in IE7 but under safari and chrome the second time the panel is shown the tabstip has lost all look and feel and only the text appears

any ideas

kevin
kmv
Top achievements
Rank 1
 answered on 01 Jul 2009
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?