private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
if (e.RowHandle >= 0)
{
// e.Painter.DrawCaption(new DevExpress.Utils.Drawing.ObjectInfoArgs(new DevExpress.Utils.Drawing.GraphicsCache(e.Graphics)), "As waarde", this.Font, Brushes.MidnightBlue, e.Bounds, null);
// e.Cache.DrawString("As waarde", this.Font, Brushes.MidnightBlue, e.Bounds, new StringFormat());
try
{
if (y_axisvalues.Length > 0)
{
if (y_axisvalues.Length > e.RowHandle)
{
string yvalue = y_axisvalues.GetValue((y_axisvalues.Length - 1) - e.RowHandle).ToString();
if (!m_isUpsideDown)
{
// dan andere waarde nemen
yvalue = y_axisvalues.GetValue(e.RowHandle).ToString();
}
if (m_viewtype == ViewType.Hexadecimal)
{
yvalue = Convert.ToInt32(/*y_axisvalues.GetValue(e.RowHandle)*/y_axisvalues.GetValue((y_axisvalues.Length - 1) - e.RowHandle)).ToString("X4");
}
else
{
yvalue = ConvertYAxisValue(yvalue);
}
//yvalue = (ConvertToDouble(yvalue) * m_Yaxiscorrectionfactor).ToString();
Rectangle r = new Rectangle(e.Bounds.X + 1, e.Bounds.Y + 1, e.Bounds.Width - 2, e.Bounds.Height - 2);
e.Graphics.DrawRectangle(Pens.LightSteelBlue, r);
System.Drawing.Drawing2D.LinearGradientBrush gb = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, e.Appearance.BackColor2, e.Appearance.BackColor2, System.Drawing.Drawing2D.LinearGradientMode.Horizontal);
e.Graphics.FillRectangle(gb, e.Bounds);
e.Graphics.DrawString(yvalue, this.Font, Brushes.MidnightBlue, new PointF(e.Bounds.X + 4, e.Bounds.Y + 1 + (e.Bounds.Height - m_textheight) / 2));
e.Handled = true;
}
}
}
catch (Exception E)
{
Console.WriteLine(E.Message);
}
}
else
{
try
{
//<GS-20120801>
if (m_yaxisUnits.Length > 0 || m_xaxisUnits.Length > 0)
{
Font f = new Font(this.Font.FontFamily, 6);
SizeF xsize = e.Graphics.MeasureString(m_xaxisUnits, f);
SizeF ysize = e.Graphics.MeasureString(m_yaxisUnits, f);
e.Graphics.DrawString(m_xaxisUnits, f, Brushes.Black, e.Bounds.X + e.Bounds.Width - xsize.Width - 1, e.Bounds.Y);
e.Graphics.DrawString(m_yaxisUnits, f, Brushes.Black, e.Bounds.X + 1, e.Bounds.Y + e.Bounds.Height/2);
//Console.WriteLine(e.RowHandle.ToString());
//e.Graphics.FillRectangle(Brushes.Red, e.Bounds);
e.Handled = true;
}
}
catch (Exception)
{
}
}
}