Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have gridview with 100 rows in item template.
Example user want to fill one row (item,quantity,amount) etc. and if item column is empty then show alert box with row no item can't be empty.
Posted

You need to convert the fields into template fields and apply validator thus Adding Validation Controls to the Editing Interface[^].

Try!
 
Share this answer
 
hi............

I have following solution for which in javascript.you can call this code on button submit or any other event.


JavaScript
<pre lang="Javascript">
C#
var inputListUnit = document.getElementById('gridName').getElementsByTagName("input");
    for (var i = 0; i < document.getElementById('grvUnit').rows.length; i++) {
        if (inputListUnit[i].type == "text") {
            if (document.getElementById(inputListUnit[i].id).value =='') {
                alert('item can't be empty')
            }
        }
    }



I hope it helps you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900