Hi All,
In my datagrid I want to use a template column as a hyperlink.
But I need to convert a database column value from a date to a single digit representing the day number. So I want to use the WEEKDAY date function as the data is being bound but I keep getting a compulation error where the binding is being done.
<Columns>
<asp:templatecolumn>
<headertemplate>
Day
</headertemplate>
<itemtemplate>
<a href='3-PopupMain.aspx?DOW=<%# DataBinder.Eval(weekday((Container.DataItem, "Date_of_Week"),FirstDayOfWeek.Monday))
%>'>
<b>
<%# DataBinder.Eval(Container.DataItem, "Day")
%>
</b>
</a>
</itemtemplate>
</asp:templatecolumn>
<asp:BoundColumn DataField="day" ReadOnly="True" HeaderText="Day"></asp:BoundColumn>
<asp:BoundColumn DataField="TotalTime" ReadOnly="True" HeaderText="Total Time"></asp:BoundColumn>
<asp:BoundColumn DataField="TotalExpenses" ReadOnly="True" HeaderText="Total out of Pocket"></asp:BoundColumn>
</Columns>
In my datagrid I want to use a template column as a hyperlink.
But I need to convert a database column value from a date to a single digit representing the day number. So I want to use the WEEKDAY date function as the data is being bound but I keep getting a compulation error where the binding is being done.
<Columns>
<asp:templatecolumn>
<headertemplate>
Day
</headertemplate>
<itemtemplate>
<a href='3-PopupMain.aspx?DOW=<%# DataBinder.Eval(weekday((Container.DataItem, "Date_of_Week"),FirstDayOfWeek.Monday))
%>'>
<b>
<%# DataBinder.Eval(Container.DataItem, "Day")
%>
</b>
</a>
</itemtemplate>
</asp:templatecolumn>
<asp:BoundColumn DataField="day" ReadOnly="True" HeaderText="Day"></asp:BoundColumn>
<asp:BoundColumn DataField="TotalTime" ReadOnly="True" HeaderText="Total Time"></asp:BoundColumn>
<asp:BoundColumn DataField="TotalExpenses" ReadOnly="True" HeaderText="Total out of Pocket"></asp:BoundColumn>
</Columns>