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

[Solved] BeginInsert() results in black row

1 Answer 69 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kiel
Top achievements
Rank 1
Kiel asked on 22 Apr 2009, 05:57 PM
private void RadGridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e) 
   radGridView.BeginInsert(); 

What I'm trying to do is when the user presses 'Tab' at the end of the row, the row being edited will be submitted and a new one will be created.  I'm trying to prevent them from having to press 'Insert' to get a new row and allow quick entry.

The code above adds a black/gray row to the top that doesn't show any columns.

1) What is the correct way to accomplish what I'm after?

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 24 Apr 2009, 10:52 AM

Hello Kiel,

Trying to show and focus the new row in RowEditEndedEvent  seems to conflict with the Tab navigation logic.  This is the reason not to gain the expected result.

As a workarround I may reccomend you to use the CurrentCellChanged event and check whetther it is no more in the new row. Please try the following code :

    this.RadGridView1.CurrentCellChanged += new EventHandler<Telerik.Windows.Controls.GridViewCurrentCellChangedEventArgs>(RadGridView1_CurrentCellChanged);  
        }  
 
        void RadGridView1_CurrentCellChanged(object sender, Telerik.Windows.Controls.GridViewCurrentCellChangedEventArgs e)  
        {  
             if(! (e.NewCell.ParentRow is GridViewNewRow))  
                 Dispatcher.BeginInvoke(  
                delegate 
                {  
                    this.RadGridView1.BeginInsert();  
                });  
        } 

Meanwhile we are implementing a feature to allow always visible new row. i believe this feature will be shiped in the Q2 /2009 release.

Let me know if you need a sample project or any further help on this matter.
Sincerely yours,

Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Kiel
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or