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

Ajax validation not working in radgrid with radupload control

6 Answers 119 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
ravi
Top achievements
Rank 1
ravi asked on 21 Feb 2009, 01:13 PM
Hi

 Here we have problem with radUpload control. we have used ajax validation(ValidatorCalloutExtender) in our project.
one of the file i have implemented with RadFileUpload and ajax validation control. but ajax validation control is not working.
if i remove that upload control validation is working and while execution also its giving error as "Radupload callback Error"

please give any example with ajax validation with fileupload.


we have mentained like this.

            <telerik:RadGrid
                            ID="RadGrid1"
                            runat="server"                    
                            Skin="MyCustomSkin"
                            EnableEmbeddedSkins="false"
                            GridLines="None"            
                            PageSize = "10"        
                            AllowPaging="True"  
                            PagerStyle-Mode="NextPrevAndNumeric"
                            AllowSorting="True"           
                            ShowStatusBar="true"
                            AutoGenerateColumns="False"
                            AllowMultiRowSelection ="true"
                            ClientSettings-Selecting-AllowRowSelect="true"
                            onneeddatasource="RadGrid1_NeedDataSource"
                            oninsertcommand="RadGrid1_InsertCommand"
                            onupdatecommand="RadGrid1_UpdateCommand"
                            ondeletecommand="RadGrid1_DeleteCommand"
                            onitemcommand="RadGrid1_ItemCommand"
                            onitemdatabound="RadGrid1_ItemDataBound"
                            >
                            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>

                            <MasterTableView GridLines="None" Width="100%" CommandItemDisplay="TopAndBottom"
                            DataKeyNames="EmployeeFileID" InsertItemPageIndexAction="ShowItemOnFirstPage">             
                            <CommandItemTemplate>
                                <table align="left">
                                <tr>
                                    <td width="20"></td>
                                    <td>
                                        <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Enabled='<%# !RadGrid1.MasterTableView.IsItemInserted %>'>
                                            <img style="border:0px;vertical-align:middle;" alt="" src="../images/add.jpg" /> Add new
                                        </asp:LinkButton>
                                    </td>
                                    <td width="10"></td>
                                    <td align="center">
                                        <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected Grade Rate?')" runat="server" CommandName="DeleteSelected">
                                            <img style="border:0px;vertical-align:middle;" alt="" src="../images/delete.jpg" /> Delete selected
                                        </asp:LinkButton>
                                    </td>
                                    <td width="10"></td>
                                    <td align="right">
                                        <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandName="RebindGrid">
                                            <img style="border:0px;vertical-align:middle;" alt="" src="../images/refresh.jpg" /> Refresh
                                        </asp:LinkButton>
                                    </td>
                                    <td width="10"></td>
                                </tr>
                                </table>
                            </CommandItemTemplate>
                                <RowIndicatorColumn>
                                <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>

                                <ExpandCollapseColumn>
                                <HeaderStyle Width="20px"></HeaderStyle>
                                </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridClientSelectColumn HeaderStyle-Width="18px"/>                                                                                                              
                                <telerik:GridBoundColumn DataField="Title" HeaderText="Title"/>
                                <telerik:GridBoundColumn HeaderText="Comments" DataField="File_description" />                                                  
                                <telerik:GridTemplateColumn HeaderText="Files">
                                    <ItemTemplate>
                                        <asp:Label ID="lblfiles" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>                                
                            </Columns>
                            <EditFormSettings EditFormType="Template">
                               <EditColumn InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" EditImageUrl="Edit.gif" CancelImageUrl="Cancel.gif" UniqueName="EditCommandColumn1"></EditColumn>
                                <FormTemplate>                
                                    <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                        <tr>
                                            <td style="height:2px"></td>
                                        </tr>
                                        <tr>
                                            <td>Title</td>
                                            <td  style="height:2px">
                                                <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>                                                
                                                <asp:RequiredFieldValidator ID="ReqTitle" runat="server" InitialValue="0" ControlToValidate="txtTitle"
                                                       SetFocusOnError="true"  ErrorMessage="Title is Required" Display="None" ></asp:RequiredFieldValidator>
                                                <cc1:ValidatorCalloutExtender ID="ValidatorGroupID"
                                                        runat="server" TargetControlID="ReqTitle">
                                                </cc1:ValidatorCalloutExtender>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height:2px"></td>
                                        </tr>
                                        <tr>
                                            <td>Comments</td>
                                            <td  style="height:2px">
                                                <asp:TextBox ID="txtComments" TextMode="MultiLine" runat="server"></asp:TextBox>                                                
                                        </tr>
                                        <tr>
                                            <td style="height:2px"></td>
                                        </tr>
                                        <tr>
                                            <td valign="top">File Upload (Allows .txt,.doc)<br>Max Limit 1 MB</td>
                                            <td  style="height:2px">
                                                    <asp:PlaceHolder ID="EditFileUpload" runat="server"></asp:PlaceHolder>        
                                                    <telerik:RadUpload id="RadFileUpload1" runat="server" e initialfileinputscount="1"
                                                    maxfileinputscount="5" controlobjectsvisibility="All" MaxFileSize="1048576" />
                                                    <asp:customvalidator
                                                    id="RadUploadImagesValidate"
                                                    runat="server"
                                                    display="dynamic"                                                     
                                                    ErrorMessage="Please select valid images" />                                                    
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height:2px"></td>
                                        </tr>
                                        <tr>
                                            <td class="lbl">Start Date Active</td>
                                                <td class="txt">
                                                <asp:TextBox ID="txtStartDateActive" runat="server" style="width:75px" ReadOnly="true"></asp:TextBox>                                                                                                                       
                                           </td>
                                        </tr>    
                                        <tr>
                                            <td style="height:2px"></td>
                                        </tr>
                                        <tr>
                                            <td class="lbl">End Date Active</td>
                                                <td class="txt">
                                                <asp:TextBox ID="txtEndDateActive"  runat="server" style="width:75px" ReadOnly="true"></asp:TextBox>    
                                           </td>
                                        </tr>        
                                                                                                                                                             
                                        <tr>
                                            <td style="height:2px"></td>
                                        </tr>                                                    
                                        <tr>
                                            <td></td>
                                            <td class="txt">
                                                <asp:LinkButton ID="btnInsert" runat="server" CommandName="PerformInsert"  Visible='<%# (Container is GridEditFormInsertItem) ? true : false %>'><img src="../images/insert.jpg" border="0" /></asp:LinkButton>    
                                                <asp:LinkButton ID="btnCorrection" OnClientClick="javascript:return confirmEdit('Correction')" runat="server" CommandName="Update" Visible='<%# (Container is GridEditFormInsertItem) ? false : true %>'><img src="../images/correction.jpg" border="0" /></asp:LinkButton>                
                                                <asp:LinkButton ID="btnUpdate" runat="server" CommandName="Update" Visible='<%# (Container is GridEditFormInsertItem) ? false : true %>'><img src="../images/update.jpg" border="0" /></asp:LinkButton>
                                                <asp:LinkButton ID="btnClose" runat="server" CommandName="Cancel" CausesValidation="False"><img src="../images/cancel.jpg" border="0" /></asp:LinkButton>                                        
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height:5px"></td>
                                        </tr>
                                        <tr>
                                            <td></td><td id="errMsg" class="err_msg" runat="server"></td>
                                        </tr>
                                        <tr>
                                            <td style="height:5px"></td>
                                        </tr>
                                    </table>
                                </FormTemplate>                                                    
                            </EditFormSettings>                                                 
                            </MasterTableView>                                                    

                        <ClientSettings>
                        <Selecting AllowRowSelect="True"></Selecting>
                        </ClientSettings>

                        <FilterMenu Skin="MyCustomSkin" EnableEmbeddedSkins="False" EnableTheming="True">
                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                        </FilterMenu>
                        </telerik:RadGrid>
                    

