Hi,
I have a problem trying to deselect a selected row, I found this but is not working:
In the method I have this:
When I run this, and I do click in the same row, the row continue selected, but if I put a breakpoint in the Clear() and then continue with the code, is working fine!, if no breakpoint, the row continue selected, is there any problem with this event? is there any other way to do it?
I need a solution because I don't want to change the RadGridView for another control.
Thank you.
I already checked this http://www.telerik.com/community/forums/silverlight/gridview/how-to-deselect-a-row-when-it-is-clicked.aspx but is not my case. I need only one row selected, If I click in another row, has to do the same effect, if I click on the same row, it should deselect the row.
I have a problem trying to deselect a selected row, I found this but is not working:
RadGridViewOrgUnit.AddHandler(GridViewCell.MouseLeftButtonDownEvent,
new MouseButtonEventHandler(RadGridViewOrgUnit_MouseLeftButtonDown), true);
In the method I have this:
private void RadGridViewOrgUnit_MouseLeftButtonDown(object s, MouseButtonEventArgs args)
{
var senderElement = (FrameworkElement)args.OriginalSource;
var clickedRow = senderElement.ParentOfType<
GridViewRow
>();
if (clickedRow != null)
{
if (this.OrganizationUnitUC.RadGridViewOrgUnit.SelectedItems.Count > 0)
{
IdValue itemDate = ((IdValue)((RadGridView)s).SelectedItem);
if (itemDate.ID == this.OrganizationUnitUC.OrganizationUnitSelectedItemPrevious)
{
this.OrganizationUnitUC.SelectedItems.Clear()
}
else
{
//Do something else...
}
}
}
}
When I run this, and I do click in the same row, the row continue selected, but if I put a breakpoint in the Clear() and then continue with the code, is working fine!, if no breakpoint, the row continue selected, is there any problem with this event? is there any other way to do it?
I need a solution because I don't want to change the RadGridView for another control.
Thank you.
I already checked this http://www.telerik.com/community/forums/silverlight/gridview/how-to-deselect-a-row-when-it-is-clicked.aspx but is not my case. I need only one row selected, If I click in another row, has to do the same effect, if I click on the same row, it should deselect the row.