Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Document Tpye Custom Filter View modes: 
User avatar
Member
Member
paul.truman-sunmed.co - 9/21/2012 9:30:35 AM
   
Document Tpye Custom Filter
Hi, I've been trying to adapt the 'custom filter' code on your site to work with a custom document type I have created. Instead of it filtering by Department (as it does in your example), I would like to populate the dropdown menu with a field (EventCode) from my custom document type table (custom.course). Does anyone know how I need to change the code below in order to do this? I've spent days trying different things and have gotten no-where :o(


private void InitializeDepartments()
{
// Get all product departments
DataSet departments = DepartmentInfoProvider.GetDepartments("", "DepartmentDisplayName", 0, "DepartmentID, DepartmentDisplayName");


// Check if there are any product departments
if (!DataHelper.DataSourceIsEmpty(departments))
{
// Bind deparments to the drop-down list
this.drpDepartment.DataSource = departments;
this.drpDepartment.DataTextField = "DepartmentDisplayName";
this.drpDepartment.DataValueField = "DepartmentID";


this.drpDepartment.DataBind();


// Add default '(all)' value
this.drpDepartment.Items.Insert(0, new ListItem("(all)", "##ALL##"));
}
}

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/23/2012 8:49:39 AM
   
RE:Document Tpye Custom Filter
Hi,

you can use custom table apito get custom table values. Then you can bind them with dropdown list.

Then you can follow the department filter tutorial, but modify where condition according to your custom documet type fields.

Best regards,
Ivana Tomanickova