GridView not Display Name [modified]
-
Respected, Sir, My GridView do not display name in template field my code as your reference is : Text='<%# GetClassName(DataBinder.Eval(Container.DataItem,"CLASSID")) %>' I am calling a function for name by passing ID and display in template field class but it can not work. please help me. Thanks.
modified on Tuesday, January 26, 2010 5:31 AM
-
Respected, Sir, My GridView do not display name in template field my code as your reference is : Text='<%# GetClassName(DataBinder.Eval(Container.DataItem,"CLASSID")) %>' I am calling a function for name by passing ID and display in template field class but it can not work. please help me. Thanks.
modified on Tuesday, January 26, 2010 5:31 AM
For this kind of issue i must suggest you use : RowDatabound event of the grid view and do the code hope below thing work for you public void sumRows ( Object src, GridViewRowEventArgs e ) { if ( e.Row.RowType == DataControlRowType.DataRow ) { TableCellCollection cells = e.Row.Cells; int priceTotal = Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _ "UnitPrice")) //do code to assign value to columns of the grid } }
-
For this kind of issue i must suggest you use : RowDatabound event of the grid view and do the code hope below thing work for you public void sumRows ( Object src, GridViewRowEventArgs e ) { if ( e.Row.RowType == DataControlRowType.DataRow ) { TableCellCollection cells = e.Row.Cells; int priceTotal = Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _ "UnitPrice")) //do code to assign value to columns of the grid } }
Thanks For replay