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
Santosh Kumar
NA
126
60.3k
How to perform sum of all cells using linq and bind to grid
May 14 2013 5:47 AM
Hi,
I have a requirement. like....
Sname Marks Percentage
aa 50 50
aa 60 60
bb 80 80
bb 60 60
here i want to add marks and display percentage like below dynamically
Sname Marks Percentage
aa 50 50
aa 60 60
aa 110 55
bb 80 80
bb 60 60
bb 140 70
It should be done using the linq query I am using the follwing linq query which performs grouping for display.
List<Studentsmarkslist > mrksbrpby = (from n in lstmrks group n by new { n.StudentName,n.Total,n.Percentage } into g
orderby g.Key.StudentName
select new Studentsmarkslist { StudentName = g.Key.StudentName,
Total = g.Key.Total,
Percentage = g.Key.Percentage
}).ToList();
return mrksbrpby
Reply
Answers (
2
)
Insert, Update, Delete query using LINQ in datagridview (c#)
Linq Error