//*********************************************************************
// //
// SQL Power Injector 1.2 Copyright (c) 2006-2007 Francois Larouche //
// //
// Author : francois.larouche@sqlpowerinjector.com //
// Web Site: www.sqlpowerinjector.com //
// //
//*******************************************************************//
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Reflection;
namespace SQLPowerInjector{
/// <summary>
/// Summary description for MyDataGrid.
/// </summary>
public class MyDataGrid : DataGrid
{
private int hitRow;
private ToolTip _toolTip1;
#region Constructor
public MyDataGrid()
{
hitRow = -1;
_toolTip1 = new ToolTip();
_toolTip1.InitialDelay = 500; // Time in ms for the tooltip to appear once the cursor is stationary
_toolTip1.AutoPopDelay = 32000; // Time in ms that the tooltip remain (32 sec is max value)
}
#endregion
public int HitRow
{
get { return hitRow; }
set { hitRow = value; }
}
public ToolTip DTGToolTip
{
get { return _toolTip1; }
set { _toolTip1 = value; }
}
public void ScrollToRow(int theRow)
{
try
{
// Expose the protected GridVScrolled method allowing you
// to programmatically scroll the grid to a particular row.
if (DataSource != null)
this.GridVScrolled(this, new ScrollEventArgs(ScrollEventType.LargeIncrement, theRow));
}
catch(Exception ex)
{
ex.Source += "\nInside the method: " + MethodInfo.GetCurrentMethod().Name;
throw(ex);
}
}
}
}
|