我已经下载了一个c#sql server ADO项目,我很难理解this.dataGrid1.UnSelect(this.dataGrid1.CurrentRowIndex);
的部分内容
我没有看到Unselect函数的函数定义,我无法弄清楚它是用户定义的函数还是buildin函数。
错误消息是Systems.Windows.Forms.DataGridView不包含' Unselect'的定义。没有扩展方法'取消选择'接受Sytems.Windows.Forms.DataGridView类型的第一个参数可以找到(你是否缺少使用指令或汇编引用?)
private void btFirst_Click(object sender, System.EventArgs e)
{
if((currManager!=null)&(currManager.Count>0))
{
fnClearStatusbarPanel2();
fnSelectUnselectLastFirstRow(0);
//set the position at the first record 0
currManager.Position=0;
//enable pushbuttons Next, Last
fnEnableDisableButtons(this.btNext,this.btLast,"", true);
//disable pushbuttons First, Previous
fnEnableDisableButtons(this.btFirst, this.btPrevious,"First record...",false);
//display record numbers in the StatusBar
fnDisplayRecordNumbers();
}
}
private void fnSelectUnselectLastFirstRow (int posi)
{
//unselect the last selected/highlighted row
this.dataGrid1.UnSelect(this.dataGrid1.CurrentRowIndex);
//select the last or first row
this.dataGrid1.Select(posi);
}