Comparing Cell value of gridview with textbox value
<p>I have a gridview with 6 columns
<code>(SAPUserID ,SAPDescription,SAPPassword,OSUserID,OSDescription,OSPassword)</code> and a <code>CHANGE PASSWORD</code> button. After clicking this button the panel (<code>pnlChangePwd</code>) below the grid view becomes visible containing 3 textboxes<code>(User ID, New Password, Confirm Password)</code> and a <code>Save</code> button.At present if I type new password same as old one, It accepts. How to compare the value in <code>txtNewPassword</code> with cell value of SAPPassword or OSPassword in grid view?</p>

<p>Note: at a time only 3 columns are visible depending upon the data user want(SAP or OS )</p>

<p>Code for Grid view:</p>

<pre><code>&lt;asp:GridView runat="server" ID="gvPassInfo" AutoGenerateColumns="false" 
                          CellPadding="4" ForeColor="#333333" GridLines="Both" DataKeyNames="user_id" 
                          CssClass="Gridview"  OnRowEditing="gvPassInfo_RowEditing"
                          OnRowCommand="gvPassInfo_RowCommand"  OnRowDataBound="gvPassInfo_RowDataBound"&gt;
                &lt;RowStyle BackColor="#EFF3FB" /&gt;
                &lt;Columns&gt;                                       
                    &lt;asp:TemplateField HeaderText="User ID" Visible="false"&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:Label ID="lblSAPUserId" runat="server"&gt;
                            &lt;/asp:Label&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;

                    &lt;asp:TemplateField HeaderText="User ID" Visible="false"&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:Label ID="lblOSUserId" runat="server"&gt;
                            &lt;/asp:Label&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;

                    &lt;asp:TemplateField HeaderText="Description" Visible="false"&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:Label ID="lblSAPDescription" runat="server"&gt;
                            &lt;/asp:Label&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;

                    &lt;asp:TemplateField HeaderText="Description" Visible="false"&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:Label ID="lblOSDescription" runat="server"&gt;
                            &lt;/asp:Label&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;

                    &lt;asp:TemplateField HeaderText="Password" Visible="false"&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:Label ID="lblSAPPassword" runat="server"&gt;
                            &lt;/asp:Label&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;

                    &lt;asp:TemplateField HeaderText="Password" Visible="false"&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:Label ID="lblOSPassword" runat="server"&gt;
                            &lt;/asp:Label&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;

                    &lt;asp:TemplateField HeaderText="Change Password"&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:ImageButton ID="ImgBtnChangePass" runat="server" ImageUrl="~/images/PW.jpg" CausesValidation="false"
                                             CommandName="Edit" /&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;


                &lt;/Columns&gt;
                &lt;FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
                &lt;PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /&gt;
                &lt;SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /&gt;
                &lt;HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
                &lt;EditRowStyle BackColor="#2461BF" /&gt;
                &lt;AlternatingRowStyle BackColor="White" /&gt;
            &lt;/asp:GridView&gt;
</code></pre>
