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

RadGridView Edit Problem

6 Answers 170 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kadem Engin
Top achievements
Rank 1
Kadem Engin asked on 09 Sep 2010, 12:38 AM

 

 

 

I have following column amongst other columns:

...

<
grid:GridViewDataColumn IsReadOnly="False" IsSortable="False" Header="Comment"

 

 

 

                         DataMemberBinding="{Binding Comment}" MaxWidth="250" IsResizable="False" >

 

 

 

 

    <grid:GridViewDataColumn.CellEditTemplate>

 

 

 

 

        <DataTemplate>

 

 

 

 

            <TextBox Text="{Binding Comment}" MaxLength="50" />

 

 

 

 

        </DataTemplate>

 

 

 

 

    </grid:GridViewDataColumn.CellEditTemplate>

 

 

 

 

</grid:GridViewDataColumn>

...

Issue:

When there is more than one row in the grid, editing of this cell can be ended in whatever way (by focusing on some other field, pressing enter... etc.) and the grid will retain the value entered. Such value will also be updated into the database by:

 

private

 

 

void radGridView1_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
{...}


However, when there is only one row in the grid, pressing enter to end the cell edit works for retaining the value just entered for the cell but not triggering "CellEditEnded". Therefore, the value entered is not being put into the database...

Is there anyway someone help me with this?

Thanks for your time in advance,

K

 

 

 

6 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 09 Sep 2010, 06:36 AM
Hello Kadem Engin,

I could not reproduce the problem. Please find attached my test project. Let me know if you manage to reproduce it.

All the best,
Veselin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kadem Engin
Top achievements
Rank 1
answered on 09 Sep 2010, 03:32 PM
Everything works with one you provided, but it did not have "MaxLength" property changed...
Have you tried adding "
MaxLength
="x"" where x (for your solution) is 10.

I have not been able to reproduce yet, partly because what you have is totally different than what I got. But when the cell is edited twice, whole row disappears...

I'll be trying some more. Thanks so far.

 

0
Kadem Engin
Top achievements
Rank 1
answered on 09 Sep 2010, 03:45 PM

The problem in my post before this does not occur when:

 

clubsGrid.ItemsSource =

 

Club.GetClubs().Where(c => c.Name == "Liverpool");
 
is changed to => clubsGrid.ItemsSource = Club.GetClubs();

... As I mentioned in my first post, there is something happening differently when there is only one row than there are more rows. (And, I figured, this has nothing to do with MaxLength property...)
I think my problem is also caused by having one row... Please let me know what you find.

K

 

0
Maya
Telerik team
answered on 09 Sep 2010, 04:21 PM
Hi Kadem Engin,

Unfortunately, I am not able to reproduce the issue even if:

clubsGrid.ItemsSource = Club.GetClubs();

and the CellEditEnded is fired as expected no matter if you are editing the column with predefined CellEditTemplate or any of the others.
So, I would need a bit more information, mostly about the exact way of reproducing the issue - is there anything specific you are doing when editing or some additional property you are setting? 
 

Greetings,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kadem Engin
Top achievements
Rank 1
answered on 09 Sep 2010, 05:13 PM
I think the problem is at the last row (when there is only one row, it is the last row.) as opposed to first row which I thought it was the problem originally.

Here is some more information I can give:

1) I am not using ObservableCollection<T>, I'm using List<T>(Documentation does not say I have to use ObservableCollection => http://www.telerik.com/help/wpf/gridview-configuring-the-databindings.html)
2) The field is from LINQ to SQL class
3) The field allows null...

The problem occurs only at the last row by ending edit with ENTER on the field that "allows null".

Pressing enter key "normally" ends the edit and moves the cursor to the same column but one row below(* in this case)...
In the case of ending edit at the last column with ENTER, well, I think entered value is being ignored because the cursor cannot focus somewhere else?!? UI shows everything is OK but, in fact, the SubmitChange() at CellEditEnded does not receive the "change" from the grid.

Did I clarify some?

K
0
Maya
Telerik team
answered on 13 Sep 2010, 04:20 PM
Hello Kadem Engin,

Please send us a sample project illustrating the issue so that we skip any misunderstandings on your requirements and project settings. In case it is more suitable for you, you may modify the application attached in this forum thread and send it through support ticket.
Thank you for the cooperation. 
 

Kind regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Kadem Engin
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Kadem Engin
Top achievements
Rank 1
Maya
Telerik team
Share this question
or