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

Ajax and Validator Error

3 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Legalia
Top achievements
Rank 1
Legalia asked on 31 Dec 2008, 01:27 PM
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.

3 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 05 Jan 2009, 09:36 AM
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.
0
Legalia
Top achievements
Rank 1
answered on 22 Jan 2009, 05:36 AM
hi...
i am placing my code here..

ASPX file....
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="dgMyGrid"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="dgMyGrid" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadGrid ID="dgMyGrid" Width="97%" AllowSorting="True" AllowPaging="True" 
            PageSize="15" runat="server" AllowMultiRowSelection="false" AllowMultiRowEdit="false" 
            AllowAutomaticUpdates="false" AutoGenerateColumns="false" ShowStatusBar="true" 
            AutoGenerateEditColumn="true" AutoGenerateDeleteColumn="true" AllowFilteringByColumn="True" 
            ShowGroupPanel="false" OnNeedDataSource="dgMyGrid_NeedDataSource"
            <PagerStyle Mode="Slider" /> 
            <MasterTableView CommandItemDisplay="Top" DataKeyNames="code" EditMode="InPlace" 
                Width="100%"
                <CommandItemTemplate> 
                    <div style="padding: 10px 0px;"
                        <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> 
                    </div> 
                </CommandItemTemplate> 
                <Columns> 
                    <telerik:GridTemplateColumn HeaderText="Name" SortExpression="description" UniqueName="description" 
                        EditFormColumnIndex="1" DataField="description"
                        <HeaderStyle Width="170px" /> 
                        <ItemTemplate> 
                            <asp:Label runat="server" ID="lblDescription" Text='<%#Eval("description")%>' /> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <asp:TextBox runat="server" Width="120px" ID="txtDescription" MaxLength="50" Text='<%# Bind("description") %>' /> 
                            <span class="reqChar">*</span> 
                            <asp:RequiredFieldValidator ID="rfvDescription" ControlToValidate="txtDescription" 
                                ErrorMessage='Description required.' runat="server" Display="None" /> 
                            <asp:ValidationSummary runat="server" ID="valSummary" ShowMessageBox="true" ShowSummary="false" 
                                DisplayMode="BulletList" /> 
                        </EditItemTemplate> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 

and code of CS file..
protected void dgMyGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        { 
            BindData(); 
        } 
 
        void BindData() 
        { 
            dgMyGrid.DataSource = GetPersonData(); //-- 'GetPersonData' returns data table. 
        } 

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.
0
Accepted
Paresh
Top achievements
Rank 1
answered on 22 Jan 2009, 06:05 AM
hi...
i got the solution...
the problem is due to framework version. installing service pack it will work.

thanks..
Tags
Grid
Asked by
Legalia
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Legalia
Top achievements
Rank 1
Paresh
Top achievements
Rank 1
Share this question
or