AD
Administrator
Syncfusion Team
May 1, 2006 05:49 AM UTC
Hi Adam,
In the CurrentCellKeyDown event handler before populating the current cell value in the selected range, call the CurrentCell.EndEdit(); which will trigger the CurrentCellValidating event. Below is a code snippet.
if ((e.KeyCode == Keys.Enter)&&(Control.ModifierKeys & Keys.Control)!=0)
{
GridCurrentCell cc = _HPGrid.CurrentCell;
cc.EndEdit();
GridRangeInfo info = _HPGrid.Selections.Ranges.ActiveRange;
if (info.Top != info.Bottom)
{
for(int i = info.Top; i<=info.Bottom ;i++)
_HPGrid[i,info.Left].CellValue = cc.Renderer.ControlText;
//_HPGrid.RefreshRange(GridRangeInfo.Rows(info.Top, info.Bottom));
//e.Handled = true;
//_HPGrid.CurrentCell.EndEdit();
}
}
Regards,
Calvin.
AK
Adam K.
May 1, 2006 05:57 PM UTC
worked like a charm . .thank you very much . .
>Hi Adam,
>
>In the CurrentCellKeyDown event handler before populating the current cell value in the selected range, call the CurrentCell.EndEdit(); which will trigger the CurrentCellValidating event. Below is a code snippet.
>
>if ((e.KeyCode == Keys.Enter)&&(Control.ModifierKeys & Keys.Control)!=0)
> {
> GridCurrentCell cc = _HPGrid.CurrentCell;
> cc.EndEdit();
> GridRangeInfo info = _HPGrid.Selections.Ranges.ActiveRange;
> if (info.Top != info.Bottom)
> {
> for(int i = info.Top; i<=info.Bottom ;i++)
> _HPGrid[i,info.Left].CellValue = cc.Renderer.ControlText;
>
> //_HPGrid.RefreshRange(GridRangeInfo.Rows(info.Top, info.Bottom));
> //e.Handled = true;
> //_HPGrid.CurrentCell.EndEdit();
> }
> }
>
>Regards,
>Calvin.