Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Top N product by sales View modes: 
User avatar
Member
Member
charize - 10/19/2010 6:42:48 AM
   
Top N product by sales
Hi,

I am trying to add the property layout with Repeat Columns,Repeat Directions and Repeat Layout in CMSWebParts\Ecommerce\Products\TopNProductsBySales.ascx.cs but when clicking on the webpart's properties i can't see the customized Document property. Can you tell me if there is something missing in my code?



 
/// <summary>
/// Gets or sets the count of repeat columns
/// </summary>
public int RepeatColumns
{
get
{
return ValidationHelper.GetInteger(GetValue("RepeatColumns"), this.lstElem.RepeatColumns);
}
set
{
this.SetValue("RepeatColumns", value);
this.lstElem.RepeatColumns = value;
}
}

/// <summary>
/// Gets or sets whether control is displayed in a table or flow layout
/// </summary>
public RepeatLayout RepeatLayout
{
get
{
return CMSDataList.GetRepeatLayout(DataHelper.GetNotEmpty(GetValue("RepeatLayout"), this.lstElem.RepeatLayout.ToString()));
}
set
{
this.SetValue("RepeatLayout", value.ToString());
this.lstElem.RepeatLayout = value;
}
}

/// <summary>
/// Gets or sets whether DataList control displays vertically or horizontally
/// </summary>
public RepeatDirection RepeatDirection
{
get
{
return CMSDataList.GetRepeatDirection(DataHelper.GetNotEmpty(GetValue("RepeatDirection"), this.lstElem.RepeatDirection.ToString()));
}
set
{
this.SetValue("RepeatDirection", value.ToString());
this.lstElem.RepeatDirection = value;
}
}

/// <summary>
/// Gets or sets the columns to get
/// </summary>
public string Columns
{
get
{
return DataHelper.GetNotEmpty(GetValue("Columns"), this.lstElem.Columns);
}
set
{
this.SetValue("Columns", value);
this.lstElem.Columns = value;
}
}

/// <summary>
/// Initializes the control properties
/// </summary>
protected void SetupControl()
{
if (this.StopProcessing)
{
this.lstElem.StopProcessing = true;
}
else
{

this.lstElem.ControlContext = this.ControlContext;

// System settings
this.lstElem.CacheItemName = this.CacheItemName;
this.lstElem.CacheDependencies = this.CacheDependencies;
this.lstElem.CacheMinutes = this.CacheMinutes;
this.lstElem.CheckPermissions = this.CheckPermissions;

// Document properties
this.lstElem.SiteName = this.SiteName;
this.lstElem.ClassNames = this.ClassNames;
this.lstElem.Path = this.Path;
this.lstElem.Columns = this.Columns;
this.lstElem.MaxRelativeLevel = this.MaxRelativeLevel;
this.lstElem.SelectOnlyPublished = this.SelectOnlyPublished;
this.lstElem.CombineWithDefaultCulture = this.CombineWithDefaultCulture;
this.lstElem.CultureCode = this.CultureCode;

this.lstElem.SelectTopN = this.SelectTopN;
this.lstElem.WhereCondition = GetWhereCondition(this.WhereCondition);
this.lstElem.OrderBy = GetOrderByExpression(this.OrderBy);

// Transformations
this.lstElem.AlternatingTransformationName = this.AlternatingTransformationName;
this.lstElem.TransformationName = this.TransformationName;

//// Public
this.lstElem.HideControlForZeroRows = this.HideControlForZeroRows;
this.lstElem.ZeroRowsText = this.ZeroRowsText;
this.lstElem.RepeatColumns = this.RepeatColumns;
this.lstElem.RepeatLayout = this.RepeatLayout;
this.lstElem.RepeatDirection = this.RepeatDirection;

}
}



User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/26/2010 5:33:35 AM
   
RE:Top N product by sales
Hi,

Could you please confirm that you have added these properties also to Site Manager -> Development -> web parts -> your web part -> Properties section?

Developing web parts - step 12.

Best regards,
Juraj Ondrus