Modal Popup Dialog validation problem

Dear friends,

 

I have a button Import on my page. Upon pressing this button, a modal popup dialog appears where the user can enter path of the import file. I have a required field validator to make sure the user entered the path. And I have there a Submit button. I use validation group to make sure only certain controls on the modal popup dialog cause validation. It used to work until I added double click functionality to a GridView IN THE PAGE. Now when I click on a GridView, the Modal Popup is validated, which I don't want.

How can I solve this problem?

Thanks,

Dmitriy
tantormediaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
masterpassConnect With a Mentor Commented:
OK .  Now I see the problem. you have used Page_ClientValidate in javascript

The usage is as follows

Page_ClientValidate('ValidationGroupname');

So If you are not specifying a validation group here, then the whole page will be validated regardless of the validation group.
So If you are having some validations to be done in gridview then specify a validationgroup to that and call that particular validationgroup in Page_ClientValidate('ValidationGroupname'); I hope this will solve your problem
0
 
masterpassCommented:
you will have to apply validation group for the validators inside the modalpopup and then associate the same validation group with the button inside the modalpopup. since you have this implemented .. Can you explain a bit on "double click functionality to a GridView IN THE PAGE" . If possible with the HTMl markup of the gridview and of the modalpopup panel and extender

0
 
tantormediaAuthor Commented:
Yes, this is exactly what I have done.
Here is the code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Licensing.ascx.cs" Inherits="Licensing" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>

    <link type="text/css" href="StyleSheet.css" rel="stylesheet" />
    <style type="text/css">
        table { table-layout: fixed; 
            margin-right: 900px;
            margin-top: 7px;
        }
        td { overflow:hidden; white-space:nowrap; width:100%;}
        #form
        {
            height: 391px;
            width: 9803px;
        }
        .largegridview { table-layout: fixed; width:20000px;
            margin-right: 900px;
            margin-top: 7px;
        }        
        .style1
        {
            width: 643px;
        }
        .style2
        {
            width: 101px;
        }
    </style>
    <script type="text/javascript" src="ResizableGridView.js"></script> 
    <script type="text/javascript">
        function ShowImportErrors() {
            setTimeout("$find('ShowImportErrors').show();", 1000);
        }
    </script>

    <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
    <br />
    <br />
    <asp:DropDownList ID="ddlFilter" runat="server" AutoPostBack="True" 
        Height="20px" style="margin-right:20px" Width="227px" 
        CausesValidation="True" onselectedindexchanged="btnFilter_OnClick">
            <asp:ListItem Text="All" Value="-2" Selected="True" />
            <asp:ListItem Text="My Titles" Value="-1" />
            <asp:ListItem Text="Cancelled Titles" Value="0" />
            <asp:ListItem Text="On Offer" Value="1" />
            <asp:ListItem Text="For Consideration" Value="2" />
            <asp:ListItem Text="Make Offer" Value="3" />
            <asp:ListItem Text="On Hold" Value="4" />            
    </asp:DropDownList>
    <asp:DropDownList ID="ddlBookQuestFields" runat="server" Height="20px" 
        Width="350px"  >
    </asp:DropDownList>    
     <asp:TextBox ID="txtFilterValue" runat="server"></asp:TextBox>    
    <asp:CustomValidator ID="CustomError" runat="server" onservervalidate="Custom_ServerValidate"
        ControlToValidate="txtFilterValue" ErrorMessage="Populated Dynamically" >* </asp:CustomValidator>    
    <asp:Button ID="btnFilter" runat="server" Text="Search" OnClick="btnFilter_OnClick" />                          

    <asp:Panel ID="pnlSubmitOffer" runat="server" CssClass="modalPopup" Style="display:none" Width="700px" >
        <asp:GridView ID="SubmitOfferGridView" runat="server" AllowSorting="True"
                AutoGenerateColumns="False" 
                Width="100%" Height="306px" DataKeyNames="EAN" >
            <AlternatingRowStyle CssClass="alternatingrowstyle" />
            <Columns>
                <asp:BoundField DataField="EAN" HeaderText="EAN" SortExpression="EAN" />
                <asp:TemplateField HeaderText="Offer Date" SortExpression="OfferDate">
                    <ItemTemplate>   
                        <asp:ImageButton runat="Server" ID="imgBtnOfferDate" 
                            ImageUrl="~/Images/Calendar_scheduleHS.png" 
                            AlternateText="Click here to display calendar" />
                        <asp:TextBox ID="OfferDate" runat="server" 
                            Text='<%# Bind("OfferDate","{0:M/d/yyyy}") %>'></asp:TextBox>
                        <ajaxToolkit:CalendarExtender ID="OfferDateCE" runat="server" 
                            TargetControlID="OfferDate" PopupButtonID="imgBtnOfferDate"/>                                
                        <asp:CompareValidator ID="OfferDateCompareValidator" runat="server" 
                            ControlToValidate="OfferDate" Display="Dynamic" 
                            ErrorMessage="Invalid OfferDate!" Text="*" Operator="DataTypeCheck" 
                            Type="Date"></asp:CompareValidator>
                        <ajaxToolkit:ValidatorCalloutExtender ID="OfferDateCompareValidator_ValidatorCalloutExtender" 
                            runat="server" Enabled="True" TargetControlID="OfferDateCompareValidator"></ajaxToolkit:ValidatorCalloutExtender>
                    </ItemTemplate>
                </asp:TemplateField>   
                <asp:TemplateField HeaderText="Amount" SortExpression="Amount">
                    <ItemTemplate>    
                        <asp:TextBox ID="Amount" runat="server" Text='<%#Bind("Amount") %>'></asp:TextBox>
                        <asp:CompareValidator ID="AmountCompareValidator" runat="server" 
                            ControlToValidate="Amount" Display="Dynamic" 
                            ErrorMessage="Amount has invalid currency value!" Text="*" 
                            Operator="DataTypeCheck" Type="Currency"></asp:CompareValidator>
                    </ItemTemplate>
                </asp:TemplateField>    
                <asp:TemplateField HeaderText="Expiration Date" SortExpression="ExpirationDate">
                    <ItemTemplate>   
                        <asp:ImageButton runat="Server" ID="imgBtnExpirationDate" 
                            ImageUrl="~/Images/Calendar_scheduleHS.png" 
                            AlternateText="Click here to display calendar" />
                        <asp:TextBox ID="ExpirationDate" runat="server" 
                            Text='<%# Bind("ExpirationDate","{0:M/d/yyyy}") %>'></asp:TextBox>
                        <ajaxToolkit:CalendarExtender ID="ExpirationDateCE" runat="server" 
                            TargetControlID="ExpirationDate" PopupButtonID="imgBtnExpirationDate"/>                                
                        <asp:CompareValidator ID="ExpirationDateCompareValidator" runat="server" 
                            ControlToValidate="ExpirationDate" Display="Dynamic" 
                            ErrorMessage="Invalid ExpirationDate!" Text="*" Operator="DataTypeCheck" 
                            Type="Date"></asp:CompareValidator>
                        <ajaxToolkit:ValidatorCalloutExtender ID="ExpirationDateCompareValidator_ValidatorCalloutExtender" 
                            runat="server" Enabled="True" 
                            TargetControlID="ExpirationDateCompareValidator"></ajaxToolkit:ValidatorCalloutExtender>
                    </ItemTemplate>
                </asp:TemplateField>                                                  
            </Columns>
            <HeaderStyle CssClass="headerstyle" />
        </asp:GridView> 

        <div align="center">
            <asp:Button ID="btnSubmitSubmitOffer" runat="server" Text="Submit" OnClick="btnSubmitSubmitOffer_Click" />
            <asp:Button ID="btnCancelSubmitOffer" runat="server" Text="Cancel" />
        </div>
    </asp:Panel>
    
    <asp:Panel ID="pnlOnHold" runat="server" CssClass="modalPopup" Style="display:none" Width="400px" >
        <p>
        Please enter your comments:
       </p>  
        <div align="center">  
            <asp:TextBox ID="txtOnHoldComment" runat="server" TextMode="MultiLine" Width="350px" Height="100px" MaxLength="255" ></asp:TextBox>
        </div>  
        <div align="center">
            <asp:Button ID="btnSubmitOnHold" runat="server" Text="Submit" OnClick="btnSubmitOnHold_Click" />
            <asp:Button ID="btnCancelOnHold" runat="server" Text="Cancel" />
        </div>
    </asp:Panel>
    
    <asp:Panel ID="pnlAssignTitle" runat="server" CssClass="modalPopup" Style="display:none" Width="200px" >
        <p>
            Please select a user:
        </p>  
        <div align="center">  
            <asp:DropDownList ID="ddlUser" runat="server" DataSourceID="UserSqlDataSource" DataTextField="Name" DataValueField="ID" >
            </asp:DropDownList>
        </div>                                
        <br /><br />
        <div align="center">
            <asp:Button ID="btnSubmitAssignTitle" runat="server" Text="Submit" OnClick="btnSubmitAssignTitle_Click" />
            <asp:Button ID="btnCancelAssignTitle" runat="server" Text="Cancel" />
        </div>   
        
        <asp:SqlDataSource ID="UserSqlDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BookList %>" 
            ProviderName="<%$ ConnectionStrings:BookList.ProviderName %>" SelectCommand="SELECT ID, Name FROM User;" >
        </asp:SqlDataSource>             
    </asp:Panel>
    
    <asp:Panel ID="pnlCancel" runat="server" CssClass="modalPopup" Style="display:none" Width="1000px" >
        <asp:GridView ID="CancelGridView" runat="server" AllowSorting="True"
                AutoGenerateColumns="False" 
                Width="100%" Height="306px" DataKeyNames="EAN" >
            <AlternatingRowStyle CssClass="alternatingrowstyle" />
            <Columns>
                <asp:BoundField DataField="EAN" HeaderText="EAN" SortExpression="EAN" />
                <asp:TemplateField HeaderText="Cancellation Reason" SortExpression="Reason">
                    <ItemTemplate>    
                        <asp:DropDownList ID="Reason" runat="server" >
                            <asp:ListItem Selected="True" Text="Outbid" Value="0"></asp:ListItem>
                            <asp:ListItem Text="Not Available" Value="1"></asp:ListItem> 
                            <asp:ListItem Text="Withdrawn" Value="2"></asp:ListItem>                         
                        </asp:DropDownList>                                
                    </ItemTemplate>                    
                </asp:TemplateField>                            
                <asp:TemplateField HeaderText="Comments" SortExpression="Comments">
                    <ItemTemplate>    
                        <asp:TextBox ID="Comments" runat="server" Width="100%" MaxLength="255" ></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="headerstyle" />
        </asp:GridView> 

        <div align="center">
            <asp:Button ID="btnSubmitCancel" runat="server" Text="Submit" OnClick="btnSubmitCancel_Click" />
            <asp:Button ID="btnCancelCancel" runat="server" Text="Cancel" />
        </div>        
    </asp:Panel>
    
    <asp:Panel ID="pnlImport" runat="server" CssClass="modalPopup" Style="display:none" Width="800px" >
        <p>
        Select a file to import:
       </p>  
        <div align="center">  
            <asp:FileUpload ID="importFilePath" runat="server" Height="27px" Size="80" />
            <br />
            <asp:RequiredFieldValidator 
                 id="importFilePathRequiredFieldValidator" runat="server" 
                 ErrorMessage="You must enter path for the import file!" 
                 ControlToValidate="importFilePath" ValidationGroup="ImportPath" >
                 </asp:RequiredFieldValidator>
            <br />
            <asp:RegularExpressionValidator 
                 id="importFilePathRegularExpressionValidator" runat="server" 
                 ErrorMessage="Only xls and xlsx files are allowed!" 
                 ValidationExpression="^.*\.(xls|XLS|xlsx|XLSX)$" 
                 ControlToValidate="importFilePath" ValidationGroup="ImportPath" >
                 </asp:RegularExpressionValidator>       
            <br />
            <asp:CustomValidator ID="HasFileCustomValidator" runat="server" ControlToValidate="importFilePath" OnServerValidate="HasFileCustomValidate" 
                ErrorMessage="No File Supplied!" ValidationGroup="ImportPath"></asp:CustomValidator>               
        </div>  
        <div align="center">
            <asp:TextBox ID="txtError" runat="server" Text="Set Dynamically" Visible="false" TextMode="MultiLine" CssClass="Warning" BackColor="Transparent" BorderStyle="None" Width="700px"></asp:TextBox>
            <br />
            <asp:Button ID="btnSubmitImport" runat="server" Text="Import" OnClick="btnSubmitImport_Click" ValidationGroup="ImportPath" />
            <asp:Button ID="btnCancelImport" runat="server" Text="Cancel" />
        </div>
    </asp:Panel>    
    
    <ajaxToolkit:ModalPopupExtender ID="SubmitOfferModalPopupExtender" runat="server" TargetControlID="btnShowSubmitOfferPopup" PopupControlID="pnlSubmitOffer" BackgroundCssClass="modalBackground" DropShadow="true" CancelControlID="btnCancelSubmitOffer" >
    </ajaxToolkit:ModalPopupExtender>    
    <ajaxToolkit:ModalPopupExtender ID="OnHoldModalPopupExtender"      runat="server" TargetControlID="btnShowPutOnHoldPopup"   PopupControlID="pnlOnHold"      BackgroundCssClass="modalBackground" DropShadow="true" CancelControlID="btnCancelOnHold" >
    </ajaxToolkit:ModalPopupExtender>
    <ajaxToolkit:ModalPopupExtender ID="AssignTitleModalPopupExtender" runat="server" TargetControlID="btnShowAssignTitlePopup" PopupControlID="pnlAssignTitle" BackgroundCssClass="modalBackground" DropShadow="true" CancelControlID="btnCancelAssignTitle" >
    </ajaxToolkit:ModalPopupExtender>    
    <ajaxToolkit:ModalPopupExtender ID="CancelModalPopupExtender"      runat="server" TargetControlID="btnShowCancelPopup"      PopupControlID="pnlCancel"      BackgroundCssClass="modalBackground" DropShadow="true" CancelControlID="btnCancelCancel" >
    </ajaxToolkit:ModalPopupExtender> 
    <ajaxToolkit:ModalPopupExtender ID="ImportModalPopupExtender"      runat="server" TargetControlID="btnShowImportPopup"      PopupControlID="pnlImport"      BackgroundCssClass="modalBackground" DropShadow="true" CancelControlID="btnCancelImport" BehaviorID="ShowImportErrors" >
    </ajaxToolkit:ModalPopupExtender>     
    
    <asp:SqlDataSource ID="FrontListSqlDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BookList %>" DataSourceMode="DataSet" 
        ProviderName="<%$ ConnectionStrings:BookList.ProviderName %>" 
    >
        <UpdateParameters>
            <asp:Parameter Name="EAN" Type="String" />
