Hi,
I have a requirement to show a column congtaining waiting bar dot rings in a grid view.
I have the currentcode which defines the custom cell and also the custom column
//////////////////////////////////////
// custom cell
//////////////////////////////////////
public class WaitingDotsRingCellElement : GridDataCellElement
{
private RadWaitingBarElement waitingElement;
private DotsRingWaitingBarIndicatorElement ringElement;
public WaitingDotsRingCellElement ( GridViewColumn column, GridRowElement row )
: base ( column, row )
{
}
protected override void CreateChildElements ( )
{
base.CreateChildElements ();
ringElement = new DotsRingWaitingBarIndicatorElement ();
ringElement.DotRadius = 4;
ringElement.LastDotRadius = 1;
ringElement.Radius = 10;
ringElement.ElementCount = 8;
ringElement.NumberOfColors = 4;
ringElement.ElementColor = Color.Red;
waitingElement = new RadWaitingBarElement ();
waitingElement.WaitingIndicators.Clear ();
waitingElement.WaitingSpeed = 40;
waitingElement.WaitingStyle = WaitingBarStyles.DotsRing;
waitingElement.WaitingIndicators.Add (ringElement );
Children.Add ( waitingElement );
}
protected override void SetContentCore ( object value )
{
if ( Value != null && Value != DBNull.Value )
{
if ( Convert.ToInt32 ( Value ) == 0 )
{
waitingElement.StopWaiting ();
}
else if ( Convert.ToInt32 ( Value ) == 1 )
{
waitingElement.StartWaiting ();
}
}
}
public override bool IsCompatible ( GridViewColumn data, object context )
{
return data is WaitingDotsRingColumn && context is GridDataRowElement;
}
protected override Type ThemeEffectiveType
{
get
{
// Ensures the cell inherits grid cell styling
return typeof ( GridDataCellElement );
}
}
} // WaitingDotsRingCellElement
//////////////////////////////////////
// custom column
//////////////////////////////////////
public class WaitingDotsRingColumn : GridViewDataColumn
{
public WaitingDotsRingColumn(string fileName ) : base(fileName)
{
}
public override Type GetCellType ( GridViewRowInfo row )
{
if ( row is GridViewDataRowInfo )
{
return typeof ( WaitingDotsRingCellElement );
}
return base.GetCellType ( row );
}
} // WaitingDotsRingColumnMy issue is that the properties "radius" and "element count" are not being set correctly, however other properties such as element color are being set correctly.
My grid view row height is being set to 32 via gridView.TableElement.RowHeight
In addition, how do i get rid of the "button" effect appearing in the cell background?
Kind regards
Toby