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

Grid doesn't exit from edit mode, roweditended doesnt select next item

4 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paweł
Top achievements
Rank 1
Paweł asked on 07 Nov 2013, 10:26 AM
Hello, my problem is that, I have RadGridView with 2 non readonly columns. When Im trying to edit row, and accept with 'enter', in first row selection is changed to second row, but doesn't from second to next etc. What I'd like to reach - after commit in RowEditEnded -> select next row if there is one (at this momment after editing first, as I said, going into edit mode in second, but stays here with cell edit).
Code:
      
  void myDG_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
        {
          
if (e.EditAction == Telerik.Windows.Controls.GridView.GridViewEditAction.Commit)
           {
                editInDatabase(e.NewData);
           }
        }


        void editInDatabase(object o)
        {
            myType np = (myType)o;
           
using (SqlConnection conn = new SqlConnection(cString.c_String))
            {
//edit row in database            
            }
        }

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 11 Nov 2013, 01:39 PM
Hello,

When you edit a cell of a row and then you commit the edit (pressing the Enter key), the RowEditEnded event will be raised for the current row and the cell on the same column from the next row will be set into edit mode.
You say that the "first row selection is changed to second row, but doesn't from second to next'. Would you please clarify this a little bit? Also, would you please share how have you defined your columns? Which is the column you edit?

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Paweł
Top achievements
Rank 1
answered on 12 Nov 2013, 09:43 AM
I define my columns in xaml:

<telerik:RadGridView Grid.Row="1" FontSize="14" Name="myDG" AutoGenerateColumns="False" ShowColumnFooters="True" telerik:StyleManager.Theme="Windows7">
            <telerik:RadGridView.Columns>
                <custom:RGVRowCount Header="Lp." MinWidth="30" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding pdID}" Header="prod_docID" IsVisible="False"  />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding prodID}" Header="prodID" IsVisible="False" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding name}" Header="Name" IsReadOnly="True"  />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding code}" Header="Code" IsReadOnly="True"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding cnt}" Header="Count" />
//more columns like price, price after discount, discount in [%] etc.
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

The column I edit is column with Count header (but it happend with another not readonly columns).
STEP I
So after I add 3 items into my DataGrid, it looks like :
http://puu.sh/5g4Kk.png 
(edit mode "on"). Here on the screen i've changed value from 1 to 5 and press Enter. Next step - going to second row:

STEP II
http://puu.sh/5g4KF.png
 As you can see it works till now - select second row, and enter edit mode with default value 1. Im changing this value to 10:

STEP III
http://puu.sh/5g4KR.png

Now, when I press enter again, it doesn't focus next row (row 3), just stuck in second row. So here you can see what heppended after step III, when I press enter with second row selected:

http://puu.sh/5g4L0.png
 I've changed value 10 to 15, and press enter - still stuck in second row.

Thanks in advance and I hope everything will be clear now ;)

0
Dimitrina
Telerik team
answered on 13 Nov 2013, 12:11 PM
Hello,

Thank you for the detailed explanation.
I have tested the case, defining columns as you shared. I am afraid that I was not able to reproduce any issue committing the edit.

May I ask you to isolate the problem in a demo project which I can debug locally?
  

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Paweł
Top achievements
Rank 1
answered on 13 Nov 2013, 02:34 PM
Well, project was almost ready to send, but I found reason why it doesn't work.
I have method getProducuts(int orderID), which clear items from gridview and load them again. this method was raises in editInDatabase method. That's why gridView stuck in second row - items was cleared and readed once again, so I guess application doesn't really know which row is selected after clear->load.
Thanks anyway ;)
Tags
GridView
Asked by
Paweł
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Paweł
Top achievements
Rank 1
Share this question
or