This is a migrated thread and some comments may be shown as answers.

RADGrid and validtors

2 Answers 89 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Simon asked on 29 Dec 2008, 10:13 AM
Hi there -

I have a RADGrid in which I use GridTemplateColumns.  In one of these templates I have an EditItemTemplate that contains a RadComboBox, and RequiredFieldValidator and and ValidatorCalloutExetension.  The validator and callout work as expected when the grid is in edit mode until I add a RadAjaxManager to the page. 

With the RadAjaxManager the validator by itself works correctly, however, when I add the ValidatorCalloutExtension back in I start receiving a JavaScript error: Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: id

The problem seems to lie with the ValidatorCalloutExtension and the RadAjaxManager - is this anyone else is aware of, is there a "trick" I've missed anywhere? 

I will try and put together a simplified code example to add to the post.

Many thanks,

2 Answers, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 29 Dec 2008, 12:07 PM

As promised: an example of my ASPX.... You can use any datasource with it, as there's currently no databinding in this example - I show an ObjectDataSource here.

I need the RadAjaxManager to allow me use the export buttons in the CommandItemTemplate.  However, this stops the ValidatorCalloutExtender working at all.

This code doesn't produce the same error as my production code but it has the same ultimate effect - the Callout isn't shown.

If you remove the RadAjaxManager from the ASPX below then the Callout works prefectly.

Anyone with any ideas - I'm sure I've probably missed something really simple!?



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SGTest.aspx.cs" Inherits="MyTest.SGTest" %> 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
    Namespace="System.Web.UI" TagPrefix="asp" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 
<html xmlns="">  
<head runat="server">  
    <title>Untitled Page</title> 
    <form id="form1" runat="server">  
    <asp:ObjectDataSource runat="server" ID="odsData" TypeName="MyNamespace.MyClass" SelectMethod="GetData"  /> 
    <telerik:RadScriptManager runat="server" ID="rsm1"></telerik:RadScriptManager> 
    <telerik:RadAjaxManager runat="server" ID="ram1">  
            <telerik:AjaxSetting AjaxControlID="grdItems">  
                    <telerik:AjaxUpdatedControl ControlID="grdItems" /> 
    <telerik:RadGrid runat="server" ID="grdItems" EnableEmbeddedSkins="false" AutoGenerateColumns="false" DataSourceID="odsData"  > 
    <MasterTableView CommandItemDisplay="Top" EditMode="InPlace" AllowPaging="true" PageSize="10" DataKeyNames="UniqueID">  
            <telerik:GridTemplateColumn HeaderText="List 1">  
                    Some thing  
                    <telerik:RadComboBox runat="server" ID="ddlList1" Width="80px" EnableEmbeddedSkins="false" Skin="GraySkin" AllowCustomText="true" MaxLength="50" CausesValidation="false">  
                            <telerik:RadComboBoxItem Value="" Text="" Selected="True" /> 
                            <telerik:RadComboBoxItem Value="a" Text="a" Selected="False" /> 
                            <telerik:RadComboBoxItem Value="s" Text="s" Selected="False" /> 
                    <asp:RequiredFieldValidator runat="server" ID="reqList1" ControlToValidate="ddlList1" 
                        Display="Dynamic" ErrorMessage="You must select something from this list"  /> 
                    <ajax:ValidatorCalloutExtender runat="server" ID="cveList1" TargetControlID="reqList1" /> 
            <telerik:GridEditCommandColumn UniqueName="colMod" ButtonType="LinkButton" EditText="Modify" CancelText="Cancel" /> 
            <table width="100%">  
                    <td align="left">  
                        A Title  
                    <td align="right">  
                        <asp:ImageButton ID="ExportToWordButton" runat="server" ImageUrl="~/images/Word.gif" 
                            ToolTip="Export to Microsoft Word" /> 
                        <asp:ImageButton ID="ExportToExcelButton" runat="server" ImageUrl="~/images/Excel.gif" 
                            ToolTip="Export to Microsoft Excel"  /> 


Top achievements
Rank 1
answered on 29 Dec 2008, 12:55 PM

So after a couple of days playing I think I may have stumbled across the real problem.

I was wrong in thinking that the issue was the RADGrid, or indeed the RadAjaxManager, it infact seems to be the RadScriptManager that causes the problem.

Setting EnableScriptCombine="false" solves the problem. 

I experienced the problem when using a normal UpdatePanel as well, and as such would imagine that it's not Telerik's issue but Microsoft's.

Whilst this isn't an ideal solution, it is certainly a work around.

Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question