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
Peter Dzuya
NA
313
41k
Traversing through Rows in a grid
Aug 31 2016 2:50 PM
Hi All,
I wish to sum up all credits that I have already filtered in a grid. I have written this code as shown below:-
DevExpress.XtraGrid.Columns.GridColumn col = View.Columns.ColumnByFieldName("Credit");
if (col == null)return;
View.BeginSort();
try
{
int dataRowCount = View.DataRowCount;
for (int i = 0; i < dataRowCount; i++)
{
object cellValue = View.GetRowCellValue(i, col);
decimal totalcredit = Convert.ToDecimal(cellValue);
barEditItemCredit.EditValue += totalcredit;
}
}finally{
View.EndSort();
}
when I run the program, I get the below exception.
Cannot apply operator "+=" to operands of type 'Object' and 'Decimal'
Please assist.
Thanks
Peter
Reply
Answers (
2
)
object to comma seperated string
Twilio Outgoing calls using Web API