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

Error on Sorting via column header

4 Answers 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Terry Newton
Top achievements
Rank 1
Terry Newton asked on 10 Aug 2011, 11:17 PM
I have run into an unusual error.  I have a grid with a number of columns in it, one of which is a hyperlink bringing up a dialog that is subsequently closed leading to the issue.  After this dialog is closed the frist click on a column header leads to an error.  This does not happen eother before the dialog is broght up or after the error is generated the first time.  The dialog receives a link to the dataset behind the grid.  A Dialogs that does not reference the dataset does not genate the issue.  I use a custome class defined to pass a parameter
Public Sub New(ByVal oEWAD As EmployeeWeekAssignmentData)
that contains a dataset as a property
Private WithEvents moEWAD As EmployeeWeekAssignmentData
Public Property DS As C1.Silverlight.Data.DataSet
and the dataset is assigned as the itemsource for the datagridview

Dim oDS As New C1.Silverlight.Data.DataSet

oDS.ReadXmlFromString(e.Result.XML)

Me.grdTimeSheet.ItemsSource = oDS.Tables(0).DefaultView

Does anyone have an idea as to how I can catch this issue and prevent it?

4 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 11 Aug 2011, 01:37 PM
Hello Terry Newton,

Reading the exception and your description I believe you are trying to sort RadGridView while it is still being bound (refreshing) . So this is kind of expected. You can not sort the ItemsSource while it is still refreshing.

Maybe you can temporary disable the sorting  to avoid such thing happening .

All the best,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Terry Newton
Top achievements
Rank 1
answered on 11 Aug 2011, 03:47 PM
Good info. 

Unfortunately it is not the code causing the sort, but the user clicking on the header after the called dialog closes.  I could disable all sorting when the dialog is opened.  What event can I listen to to allow the sorting to be reenabled?  Enabling it after the dialog closes is not working, I have already tried,but the error generates well after I have handled the dialog closed event.

I tried disabling and I tried doing an explicit rebind, but perhaps I did not try that in a good combination and I can look at that again.
0
Accepted
Maya
Telerik team
answered on 17 Aug 2011, 01:13 PM
Hello Terry Newton,

Based on the code-snippet provided, I get the impression that you are using a specific DataSet of another third-party controls. Am I right or am I missing something ? May you try to reproduce the same behavior using different data source for the grid ? 

 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Terry Newton
Top achievements
Rank 1
answered on 28 Nov 2011, 07:38 PM
I addressed the issue by preventing the user from clicking on the header until after everything is loaded, so this is no longer a concern to me.
Tags
GridView
Asked by
Terry Newton
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Terry Newton
Top achievements
Rank 1
Maya
Telerik team
Share this question
or