ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Check for duplicate Column value before adding new row to ASP.Net GridView using jQueryHi @RumeValid,<br />Please try the following<br /><br /><a href = 'link(Threads/141874/How-to-calculate-number-input-by-each-row-in-gridview/)'>How to calculate number input by each row in gridview</a><br /><br />It might help you.<br /><br />Cheers Andrea.https://www.aspforums.net:443/Threads/893798/Check-for-duplicate-Column-value-before-adding-new-row-to-ASPNet-GridView-using-jQuery/https://www.aspforums.net:443/Threads/893798/Check-for-duplicate-Column-value-before-adding-new-row-to-ASPNet-GridView-using-jQuery/Thu, 25 Apr 2019 03:09:31 GMTCheck for duplicate Column value before adding new row to ASP.Net GridView using jQuery<p>Hi <a class="username" rel="RumeValid"> RumeValid</a>,</p> <p>I will get back soon.</p>https://www.aspforums.net:443/Threads/893798/Check-for-duplicate-Column-value-before-adding-new-row-to-ASPNet-GridView-using-jQuery/https://www.aspforums.net:443/Threads/893798/Check-for-duplicate-Column-value-before-adding-new-row-to-ASPNet-GridView-using-jQuery/Thu, 25 Apr 2019 03:26:45 GMTCheck for duplicate Column value before adding new row to ASP.Net GridView using jQuery<p>I am working on it, I will get back tomorrow.</p>https://www.aspforums.net:443/Threads/893798/Check-for-duplicate-Column-value-before-adding-new-row-to-ASPNet-GridView-using-jQuery/https://www.aspforums.net:443/Threads/893798/Check-for-duplicate-Column-value-before-adding-new-row-to-ASPNet-GridView-using-jQuery/Thu, 25 Apr 2019 08:31:10 GMTCheck for duplicate Column value before adding new row to ASP.Net GridView using jQuery<p>Hi&nbsp; <a class="username" rel="RumeValid"> RumeValid</a>,</p> <p>Refer below link to validate your fields according to checked checkbox, And refer below sample.</p> <h1 class="header"><a class="title f16" href="https://www.aspforums.net:443/Threads/647270/Enable-Disable-TextBox-controls-in-GridView-Row-when-CheckBox-Checked-Unchecked-using-JavaScript-and-jQuery-in-ASPNet/">Enable Disable TextBox controls in GridView Row when CheckBox Checked Unchecked using JavaScript and jQuery in ASP.Net</a></h1> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <pre class="brush: html">&lt;script type=&#34;text/javascript&#34; src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { var gridView = $(&#34;[id*=grdnok]&#34;); var row = gridView.find(&#34;tr&#34;).eq(1).clone(); $(&#34;[id*=grdnok]&#34;).find(&#34;[id*=btnAddRow_kin]&#34;).click(function () { var index = $(this).closest(&#34;tr&#34;)[0].rowIndex - 2; if (index == 0) { addRows(gridView, row); } else { var tr = gridView.find(&#34;tr&#34;); var currentVal = gridView.find(&#34;tr:last&#34;).prev().find(&#34;#txtkinphone&#34;).val() var isvalid = true; for (var i = 1; i &lt; tr.length - 2; i++) { var input = $(tr[i]).find(&#39;#txtkinphone&#39;); if (currentVal == $(input).val()) { isvalid = false; alert(&#34;Contact Number Should be Unique.&#34;); break; } } if (isvalid) { addRows(gridView, row); } } return false; }); }); function addRows(gridView, row) { var preindex = $(this).parent().parent().prev().find(&#34;td&#34;).eq(0).html(); $(&#34;&lt;tr&gt;&#34; + row.html() + &#34;&lt;/tr&gt;&#34;).insertBefore(gridView.find(&#34;tr:last&#34;)); $(this).parent().parent().prev().find(&#34;td&#34;).eq(0).html((parseInt(preindex) + 1)) } &lt;/script&gt; &lt;div&gt; &lt;asp:GridView ID=&#34;grdnok&#34; ClientIDMode=&#34;Static&#34; runat=&#34;server&#34; AutoGenerateColumns=&#34;False&#34; EmptyDataText=&#34;No Records&#34; ShowFooter=&#34;True&#34; Style=&#34;clear: both;&#34;&gt; &lt;Columns&gt; &lt;asp:TemplateField HeaderText=&#34;S/n&#34; ItemStyle-Width=&#34;10px&#34;&gt; &lt;ItemTemplate&gt; &lt;span id=&#34;indxid&#34; class=&#34;indxno&#34;&gt; &lt;%# Container.DataItemIndex+ 1 %&gt;&lt;/span&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText=&#34;Name*&#34; ItemStyle-Width=&#34;150px&#34;&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID=&#34;txtkinname&#34; Width=&#34;150&#34; runat=&#34;server&#34; Text=&#39;&lt;%# Eval(&#34;kinname&#34;) %&gt;&#39; /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText=&#34;Address&#34; ItemStyle-Width=&#34;250px&#34;&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID=&#34;txtkinaddr&#34; runat=&#34;server&#34; Width=&#34;250&#34; Text=&#39;&lt;%# Eval(&#34;kinaddr&#34;) %&gt;&#39; /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText=&#34;Phone&#34; ItemStyle-Width=&#34;150px&#34;&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID=&#34;txtkinphone&#34; Width=&#34;150&#34; runat=&#34;server&#34; Text=&#39;&lt;%# Eval(&#34;kinphone&#34;) %&gt;&#39; /&gt; &lt;/ItemTemplate&gt; &lt;FooterStyle HorizontalAlign=&#34;Right&#34; /&gt; &lt;FooterTemplate&gt; &lt;asp:Button ID=&#34;btnAddRow_kin&#34; runat=&#34;server&#34; Text=&#34;Add New Row&#34; /&gt; &lt;/FooterTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;/div&gt;</pre> <p><span style="text-decoration: underline;"><strong>Namespaces</strong></span></p> <p><strong>C#</strong></p> <pre class="brush: csharp">using System.Data;</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Imports System.Data </pre> <p><span style="text-decoration: underline;"><strong>Code</strong></span></p> <p><strong>C#</strong></p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.AddRange(new DataColumn[] { new DataColumn(&#34;kinname&#34;, typeof(string)), new DataColumn(&#34;kinaddr&#34;, typeof(string)), new DataColumn(&#34;kinphone&#34;, typeof(int))}); dt.Rows.Add(); this.grdnok.DataSource = dt; this.grdnok.DataBind(); }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim dt As DataTable = New DataTable() dt.Columns.AddRange(New DataColumn() {New DataColumn(&#34;kinname&#34;, GetType(String)), New DataColumn(&#34;kinaddr&#34;, GetType(String)), New DataColumn(&#34;kinphone&#34;, GetType(Integer))}) dt.Rows.Add() Me.grdnok.DataSource = dt Me.grdnok.DataBind() End Sub</pre> <p><span style="text-decoration: underline;"><strong>Screenshot</strong></span></p> <p><img src="https://imgur.com/nj6AagU.gif" alt="" width="574" height="269" /></p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/893798/Check-for-duplicate-Column-value-before-adding-new-row-to-ASPNet-GridView-using-jQuery/https://www.aspforums.net:443/Threads/893798/Check-for-duplicate-Column-value-before-adding-new-row-to-ASPNet-GridView-using-jQuery/Fri, 26 Apr 2019 00:54:14 GMT