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

[Solved] First Cell / First Row selection after row deletion

3 Answers 136 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.
Simon
Top achievements
Rank 1
Simon asked on 25 Jan 2011, 03:58 AM
I'm working on a UI component that allow user to Add / Remove row by clicking on button

Yes, Telerik have created a similar demo but my control is selecting the row next to the deleted row when the user click the delete row button.

Everything works perfectly except for one thing:  each time a row is deleted, the first cell of the first row become selected.

First of all, is this a normal beavior (There's many properties I might not be aware of) ?

If there's no GridView property that would help me to fix this,  is there a way to unselect the current cell (of every cells) in code behind?

Regards,

Simon

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 26 Jan 2011, 03:16 PM
Hello Simon,

I have tried to reproduce the issue you specified, but I was not able to. So, in order to provide you with any appropriate solution, I would need a bit more details. Firstly, which version of RadGridView are you using - our current official one - Q3 2010 SP1 ? Do you set the IsSynchronizedWithCurrentItem/ SelectionUnit/ SelectionMode properties ? How do you delete the items - do you handle the Click event of the button or you are using the built-in Delete command ? Are you defining one button for deleting the items or you create a column with a button used as a CellTemplate that deletes its corresponding item ?
Basically, any relevant information or code-snippet would be helpful.
 

Best wishes,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Simon
Top achievements
Rank 1
answered on 26 Jan 2011, 03:59 PM
Hello Maya,

Here's the missing information

-Telerik controls version: 2010.3.1314.1040
-IsSynchronizedWithCurrentItem: I tried every value without success
-SelectionUnit: FullRow
-SelectionMode: Single

I delete by handling the click event of the button, and then I delete the item directly in the ItemsSource list.

The button isn't part of a template.

Regards,

Simon
0
Maya
Telerik team
answered on 27 Jan 2011, 06:05 PM
Hello Simon,

I am sending you the sample project I used for testing the issue you reported. Please take a look at it and let me know in case of any misunderstandings according to your requirements.
Furthermore, the selected cells can be removed by calling the Clear() method of the SelectedCells collection of the grid.
 

Regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Simon
Top achievements
Rank 1
Answers by
Maya
Telerik team
Simon
Top achievements
Rank 1
Share this question
or