Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB ASP.NET
i am trying for girdview where each row total is to be displayed

< gridview>

getprice(DataBinder.Eval(Container.DataItem, unit_price))



getqty(DataBinder.Eval(Container.DataItem, unit_qty))





unit_price unit_qty total
100 2 200

i am unable to get total as 200
please help how to rowbound each row and get the output total
Posted 1-Jan-13 23:51pm
Zafar Sultan at 2-Jan-13 7:37am
Post your complete aspx code for GridView.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Add an empty column in the grid,
after that on row bound event use the following code,
protected void gridView1_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
e.Row.Cells[10].Text = Convert.ToInt32(e.Row.Cells[8].Text) * Convert.ToInt32(e.Row.Cells[9].Text);
Comments at 2-Jan-13 6:49am
i tried but it says
{"Input string was not in a correct format."}
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Please take help from this link:[^]
may be it ll help you if not please let me know.
Prasad_Kulkarni at 3-Jan-13 2:00am
Link formatted.
nehas1jan at 3-Jan-13 2:05am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 476
1 Sergey Alexandrovich Kryukov 235
2 CHill60 195
3 Afzaal Ahmad Zeeshan 145
4 TheRealSteveJudge 120
0 Sergey Alexandrovich Kryukov 9,121
1 OriginalGriff 7,920
2 Peter Leow 4,774
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,176

Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100