一个是界面(FrmProject),一个是自定义控件(MyDataGridView)
public partial class MyDataGridView :DataGridView
{
public MyDataGridView()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}
string value;
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Enter)
{
DataGridViewCell cell = this.CurrentCell;
if (cell.ColumnIndex == 4)
value=this.Rows[cell.RowIndex].Cells[cell.ColumnIndex].Value.ToString();
return true;
}
return base.ProcessDialogKey(keyData);
}
}
现在是怎么把value传给FrmProject的datagridview.DataSource=bh_Sea(value);做数据源;