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

RADGrid and validtors

2 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
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,
Simon

2 Answers, 1 is accepted

Sort by
0
Simon
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!?

Thanks,
Simon

 

<%@ 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=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
    Namespace="System.Web.UI" TagPrefix="asp" %> 
 
<!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>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
      
    <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">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="grdItems">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="grdItems" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
       
    <telerik:RadGrid runat="server" ID="grdItems" EnableEmbeddedSkins="false" AutoGenerateColumns="false" DataSourceID="odsData"  > 
    <MasterTableView CommandItemDisplay="Top" EditMode="InPlace" AllowPaging="true" PageSize="10" DataKeyNames="UniqueID">  
        <Columns> 
            <telerik:GridTemplateColumn HeaderText="List 1">  
                <ItemTemplate> 
                    Some thing  
                </ItemTemplate> 
                <EditItemTemplate> 
                    <telerik:RadComboBox runat="server" ID="ddlList1" Width="80px" EnableEmbeddedSkins="false" Skin="GraySkin" AllowCustomText="true" MaxLength="50" CausesValidation="false">  
                        <Items> 
                            <telerik:RadComboBoxItem Value="" Text="" Selected="True" /> 
                            <telerik:RadComboBoxItem Value="a" Text="a" Selected="False" /> 
                            <telerik:RadComboBoxItem Value="s" Text="s" Selected="False" /> 
                        </Items> 
                    </telerik:RadComboBox> 
                    <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" /> 
                          
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridEditCommandColumn UniqueName="colMod" ButtonType="LinkButton" EditText="Modify" CancelText="Cancel" /> 
        </Columns> 
        <CommandItemTemplate> 
            <table width="100%">  
                <tr> 
                    <td align="left">  
                        A Title  
                    </td> 
                    <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"  /> 
                    </td> 
                </tr> 
            </table> 
        </CommandItemTemplate> 
    </MasterTableView> 
</telerik:RadGrid> 
 
      
    </div> 
    </form> 
</body> 
</html> 
 

 

0
Simon
Top achievements
Rank 1
answered on 29 Dec 2008, 12:55 PM
OK...

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.

Simon
Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
Share this question
or