please give reply ASAP.

thx.



 

6 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 23 Feb 2009, 04:07 PM
Hello ravi,

I have replicated the issue and in my scenario the ValidatorCallout is showing. Please find my test project as an attachment. In addition, I have reviewed your code but i did not manage to find any obvious mistakes. Could you please send us a running sample of your scenario that can be debugged locally in order to investigate the issue.

Kind regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
ravi
Top achievements
Rank 1
answered on 24 Feb 2009, 05:25 PM
Hi Genady Sergeev,

         its problem with  RadAjaxManager , please can you check again in my code.
if i remove RadAjaxManager ,  validation is working .
can you test with your application along with RadAjaxManager.

then you can know real problem.
please reply me ASAP.

thx
Ravi
0
Genady Sergeev
Telerik team
answered on 25 Feb 2009, 03:15 PM
Hi ravi,

I have replicated the issue with RadAjaxManager and everything is working correctly. Please find my test project attached. I have also reviewed your code but I am unable to find anything unusual. Which controls do you update with the RadAjaxManager?

Keep in mind that RadUpload (and the standart upload too) can't upload files using ajax  so, if your grid is ajaxified you need to attach an event handler on the OnRequestStart client-side event of the RadAjaxPanel (or RadAjaxManager), which will disable the AJAX functionality if a specific button (say upload button) is clicked. Please refer to my attachment or this demo for an illustration of the scenario.

If none of this helps you, would you please send us a sample running project describing the issue in order to assist you better.


All the best,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jeff
Top achievements
Rank 1
answered on 25 Aug 2010, 10:04 PM
This does not work with the ajaxmanagerproxy, there are no clientevents. How would you do this using the ajaxmanagerproxy?
0
T. Tsonev
Telerik team
answered on 27 Aug 2010, 04:32 PM
Hello Jeff,

You can access the RadAjaxManager instance using GetCurrent and attach the event directly to it:

RadAjaxManager.GetCurrent(Page).ClientEvents.OnRequestStart = "handlerName";

More info about this method - RadAjax and WebUserControls

I hope this helps.

Kind regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jeff
Top achievements
Rank 1
answered on 27 Aug 2010, 05:40 PM
Thanks, That worked.
Tags
Upload (Obsolete)
Asked by
ravi
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
ravi
Top achievements
Rank 1
Jeff
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or