<%--            <asp:Parameter Name="B" Type="String" />
            <asp:Parameter Name="C" Type="String" />
            <asp:Parameter Name="D" Type="String" />
            <asp:Parameter Name="E" Type="String" />
            <asp:Parameter Name="F" Type="String" />
            <asp:Parameter Name="Id" Type="Int32" />
--%>        </UpdateParameters>    
    </asp:SqlDataSource>

    <asp:GridView ID="FrontListGridView" runat="server" AllowSorting="True" ShowFooter="True"
                    AllowPaging="True" PageSize="100" DataSourceID="FrontListSqlDataSource" 
                    AutoGenerateColumns="False" Width="2500px" Height="100%" 
                    OnRowDataBound="FrontListGridView_RowDataBound" 
                    OnRowCommand="FrontListGridView_RowCommand" OnRowUpdating="FrontListGridView_RowUpdating"
                    CssClass="largegridview" DataKeyNames="EAN" CausesValidation="false">        
            <AlternatingRowStyle CssClass="alternatingrowstyle" />
            <Columns>
          
                 <asp:BoundField DataField="Color" HeaderText="Color" SortExpression="Color" Visible="true" />
                 <asp:TemplateField>
                    <ItemTemplate>
                         <asp:CheckBox ID="BookSelector" runat="server" >
                         </asp:CheckBox>
                    </ItemTemplate>
                 </asp:TemplateField>  
                 
                 <asp:ButtonField Text="DoubleClick" CommandName="DoubleClick" Visible="False" />
                                
                 <%--<asp:BoundField DataField="EAN" HeaderText="EAN" SortExpression="EAN" />--%>
                 <asp:TemplateField HeaderText="EAN" SortExpression="EAN">
                    <ItemTemplate>
                        <asp:Label ID="lblEAN" runat="server" Text='<%# Eval("EAN") %>'></asp:Label>
                        <asp:TextBox ID="EAN" runat="server" Text='<%# Eval("EAN") %>' visible="false" CssClass="ssTextBox"></asp:TextBox>
                    </ItemTemplate>
                    <ItemStyle CssClass="ssCell" />                    
                </asp:TemplateField>
                 
                 <asp:TemplateField HeaderText="TantorStatus" SortExpression="TantorStatus">
                    <ItemTemplate><%# Server.HtmlDecode(Convert.IsDBNull(Eval("TantorStatus")) ? string.Empty : tantorStatuses[Convert.ToInt32(Eval("TantorStatus"))])%></ItemTemplate>
                </asp:TemplateField>
                 <asp:BoundField DataField="AssignedTo" HeaderText="Assigned To" SortExpression="AssignedTo" />                
                 <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                 <asp:BoundField DataField="RespParty" HeaderText="RespParty" SortExpression="RespParty" />
                 <asp:BoundField DataField="Publisher" HeaderText="Publisher" SortExpression="Publisher" />
                 <asp:BoundField DataField="PubDate" HeaderText="PubDate" SortExpression="PubDate" />
                 <asp:BoundField DataField="Subject" HeaderText="Subject" SortExpression="Subject" />
                 <asp:BoundField DataField="Binding" HeaderText="Binding" SortExpression="Binding" />
                 <asp:BoundField DataField="PageCount" HeaderText="PageCount" SortExpression="PageCount" />
                 <asp:BoundField DataField="USListPrice" HeaderText="USListPrice" SortExpression="USListPrice" />
                 <asp:BoundField DataField="Demand" HeaderText="Demand" SortExpression="Demand" />
                 <asp:BoundField DataField="OnOrder" HeaderText="OnOrder" SortExpression="OnOrder" />
                 <asp:BoundField DataField="OnBackorder" HeaderText="OnBackorder" SortExpression="OnBackorder" />
                 <asp:BoundField DataField="SpeedStock" HeaderText="SpeedStock" SortExpression="SpeedStock" />
                 <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
                 <asp:BoundField DataField="BTKey" HeaderText="BTKey" SortExpression="BTKey" />
                 <asp:BoundField DataField="FirstPrinting" HeaderText="FirstPrinting" SortExpression="FirstPrinting" />
                 <asp:BoundField DataField="Ingram" HeaderText="Ingram" SortExpression="Ingram" />
                 <asp:BoundField DataField="Licensor" HeaderText="Licensor" SortExpression="Licensor" />
                 <asp:BoundField DataField="OfferDate" HeaderText="OfferDate" SortExpression="OfferDate" />
                 <asp:BoundField DataField="LastDate" HeaderText="LastDate" SortExpression="LastDate" />
                 <asp:BoundField DataField="Comments" HeaderText="Comments" SortExpression="Comments" />
                 <asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" />
                 <asp:BoundField DataField="FirstAppearance" HeaderText="FirstAppearance" SortExpression="FirstAppearance" />
                 <asp:BoundField DataField="Material" HeaderText="Material" SortExpression="Material" />

            </Columns>

            <HeaderStyle CssClass="headerstyle" />

    </asp:GridView> 
    
    <asp:Label ID="Label1" runat="server" Text="Show rows:" />
    <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true" 
        OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
        <asp:ListItem Value="20" />
        <asp:ListItem Value="50" />
        <asp:ListItem Value="100" Selected="True" />
    </asp:DropDownList>
    &nbsp;
    Page 
    <asp:TextBox ID="txtGoToPage" runat="server" AutoPostBack="true" 
        OnTextChanged="GoToPage_TextChanged" CssClass="gotopage" />
    of
    <asp:Label ID="lblTotalNumberOfPages" runat="server" />
    &nbsp;
    <asp:Button ID="btnPrev" runat="server" CommandName="Page" Enabled="false" 
        ToolTip="Previous Page" CssClass="previous" OnClick="btnPrev_Click" />
    <asp:Button ID="btnNext" runat="server" CommandName="Page" ToolTip="Next Page" 
        CssClass="next" OnClick="btnNext_Click" />     

    <br />
    <br />    
    <asp:Button ID="btnExport" runat="server" Text="Export to Excel" 
        onclick="btnExport_ExportToExcel" />
    <asp:Button ID="btnImport" runat="server" Text="Import from Excel" onclick="btnImport_Click" />
    <br />
    <br />
         
    <asp:Button ID="btnSubmitOffer" runat="server" Text="Submit Offer" 
        Width="100px" onclick="btnSubmitOffer_Click" />  
    <asp:Button ID="btnToConsider" runat="server" Height="26px" Text="To Consider" OnClick="btnToConsider_Click" 
        Width="100px" />    
    <asp:Button ID="btnMakeOffer" runat="server" Text="Make Offer"
        Width="100px" onclick="btnMakeOffer_Click" />  
    <asp:Button ID="btnPutOnHold" runat="server" Text="Put On Hold" Width="100px" 
        onclick="btnPutOnHold_Click" />
    <asp:Button ID="btnAssignTitle" runat="server" Text="Assign Title" Width="100px" onclick="btnAssignTitle_Click" />
    <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="100px"  onclick="btnCancel_Click" />
    
    <asp:Button ID="btnShowSubmitOfferPopup" runat="server" style="display:none" />
    <asp:Button ID="btnShowCancelPopup" runat="server" style="display:none" />
    <asp:Button ID="btnShowAssignTitlePopup" runat="server" style="display:none" />
    <asp:Button ID="btnShowPutOnHoldPopup" runat="server" style="display:none" />
    <asp:Button ID="btnShowImportPopup" runat="server" style="display:none" />

