Page 1 of 1

Display product in grid

Posted: Thu Nov 20, 2008 12:37 am
by atulkhare
but if i want to display product in grid according to category id so which one i should have to use...currently i am using featured products grid for displaying products according to category.
but the problem with this is when i add any new product at that time i have to click 0n to featured check box....i am using
ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(0, true, this.Size);
is there any other way to do this same task?

Thanks and Regard
Atul khare

Re: Display product in grid

Posted: Thu Nov 20, 2008 2:21 am
by mazhar
Find out the product id for which you want to display the featured products and place the id in place of 0 in the following statement

Code: Select all

ProductList.DataSource = ProductDataSource.GetRandomFeaturedProducts(yourcategoryid, true, this.Size);

Re: Display product in grid

Posted: Thu Nov 20, 2008 3:35 am
by atulkhare
i am using
ProductList.DataSource = ProductDataSource.GetFeaturedProducts(int.Parse(Request.QueryString["cID"].ToString()), true);
instead of
productsDataSource.GetRandomfeaturedproducts(-,-,-)
is it correct or not?


Thanks And Regards
Atul khare

Re: Display product in grid

Posted: Thu Nov 20, 2008 3:42 am
by mazhar
Try the following code

Code: Select all

int categoryId = PageHelper.GetCategoryId();
ProductList.DataSource = ProductDataSource.GetFeaturedProducts(categoryId, true,8);
Where 8 is the size value you can provide your own size.