Hi Serg,
Try this
public class NewGrid : DataGrid
{
public NewGrid()
{
this.ReadOnly = true;
}
protected override void OnCurrentCellChanged(EventArgs e)
{
this.Select(this.CurrentRowIndex);
}
protected override void OnVisibleChanged(EventArgs e)
{
if (this.CurrentRowIndex > -1)
this.Select(this.CurrentRowIndex);
}
}
If you dont want to see focused EditBox in the Grid's columns, you should
inherit DataGridTextBoxColumn and override Edit method
protected override void Edit(System.Windows.Forms.CurrencyManager source,
int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string
instantText, bool cellIsVisible)
{
if (this.ReadOnly)
return;
else
base.Edit(source, rowNum, bounds, readOnly, instantText,
cellIsVisible);
}
HTH,
Radovan
"Serg Matvienko" <se******@hotmail.com> wrote in message
news:O1*************@TK2MSFTNGP12.phx.gbl...
Hi Mohamed,
Thank you very much for your help, but unfortunately it doesn't work this
way. Maybe you could advise me a good book about window form's data grids.
I have seen lots of book about web data grids, but never about window form's
ones.
Sincerely,
Serg