Ajax and Validator Error

4 posts, 1 answers
  1. Legalia
    Legalia avatar
    26 posts
    Member since:
    Nov 2008

    Posted 31 Dec 2008 Link to this post

    I am getting error on Insert/Update in Radgrid.

    Validators are does not works or
    only works after post back in grid with editmode inplace or editforms.

    the page works fine on local PC(windows XP) but after uploading on server (Windows 2003) it fires validators only after once page is postback.
  2. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 05 Jan 2009 Link to this post

    Hi Shahejad,

    Could you please elaborate what is the error you receive? Any further information about your scenario is also welcome. You can refer to this online example for illustration of validation in a Grid's edit field.

    Greetings,
    Pavel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Legalia
    Legalia avatar
    26 posts
    Member since:
    Nov 2008

    Posted 21 Jan 2009 Link to this post

    hi...
    i am placing my code here..

    ASPX file....
    1  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    2             <AjaxSettings> 
    3                 <telerik:AjaxSetting AjaxControlID="dgMyGrid"
    4                     <UpdatedControls> 
    5                         <telerik:AjaxUpdatedControl ControlID="dgMyGrid" /> 
    6                     </UpdatedControls> 
    7                 </telerik:AjaxSetting> 
    8             </AjaxSettings> 
    9         </telerik:RadAjaxManager> 
    10         <telerik:RadGrid ID="dgMyGrid" Width="97%" AllowSorting="True" AllowPaging="True" 
    11             PageSize="15" runat="server" AllowMultiRowSelection="false" AllowMultiRowEdit="false" 
    12             AllowAutomaticUpdates="false" AutoGenerateColumns="false" ShowStatusBar="true" 
    13             AutoGenerateEditColumn="true" AutoGenerateDeleteColumn="true" AllowFilteringByColumn="True" 
    14             ShowGroupPanel="false" OnNeedDataSource="dgMyGrid_NeedDataSource"
    15             <PagerStyle Mode="Slider" /> 
    16             <MasterTableView CommandItemDisplay="Top" DataKeyNames="code" EditMode="InPlace" 
    17                 Width="100%"
    18                 <CommandItemTemplate> 
    19                     <div style="padding: 10px 0px;"
    20                         <asp:LinkButton ID="lnkInsert" runat="server" CommandName="InitInsert" Visible='<%# !dgMyGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Images/Grid/AddRecord.gif" /> Add new Item</asp:LinkButton> 
    21                     </div> 
    22                 </CommandItemTemplate> 
    23                 <Columns> 
    24                     <telerik:GridTemplateColumn HeaderText="Name" SortExpression="description" UniqueName="description" 
    25                         EditFormColumnIndex="1" DataField="description"
    26                         <HeaderStyle Width="170px" /> 
    27                         <ItemTemplate> 
    28                             <asp:Label runat="server" ID="lblDescription" Text='<%#Eval("description")%>' /> 
    29                         </ItemTemplate> 
    30                         <EditItemTemplate> 
    31                             <asp:TextBox runat="server" Width="120px" ID="txtDescription" MaxLength="50" Text='<%# Bind("description") %>' /> 
    32                             <span class="reqChar">*</span> 
    33                             <asp:RequiredFieldValidator ID="rfvDescription" ControlToValidate="txtDescription" 
    34                                 ErrorMessage='Description required.' runat="server" Display="None" /> 
    35                             <asp:ValidationSummary runat="server" ID="valSummary" ShowMessageBox="true" ShowSummary="false" 
    36                                 DisplayMode="BulletList" /> 
    37                         </EditItemTemplate> 
    38                     </telerik:GridTemplateColumn> 
    39                 </Columns> 
    40             </MasterTableView> 
    41         </telerik:RadGrid> 

    and code of CS file..
    1 protected void dgMyGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    2         { 
    3             BindData(); 
    4         } 
    5  
    6         void BindData() 
    7         { 
    8             dgMyGrid.DataSource = GetPersonData(); //-- 'GetPersonData' returns data table. 
    9         } 

    i have nothing more than this in my page. it works fine in my local PC. but it does not firing validators on server.

    thanks.
  5. Answer
    Paresh
    Paresh avatar
    11 posts
    Member since:
    Jan 2009

    Posted 22 Jan 2009 Link to this post

    hi...
    i got the solution...
    the problem is due to framework version. installing service pack it will work.

    thanks..
Back to Top