Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Talk to Webmaster
Tony John
Facebook
Google+
Twitter
LinkedIn
Online Members
Migbar
Abul Bashar Sardar
Shine S
More...
Join our online
Google+ community
for Bloggers, Content Writers and Webmasters
Forums
»
.NET
»
ASP.NET
»
Specified argument was out of the range of valid values
Posted Date:
17 Jul 2012
Posted By::
Mahesh Ramgari
Member Level:
Bronze
Member Rank:
3001
Points
: 3
Responses:
3
for (i = 0; i < Table1.Rows.Count; i++)
{
TextBox t1 = new TextBox();
t1 = (TextBox)Table1.Rows[i].Cells[3].Controls[0];
}
when i am writing the above code, that time i am getting "Specified argument was out of the range of valid values" this type of error. in the Table1 have 3000 row values. how to get row wise cell values.
Tweet
Responses
#680713 Author:
jogesh
Member Level:
Gold
Member Rank:
229
Date: 17/Jul/2012 Rating:
Points
: 2
Your code looks fine, i think problem is with the data.
for (i = 0; i < Table1.Rows.Count; i++)
{
TextBox t1 = new TextBox();
t1 = (TextBox)Table1.Rows[i].Cells[3].Controls[0];
}
In the above code, check if you have 4 cells for each row and each cell has at least one control.
#680764 Author:
Sunitha
Member Level:
Silver
Member Rank:
883
Date: 17/Jul/2012 Rating:
Points
: 2
your code is correct, but verify the column index. (Cells[3] means it is 4th column. So verify which column index you have given)
Hope this may be the reason for getting that error.
Regards,
Sunitha
#680770 Author:
sreeraj
Member Level:
Bronze
Member Rank:
4239
Date: 17/Jul/2012 Rating:
Points
: 2
for (i = 1; i <= Table1.Rows.Count; i++)
{
TextBox t1 = new TextBox();
t1 = (TextBox)Table1.Rows[i].Cells[3].Controls[0];
}
Try this..row index starts from 1..
i m not sure...just try it
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Tweet
Next :
How to set themes dynamically for different User in .Net..?
Previous :
How can we use previous page postback property.
Return to Discussion Forum
Post New Message
Category:
Related Messages
Validation Controls
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
Follow us on Twitter:
https://twitter.com/dotnetspider
Active Members
Today
Asheej T K
(18)
Danasegarane.A
(16)
Rakesh Chaubey
(16)
Last 7 Days
baskar
(315)
Asheej T K
(228)
Rakesh Chaubey
(196)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
About Us
Contact Us
Copyright
Privacy Policy
Terms Of Use
Revenue Sharing sites
Advertise
Talk to
Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.