Grid should not contain duplicate selctedItem of dropdownlist using Jquery
<p>I have a GridView which contains multiple rows. One of the columns contains a dropdownlist which in turn contains multiple items. I just want to validate that every ddl of each row should contain a unique value.
          To achieve this i have written a Jquery code. But i am finding a better solution. My code is as follows:</p>

<pre><code>function gvDDLValidation() {
            var gvDetDDLs = $("#gvDetails").find("select[id*='ddlGrade']");
            $.each(gvDetDDLs, function () {
                var duplicateExists = false;
                var currVal = $(this).val();
                gvDetDDLs.not(this).each(function () {
                    if ($(this).val() == currVal) {
                        duplicateExists = true;
                        alert("Duplicate entry is not allowed");
                        $(this).focus();
                        return false;
                    }
                });
                if (duplicateExists) {
                    return false;
                }
            });
            return true;
        }
</code></pre>
