Our stock manager has asked if we can get a column of SKUs on the /Admin/Reports/LowInventory.aspx page.
It should be possible to get it in there, I was having trouble doing it though.
Can anyone help with this? Thanks.
SKUs in Low Inventory
- William_firefold
- Commander (CMDR)
- Posts: 186
- Joined: Fri Aug 01, 2008 8:38 am
Re: SKUs in Low Inventory
In order to do that first add following method to the report
and then add another column for Sku in InventoryGrid just below the Name column
This will make available another column showing the Sku of the product next to name column.
Code: Select all
public string GetSku(Object dataItem)
{
ProductInventoryDetail detail = (ProductInventoryDetail)dataItem;
Product product = ProductDataSource.Load(detail.ProductId);
return product.Sku;
}
Code: Select all
<asp:TemplateField HeaderText="Sku" >
<ItemTemplate>
<asp:HyperLink ID="ProductLink" runat="server" Text='<%# GetSku(Container.DataItem) %>' NavigateUrl='<%#Eval("ProductId", "../Products/EditProduct.aspx?ProductId={0}")%>'></asp:HyperLink>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
- William_firefold
- Commander (CMDR)
- Posts: 186
- Joined: Fri Aug 01, 2008 8:38 am
Re: SKUs in Low Inventory
Thanks mazhar!
You are the Able forums gladiator.
You are the Able forums gladiator.