Need a slight change to the My Digital Goods Page
Need a slight change to the My Digital Goods Page
How can I add an Order Date column to the My Digital Goods Page that posts the correct date for a particular order? I can get the column to come up, but I am having trouble getting the correct date to post. Adding an Order Number column would be helpful as well. Thanks for any help.
Re: Need a slight change to the My Digital Goods Page
Edit your ConLib/MyDigitalGoodsPage.ascx file and locate following code line
then update it as
Then edit ConLib/MyDigitalGoodsPage.ascx.cs file and add following method just above the last closing curly brace
You are done with changes so just go and test MyDigitalGoods page.
Code: Select all
</Columns>
Code: Select all
<asp:TemplateField HeaderText="Date" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<%#GetOrderDate(Container.DataItem)%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
Code: Select all
protected string GetOrderDate(Object dataItem)
{
OrderItemDigitalGood oidg = (OrderItemDigitalGood)dataItem;
return oidg.OrderItem.Order.OrderDate.ToShortDateString();
}
Re: Need a slight change to the My Digital Goods Page
Perfect! Thanks very much!
Re: Need a slight change to the My Digital Goods Page
Is there an easy way to include the Order Time with the Order Date? I have a column that shows when the key was posted with the time, but I can't seem to get the Order date column to show the time also. Thanks in advance for any help.
Re: Need a slight change to the My Digital Goods Page
Try adding one more column in grid like
Code: Select all
<asp:TemplateField HeaderText="Order Date" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="OrderDateLabel" runat="server" Text='<%#Eval("OrderItem.Order.OrderDate")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Re: Need a slight change to the My Digital Goods Page
That works. Thanks very much!