This is a migrated thread and some comments may be shown as answers.

AddNewRow with GridView on RowEditEnded

0 Answers 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sakthi
Top achievements
Rank 1
Sakthi asked on 03 Dec 2012, 02:45 AM
Hi All,

I am adding the new Row in RowEditEnded Event. When the RowEditEnded is called it Creates two empty Rows. Also when i press Shift+Tab to move focus to previous cell's and focus tries to move previous row it again calls the roweditended and creates the Two Empty Rows. Expected behavior is it should change the focus to previous row.

Also one more thing when i load the GridView it should be with one Empty Row.

Any workaround for this 2 issues.

private void playersGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {           
            e.NewObject = new Player();
        }
  
        private void playersGrid_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if ( e.EditAction == GridViewEditAction.Commit)
            {
                this.playersGrid.CurrentColumn = this.playersGrid.Columns.OfType<GridViewColumn>().First();
                this.playersGrid.BeginInsert();
            }
        }

Thanks and Regards,
Sakthi

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Sakthi
Top achievements
Rank 1
Share this question
or