Each cell in a GridBinaryImageColumn contains an image streamed from a binary image source field (specified through the DataField property of the column). When used this column will show a RadBinaryImage control in view mode and RadUpload in edit mode to upload an image. The image will be sized automatically to ImageHeight and ImageWidth pixel values if the ResizeMode property of the column is different than None. Possible values for the ResizeMode property of the column are:
- Crop (the image will be trimmed)
- Fit (the image will be sized to fit the given dimensions)
- None (default)
Additionally, you can set the DataAlternateTextField property to specify by which field in the grid source the column will be sorted/filtered. For the filtering you must also set explicitly the DataType property of the column to the type of the field specified through the DataAlternateTextField property (System.String in the common case). You can also apply format using the DataAlternateTextFormatString property.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class GridBinaryImageColumn : GridEditableColumn, IStateManager, IComparable, IGridEditableColumn, IGridDataColumn
Inheritance: objectGridColumnGridEditableColumnGridBinaryImageColumn
Implements:
Inherited Members
Constructors
public GridBinaryImageColumn()
Properties
Gets or sets a string, specifying the text which will be shown as alternate text to the image
public virtual string AlternateText { get; set; }
Specifies if the HTML image element's dimensions are inferred from image's binary data
public bool AutoAdjustImageControlSize { get; set; }
Gets or sets a string, representing the DataField name from the data source, which will be used to supply the alternateText for the image in the column. This text can further be customized, by using the DataTextFormatString property.
public virtual string DataAlternateTextField { get; set; }
A string, representing the DataField name from the data source, which will be used to supply the alternate text for the image in the column.
Gets or sets a string, specifying the format string, which will be used to format the alternate text of the image, rendered in the cells of the column.
public virtual string DataAlternateTextFormatString { get; set; }
A string, specifying the format string, which will be used to format the text of the hyperlink, rendered in the cells of the column.
Gets or sets the field name from the specified data source to bind to the GridBinaryImageColumn.
public virtual string DataField { get; set; }
A string, specifying the data field from the data source, from which to bind the column.
Gets or sets a url, specifying the location of a default image which to be loaded if there is no data for the binary image
public string DefaultImageUrl { get; set; }
Gets or sets the ImageAlign property for each cell.
public virtual ImageAlign ImageAlign { get; set; }
The ImageAlign property for each cell.
Gets or sets the height of the image
public Unit ImageHeight { get; set; }
Gets or sets the width of the image
public Unit ImageWidth { get; set; }
This property is supposed for developers of new grid columns. It gets whether a column is currently ReadOnly. The ReadOnly property determines whether a column will be editable in edit mode. A column for which the ReadOnly property is true will not be present in the automatically generated edit form.
public override bool IsEditable { get; }
A boolean value, indicating whether a specific column is editable.
Overrides:
Gets or sets a value indicating if the binary that will be persisted when editing. Setting the value to true will pass the old binary image data to the data source so the image could be persisted and not deleted.
public virtual bool PersistBinaryDataOnEdit { get; set; }
Gets or sets the ResizeMode property for each cell.
public virtual BinaryImageResizeMode ResizeMode { get; set; }
The ResizeMode property for each cell.
Get or set the name of the file which will appear inside of the SaveAs browser dialog
public virtual string SavedImageName { get; set; }
Should override if sorting will be disabled
protected override bool Sortable { get; }
Overrides:
Gets or sets a value indicating what type of upload control will be initialized during edit. (Default value = RadUpload)
public virtual GridUploadControlType UploadControlType { get; set; }
Methods
Creates a copy of the current column.
public override GridColumn Clone()
Overrides:
Note: When implementing/overriding this method be sure to call the base member or call CopyBaseProperties to be sure that all base properties will be copied accordingly
protected override void ColumnEditorChange(IGridColumnEditor newValue)
Overrides:
protected override void CopyBaseProperties(GridColumn fromColumn)
Overrides:
protected override IGridColumnEditor CreateDefaultColumnEditor()
Overrides:
Extracts the values from the editedItem and fills the names/values pairs for each data-field edited by the column in the newValues dictionary.
public override void FillValues(IDictionary newValues, GridEditableItem editableItem)
dictionary to fill. This param should not be null (Nothing in VB.NET)
editableItemGridEditableItemthe GridEditableItem to extract values from
Overrides:
protected virtual void OnCellDataBinding(object sender, GridCellDataBoundEventArgs args)
This method should be used in case you develop your own column. It returns true if the column supports filtering.