I would like to use a GridCalculatedColumn in conjunction with GridTemplateColumns. However, all of the samples on the Telerik Demo site utilize GridBoundColumns in conjunction with GridCalculatedColumns. I do not believe that I will be able to use a GridBoundColumn since I am binding to a collection of objects like so:
When I display the columns in the GridView, I use the following syntax:
Is there a way to utilize the GridCalculatedColumn to sum up the value in the GridTemplateColumn for Cost?
Thanks.
List<SelectedCourse> lstSelectedCourses =
this
.SelectedCourses;
//Bind the GridView schedule
gvSchedule.DataSource = lstSelectedCourses;
gvSchedule.DataBind();
When I display the columns in the GridView, I use the following syntax:
<
columns
>
<
telerik:gridtemplatecolumn
>
<
itemtemplate
>
<
asp:hiddenfield
id
=
"hfCourseID"
value='<%#Eval("CourseID") %>' runat="server" />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"Category"
>
<
itemtemplate
>
<
asp:label
id
=
"lblCategory"
runat
=
"server"
text='<%#Eval("Category") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"Subject"
>
<
itemtemplate
>
<
asp:label
id
=
"lblSubject"
runat
=
"server"
text='<%#Eval("Subject") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"Days"
>
<
itemtemplate
>
<
asp:label
id
=
"lblDays"
runat
=
"server"
text='<%#Eval("Days") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"Start Time"
>
<
itemtemplate
>
<
asp:label
id
=
"lblStartTime"
runat
=
"server"
text='<%#Eval("StartTime") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"End Time"
>
<
itemtemplate
>
<
asp:label
id
=
"lblEndTime"
runat
=
"server"
text='<%#Eval("EndTime") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"Term"
>
<
itemtemplate
>
<
asp:label
id
=
"lblTerm"
runat
=
"server"
text='<%#Eval("Term") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"Length (Weeks)"
>
<
itemtemplate
>
<
asp:label
id
=
"lblCourseLength"
runat
=
"server"
text='<%#Eval("CourseLength") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"Location"
>
<
itemtemplate
>
<
asp:label
id
=
"lblLocation"
runat
=
"server"
text='<%#Eval("Location") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
<
telerik:gridtemplatecolumn
headertext
=
"Cost"
>
<
itemtemplate
>
<
asp:label
id
=
"lblCourseCost"
runat
=
"server"
text='<%#Eval("Cost", "{0:C}") %>' />
</
itemtemplate
>
</
telerik:gridtemplatecolumn
>
</
columns
>
Is there a way to utilize the GridCalculatedColumn to sum up the value in the GridTemplateColumn for Cost?
Thanks.