New to Telerik UI for WPFStart a free 30-day trial

Converts an available width value to a column count for layouts such as .

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
public class WidthToColumnsConverter : IValueConverter

Inheritance: objectWidthToColumnsConverter

Implements: IValueConverter

Constructors

C#
public WidthToColumnsConverter()

Methods

Converts an available width to a column count. The optional converter parameter specifies the minimum desired item width.

C#
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Parameters:valueobject

The available width.

targetTypeType

The type of the binding target property.

parameterobject

Optional minimum desired item width.

cultureCultureInfo

The culture to use in the converter.

Returns:

object

The calculated number of columns, always at least 1.

Not supported. Throws NotSupportedException.

C#
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Parameters:valueobjecttargetTypeTypeparameterobjectcultureCultureInfoReturns:

object