Open in new window

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
tantormediaAuthor Commented:
It is about pnlImport.
0
 
masterpassCommented:
can you tell the what caused it to break ? you told about some double click in grid .. can you point out where it is ?
0
 
tantormediaAuthor Commented:
In .ascx that I attached above, I added
OnRowCommand="FrontListGridView_RowCommand" OnRowUpdating="FrontListGridView_RowUpdating"
to the GridView.
Also, I replaced
                 <asp:BoundField DataField="EAN" HeaderText="EAN" SortExpression="EAN" />
with
                 <asp:TemplateField HeaderText="EAN" SortExpression="EAN">
                    <ItemTemplate>
                        <asp:Label ID="lblEAN" runat="server" Text='<%# Eval("EAN") %>'></asp:Label>
                        <asp:TextBox ID="EAN" runat="server" Text='<%# Eval("EAN") %>' visible="false" CssClass="ssTextBox"></asp:TextBox>
                    </ItemTemplate>
                    <ItemStyle CssClass="ssCell" />                    
                </asp:TemplateField>

In ascx.cs, added to FrontListGridView_RowDataBound:

                // Get the LinkButton control in the first cell
                LinkButton _doubleClickButton = (LinkButton)e.Row.Cells[2].Controls[0];
                // Get the javascript which is assigned to this LinkButton
                string _jsDouble = Page.ClientScript.GetPostBackClientHyperlink(_doubleClickButton, "");

                // If the page contains validator controls then call
                // Page_ClientValidate before allowing a cell to be edited
                if (Page.Validators.Count > 0)
                    _jsDouble = _jsDouble.Insert(11, "if(Page_ClientValidate())");

                // Add events to each editable cell
                for (int columnIndex = _firstEditCellIndex; columnIndex < e.Row.Cells.Count; columnIndex++)
                {
                    // Add the column index as the event argument parameter
                    string js = _jsDouble.Insert(_jsDouble.Length - 2, columnIndex.ToString());
                    // Add this javascript to the onclick Attribute of the cell
                    e.Row.Cells[columnIndex].Attributes["onclick"] = js;
                    // Add a cursor style to the cells
                    e.Row.Cells[columnIndex].Attributes["style"] += "cursor:pointer;cursor:hand;";
                }
0
 
masterpassCommented:
This is totally strange ... Any how can you set EnableModelValidation="false" for the gridview ?
0
 
tantormediaAuthor Commented:
I did, but I doesn't help.
0
 
masterpassCommented:
The problem is the custom validator given below

It will fire for every event because it has a server side event written and you have not specifies a validation group, you will have to add some validation group so that it does affect the gridview server side validations  
<asp:CustomValidator ID="CustomError" runat="server" onservervalidate="Custom_ServerValidate"
        ControlToValidate="txtFilterValue" ErrorMessage="Populated Dynamically" ValidationGroup="filter">* </asp:CustomValidator>    
    <asp:Button ID="btnFilter" runat="server" Text="Search" OnClick="btnFilter_OnClick" ValidationGroup="filter"/>

Open in new window

0
 
tantormediaAuthor Commented:
Unfortunately, that didn't help, either. It is not CustomError validator that fires when I click on the GridView, but importFilePathRequiredFieldValidator, which has a group.
0
 
tantormediaAuthor Commented:
Thanks!
0
All Courses

From novice to tech pro — start learning today.