Telerik Forums
UI for WPF Forum
1 answer
149 views
I have bound the ItemsSource of my RadDataForm to a custom collection derived from ObservableCollection<T>.

In the collection class I have a method called "Populate". What it does, is it basically just makes an http request in a new thread and then adds items from the http request to the collection.

When calling ObservableCollection<T>.Add() from the new thread, I get a System.InvalidOperationException with the message "The calling thread cannot access this object because a different thread owns it".

The stacktrace lead me to RadDataForm (pasted below). Should RadDataForm be thread safe?

   at System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value)
   at Telerik.Windows.Controls.RadDataForm.set_CanAddItems(Boolean value) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataForm\RadDataForm.cs:line 1367
   at Telerik.Windows.Controls.RadDataForm.SetCanAddItems() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataForm\RadDataForm.cs:line 1510
   at Telerik.Windows.Controls.RadDataForm.SetAllCanProperties() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataForm\RadDataForm.cs:line 1525
   at Telerik.Windows.Controls.RadDataForm.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Data\DataForm\RadDataForm.cs:line 768
   at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 636
   at Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 615
   at Telerik.Windows.Data.DataItemCollection.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 1050
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 33
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 900
   at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChangedWithAdjustedArgs(NotifyCollectionChangedEventArgs originalArguments, Int32 adjustedOldIndex, Int32 adjustedNewIndex) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1499
   at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1366
   at Telerik.Windows.Data.QueryableCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1263
   at Telerik.Windows.Data.QueryableCollectionView.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1739
   at Telerik.Windows.Data.QueryableCollectionView.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1718
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 33
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at My.Project.ModelCollection`1.<Populate>b__3(IQueryResult result) in D:\myproject\ModelCollection.cs:line 67
  ....something clipped....
   at System.Threading.Tasks.Task.Execute()
Anatoly Chekh
Top achievements
Rank 1
 answered on 22 Mar 2012
1 answer
100 views
Two issues with the RadGridView.  And they both are based around the same issue.
Once we load the grid with our IEnumerable, all items are immediately selected with in the grid.  Even though I have the following: 
SelectedItem="{x:Null}" SelectionMode="Single"
set on the grid.

Now, we are binding the grid programmatically. But all rows and cells are immediately selected, which is not what I want.



The second issue is that when I finally clear them through filters, when I do select a row, it will only allow me to select one row.

Which is fine, but I can't deselect that row and choose another.






Am I missing something?

Thanks

Travis
Maya
Telerik team
 answered on 22 Mar 2012
1 answer
82 views
Hello,

We have a WPF RadGridView, and my Coded UI test having problems with the data items.
Its quite odd, it seems like the last data item in the grid (the last row) is blocking the rest of the rows, (Im Getting an exception of "Blocked object" while using Mouse.click on the object).
I can only click and use the last Row.
By using the Coded UI Spy, i Noticed That The Last row is indeed blocking the rest.
Im using the last telerik controls version (2012.1).

What can I do?

Thanks in advance,
Tomer.
Ivan Ivanov
Telerik team
 answered on 22 Mar 2012
6 answers
351 views
Hi
I am experiencing some problem.While exporting columns of Radgridview to excel or other supported native formats...some columns are not exporting.
for those columns set the property 
IsVisible="False"
in xaml file.
so I have 2 doubts..
1)How to export all columns which are bind to grid irrespective of visibility.
2)I have a Ilist which is datasource of gribView.is it possible to export those list to different files ?

the following was sample code...
using (Stream stream = dialog.OpenFile())
{
GridViewExportOptions exportOptions = new GridViewExportOptions();
exportOptions.Format = format;
exportOptions.ShowColumnFooters = true;
exportOptions.ShowColumnHeaders = true;
grdView.Export(stream, exportOptions);
}
Regards Naresh
Usman
Top achievements
Rank 1
 answered on 22 Mar 2012
2 answers
76 views
It is painfully clear that Microsoft is dumping WPF into the "Maintenance Only" bin (in favor of Metro).

Is Telerik going to follow suit?  I realize that some of your resources have to be devoted to the new Metro stuff.  But Metro is not a good fit for may Enterprise scenarios.

I am about to start a brand new, very large, enterprise level app with WPF.  Because of this, I would like to know how long Telerik will be giving WPF "First Class" level resources.

Is Telerik able to commit to a time line of how long they will continue to actively and aggressively develop new features and products for WPF developers? 
techvslife
Top achievements
Rank 1
 answered on 22 Mar 2012
0 answers
53 views
If you go into windows and and set your display size to 125%, the grid object does not adjust the scrollbar to account for the larger items. This prevents you from scrolling to items that are at the bottom of the list.

(turns out we're using treelistview, not grid view...)
Eric
Top achievements
Rank 1
 asked on 22 Mar 2012
5 answers
2.4K+ views
The radgridview has an event for MouseDoubleClick, but is there a way you can catch a single click?
I need to hook on to the "click event" when the selected row in the grid is clicked(once)
Antonio Jesús
Top achievements
Rank 1
 answered on 21 Mar 2012
1 answer
121 views
When using the If function we were unable to have a results of differing types.  For example
IF(Expression, FieldOfTypeDecimal, 0) will not work

The ExpressionEditor does not understand numeric constants
IF(Expression, FieldOfTypeDecimal, 0M) will not work.

Is there a way to work around this?

Dimitrina
Telerik team
 answered on 21 Mar 2012
3 answers
85 views
I'm attempting to upgrade my project to Q1 2012.  In my project, I want to select the row in the grid when the row details visiblity is changed.  I accomplished this with the following code
 

 

 

private void grdCustomer_RowDetailsVisibilityChanged(object sender, GridViewRowDetailsEventArgs e)

 

{

e.Row.CommitEdit();

e.Row.IsSelected =

 

true;

 

}

This works with Q1 2011, but with Q1 2012, I get the following error

"'NavigatorIndicatorBackground' name cannot be found in the name scope of 'System.Windows.Controls.Border'."

Is there something I need to change to make this work with Q1 2012, or is there a bug?  At this point, I will have to stay with Q1 2011 unless I can make this work with 2012.

jholt
Top achievements
Rank 1
 answered on 21 Mar 2012
6 answers
350 views
Hi.

I try to create a custom aggregate function.

I get this exception.
"No generic method 'SimCandidateCount' on type 'GenerateFieldEmulator.SimCandidateCounter' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic."

Can you either spot what is wrong or tell me how to find out what the failing overload resolution information is?

xaml:

 

 

 

<telerik:GridViewColumn.AggregateFunctions>

 

 

 

 

<local:SimCount SourceField="SimPossible" SourceFieldType="{x:Type System:Boolean}" Caption="Candidate Modules : " />

 

 

 

 

</telerik:GridViewColumn.AggregateFunctions>


The SimCount class is here.

 

public

 

 

class SimCount : Telerik.Windows.Data.EnumerableSelectorAggregateFunction

 

 

 

 

 

{

 

 

    protected override string AggregateMethodName

 

    {

 

 

        get { return "SimCandidateCount"; }

 

    }

 

 

    protected override Type ExtensionMethodsType

 

    {

 

 

        get

 

 

 

 

 

        {

 

 

            return typeof(SimCandidateCounter);

 

        }

    }

 

}

 

 

public static class SimCandidateCounter

 

 

 

 

 

{

 

 

    public static int SimCandidateCount<TSource>(IEnumerable<TSource> source,Func<TSource,bool> selector )

 

    {

 

 

        return source.Select(selector).Count(b => b);

 

    }

}

Tormod
Top achievements
Rank 1
 answered on 21 Mar 2012
Narrow your results
Selected tags
Tags
+113 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?