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

GridView "Visual is not connected to a presentationsource" error

1 Answer 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
gregory
Top achievements
Rank 1
gregory asked on 04 Feb 2014, 02:39 PM
Hi,

I have a page with a gridview that is bound to a collection of items from a radpager which I use on a Dell windows 8.1 tablet.

One of the column is a custom column that has an edit button which when clicked goes to a different view with that particular rows data

                    <telerik:GridViewColumn Header="Edit">
                        <telerik:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                 <telerik:Label Content="Edit" TouchDown="EditButton_Click" MouseLeftButtonDown="EditButton_Click" Style="{StaticResource HyperLinkStyle}"/>
                            </DataTemplate>
                        </telerik:GridViewColumn.CellTemplate>
                    </telerik:GridViewColumn>

This is the click event code

var button = sender as Telerik.Windows.Controls.Label;
var row = button.ParentOfType<GridViewRow>();
var item = (Form)row.Item;

DefaultLinkNavigator dln = new DefaultLinkNavigator();
dln.Navigate(new Uri("/Pages/NewSubmission.xaml?" + item.Id, UriKind.Relative), this);

This works fine the first time but if I touch edit and then come back to the list of records and try to click the same edit button again I get a "Visual is not connected to a presentationsource" error. 

Also this ONLY happened on Touch events, I connected a mouse to the tablet and click event dont trigger this error.

So this happens when returning to the list and clicking on an edit button that was previously clicked and it only happens with touch events

Has anyone seen this or knows what is happening?





1 Answer, 1 is accepted

Sort by
0
gregory
Top achievements
Rank 1
answered on 04 Feb 2014, 03:20 PM
I am using the 2013.3.1204.45 version
Tags
GridView
Asked by
gregory
Top achievements
Rank 1
Answers by
gregory
Top achievements
Rank 1
Share this question
or