I want to find out how many products are underneath that category. Can you be a helper ?

Unal UN asked on January 8, 2018 09:16

Hi am using Kentico 10

I want to find out how many products are underneath that category. Can you be a helper?

//Code Samples Not Working ! CustomTableItemProvider.GetItems("customtable.MyJoinCategory").Source(s => s.LeftJoin("customtable_MyJoinProduct", "ItemID", "CategoyID")).Column("Name,ProductName").AddColumn( new CountColumn("ItemID").As("ProductCount")).GroupBy("CategoyID").Result;

Recent Answers


Peter Mogilnitski answered on January 8, 2018 16:06

Is there any reason why you are not using Kentico categories?

0 votesVote for this answer Mark as a Correct answer

Unal UN answered on January 9, 2018 09:25

Hi Peter,

I am using the kentico API.

can you help me ?

0 votesVote for this answer Mark as a Correct answer

Unal UN answered on January 16, 2018 15:20

Thank you

I Solved

Code Samples

var CategoryAndProductCustomColumuns2 = CustomTableItemProvider.GetItems("customtable.MyJoinCategory").Source(s => s.LeftJoin("customtable_MyJoinProduct", "ItemID", "CategoryID")).Column("Name").AddColumn(new CountColumn("CategoryID").As("ProductCount")).GroupBy("CategoryID,Name").Result;

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.