Hello!
I have a custom VisualItem "CustomVisualItem : IconListViewVisualItem" which belongs to a ListView with ViewType=IconsView.
The VisualItem consits of a StackLayoutPanel with 2 LightVisualElements (one is displaying a image and the other displays text).
The Datasource for the ListView is "List<CustomClass>".
Now I want to achieve the following:
- check if VisualItem is Databound to CustomClass
- when property "Disabled" of CustomClass is true then draw a red X over the VisualItem (a red line from Top-Left to Bottom-Right and one from Top-Right to Bottom-Left)
This is my current not working solution:
How can I place the red X (or the rectangle) over the VisuaItem?
I have a custom VisualItem "CustomVisualItem : IconListViewVisualItem" which belongs to a ListView with ViewType=IconsView.
The VisualItem consits of a StackLayoutPanel with 2 LightVisualElements (one is displaying a image and the other displays text).
The Datasource for the ListView is "List<CustomClass>".
Now I want to achieve the following:
- check if VisualItem is Databound to CustomClass
- when property "Disabled" of CustomClass is true then draw a red X over the VisualItem (a red line from Top-Left to Bottom-Right and one from Top-Right to Bottom-Left)
This is my current not working solution:
internal
class
CustomVisualItem : IconListViewVisualItem
{
protected
override
void
PaintElement(Telerik.WinControls.Paint.IGraphics graphics,
float
angle, SizeF scale)
{
base
.PaintElement(graphics, angle, scale);
var t =
this
.Data.DataBoundItem
as
CustomClass;
if
(t !=
null
)
{
if
CustomClass.Disabled)
{
//To shorten the sample, only draw a rectangle
graphics.FillRectangle(BoundingRectangle, Color.Silver);
// The rectangle is not placed over the VisualItem
}
}
}
}
How can I place the red X (or the rectangle) over the VisuaItem?