473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

validate input in datagrid

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
1 1499
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MG | last post by:
The following below is Microsoft sample to validate a XML document. My question is how can I put the validate errors in DataGrid? Using the ValidationEventHandle subroutine and adding ListBox...
5
by: sjl | last post by:
I've got an .aspx webform for searching my database. It basically takes user input and passes it as a parm into a stored proc to search a table. The results are returned in a SQLDataReader and...
0
by: suresh | last post by:
How to validate input with datagrid control? i tried the following code from msdn...i have problem in adding handler to the columnchanging event..its not working for me? any bug in this code? is...
0
by: Marina | last post by:
Let's say a user control has a bunch of textboxes. At some point the user control calls Validate to make sure all input is processed. The Validating event is fired, and if the input was invalid,...
11
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function...
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
1
by: mbarnhizer | last post by:
Hello All, Trying to figure out how to validate a series of questions on an online test. I am thinking that VB or Javascript is the best route, but your input may make a difference. The site i...
2
by: poops2468 | last post by:
Sorry if this is a totally newbie question, but I haven't found a decent answer. I am using VS 2008. I have a DataGridView on a Windows Form. First, I want to validate that the input in the...
10
mariodavi
by: mariodavi | last post by:
Hi everybody, how to validate input text in the follow: if option combo = 1,2 e 3, input 1 and input 2 must be filled, if one of this values not selected in combo (to be others), filled input...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.