TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shovan Saha
NA
321
92.6k
Please check my code
Sep 17 2017 10:54 AM
If any of row.Cells[2] or [3] is null then how can I edit this? :
if (_product.Where(x => x.Type.ToLower() == row.Cells[0].Value.ToString().ToLower()).Any())
{
string TotalQty = (Convert.ToInt32(_product.Where(x => x.Type.ToLower() == row.Cells[0].Value.ToString().ToLower()).Select(x => x.TotalQty).FirstOrDefault()) + Convert.ToInt32(row.Cells[3].Value.ToString())).ToString();
string TotalPrice = (Convert.ToInt32(_product.Where(x => x.Type.ToLower() == row.Cells[0].Value.ToString().ToLower()).Select(x => x.TotalPrice).FirstOrDefault()) + Convert.ToInt32(row.Cells[2].Value.ToString())).ToString();
_product.Where(x => x.Type.ToLower() == row.Cells[0].Value.ToString().ToLower()).ToList().ForEach(x => { x.TotalQty = TotalQty; x.TotalPrice = TotalPrice; });
}
Reply
Answers (
2
)
how can read command argument value read with jquery & print
null/empty value problem