By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,854 Members | 876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,854 IT Pros & Developers. It's quick & easy.

validate input in datagrid

P: n/a
Hell

My problem is that I do not know how to validate input that I let the user type into my datagrid
In one grid I let the user to type in a value into a template column - how do I make sure that this input is an integer on the client sid
In a diffrent grid I have an edit command column and the same problem - how do I make sure that this is an integer on the client sid

Any suggestion

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
you access the table created by the datagrid. loop thru the elements and
access it.
write a javascript like follows..

// to access the rows in the table
var iRows = document.all("tablename").rows;
var oCell;
var columnNumber = 0; // your column number in which the control to validate
exists.
for(var iIndex=1; iIndex < iRows.length; iIndex++)
{
oCell = iRows[iIndex].cells[columnNumber];
alert(oCell.all[indextoyourcontrol]); // check and get the index for
your control to validate.
}

hth,
Av.

"mats" <an*******@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
Hello

My problem is that I do not know how to validate input that I let the user
type into my datagrid.
In one grid I let the user to type in a value into a template column - how
do I make sure that this input is an integer on the client side
In a diffrent grid I have an edit command column and the same problem -
how do I make sure that this is an integer on the client side

Any suggestions

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.