Telerik Forums
UI for WPF Forum
4 answers
240 views
When I expand the column, to view the child table, I get the error: A TwoWay or OneWayToSource binding cannot work on the read-only property 'AddressFamily' of type 'System.Net.IPEndPoint'.

I had the same error on the parent table - but got around it by explicitly defining the columns and the column bindings as one-way. Not really sure why that was required either, but it worked. But, can't figure out how to do that for the child table. And, I'm not sure if this was the correct approach anyway. 

I get this scenario to work correctly with DataSets - but don't want to have to create DataSets for the  50+ objects I need to do this for.

Any thoughts? 

The datasource is a collection of custom objects.

XAML is...
<Window x:Class="WpfApplication1.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Window1" Height="313" Width="420" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" WindowStyle="ThreeDBorderWindow" SizeToContent="Manual"
    <Grid> 
        <Grid.Resources> 
        </Grid.Resources> 
        <telerik:RadGridView  
            Name="radGridView1"  
            AllowDrop="False"  
            ColumnsWidthMode="Auto"  
            AutoGenerateColumns="False" > 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn    
                    HeaderText="Name"   
                    DataMemberBinding="{Binding Path=Name, Mode=OneWay}"/> 
                <telerik:GridViewDataColumn   
                    HeaderText="HostName"   
                    DataMemberBinding="{Binding Path=HostName, Mode=OneWay}" /> 
                <telerik:GridViewDataColumn   
                    HeaderText="Type"   
                    DataMemberBinding="{Binding Path=Type, Mode=OneWay}" /> 
                <telerik:GridViewDataColumn   
                    HeaderText="Domain" 
                    DataMemberBinding="{Binding Path=Domain, Mode=OneWay}" /> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</Window> 

code behind is:
    public partial class Window1 : Window 
    { 
        Browser browser; 
        BindingList<OtogramService> servicesBindingList = new BindingList<OtogramService>(); 
 
        public Window1() 
        { 
            InitializeComponent(); 
 
            // Create the browser 
            browser = new Browser("_http._tcp"); 
 
            // Hook the Updated event. 
            browser.Updated += new Browser.EventHandler(browser_Updated); 
 
            //create the relationship   
            var detailDefinition = new Telerik.Windows.Controls.GridViewTableDefinition(); 
            detailDefinition.Relation = new Telerik.Windows.Data.PropertyRelation("Addresses"); 
            radGridView1.TableDefinition.ChildTableDefinitions.Add(detailDefinition); 
 
            radGridView1.ItemsSource = servicesBindingList; 
        } 
 
        void browser_Updated2(Browser sender, OtogramBrowserEventArgs e) 
        { 
            switch (e.otogramBrowserEvent) 
            { 
                // note - it is possible to get an Updated* event 
                // before the Add event. 
                case OtogramService.Event.UpdatedAddress: 
                case OtogramService.Event.UpdatedTextRecord: 
                case OtogramService.Event.Add: 
                    { 
                        try 
                        { 
                            // if we have one just update it 
                            var z = (from p in servicesBindingList where p.Name == e.otogramService.Name select p).Single(); 
                            z = e.otogramService; 
                        } 
                        catch 
                        { 
 
                            // if we don't have one already - add a new one. 
                            servicesBindingList.Add(e.otogramService); 
                        } 
 
                    } 
                    break
 
                case OtogramService.Event.Remove: 
                    { 
                        // if we have one - remove it. 
                        var z = from p in servicesBindingList where p.Name == e.otogramService.Name select p; 
                        if (z.Count() != 0) 
                        { 
                            servicesBindingList.Remove(z.First()); 
                        } 
                    } 
                    break
            } 
        } 
 
        private delegate void UpdateBrowser(Browser sender, OtogramBrowserEventArgs e); 
 
        // required because WPF must execute one on one thread.  
        // This puts the callback into the WPF thread's dispatch queue. 
        void browser_Updated(Browser sender, OtogramBrowserEventArgs e) 
        { 
            UpdateBrowser func = browser_Updated2; 
            this.Dispatcher.BeginInvoke(func, new object[] { sender, e }); 
        } 
    } 
 

Rossen Hristov
Telerik team
 answered on 21 Sep 2009
2 answers
134 views

WPF version = .Net 3.5 SP1

OS = XP SP3

exact version of the Telerik product  = 2009 Q2 SP1 (2009.2.813.35)

 

Step by step instructions on how to reproduce erroneous behavior.
1. select cell in RadGridView and the row selector moves to that row and the row is highlighted.
2. edit cell
3. select a cell in a different row and the row selector doesn't move and neither row, previous nor current, are highlighted.
4. select a cell in a different row and the  row selector moves to that row and the row is highlighted.

It appears that if a cell is edited it prevents the current row to be set to the row of the next current cell.
For example:
1. Edit cell.
2. Select a cell in a different row.
3. Hit Up arrow on keyboard.
4. The selected row becomes the row above the row selected in step 1.

Eric Lincoln
Top achievements
Rank 1
 answered on 18 Sep 2009
2 answers
111 views
Hi to all,
i'm using RadDragAndDropManager to make possible to drag a TreeViewItem to a MindFusion Wpf Diagram...to make the game more complex we use the AvalonDock component to handle dock interface.
Actually all the staff work quite well but i have a problem about the DragDropEventArgs and the mouse position. i don't find a way to get the correct mouse coordinate when i drop the treeviewitem into the diagram. On many other event args as for example MouseButtonEventArgs i could get the correct position using the method: e.GetPosition(diagramInstance)...but i don't find a way to do it with the DragDropEventArgs.

Any advice?

Really thanks.
Diego




Diego
Top achievements
Rank 1
 answered on 18 Sep 2009
2 answers
58 views
Dear sirs,
I would like to ask, if possible, if you could explain in a very simple way how can I get my GridView to auto update when the SQL table it is associated to changes. I already read some of your examples on the DataViews, but I didn't get it.
Please have in mind I'm a novice programmer, so samples are welcome!
Best regards,
Bernardo Caldas
Bernardo
Top achievements
Rank 1
 answered on 18 Sep 2009
2 answers
194 views
After upgrading to Q2-2009, I am getting the following error message in the designer window:

'/Telerik.Windows.Controls;Component\Themes\GenericVista.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Cannot locate resource 'themes/genericvista.xaml'. Error at object 'System.Windows.ResourceDictionary'.



Any suggestions?
Thanks,
-Sid Meyers
Sid
Top achievements
Rank 1
 answered on 17 Sep 2009
1 answer
89 views
Hi Telerik Team,

i just bought your suite. Everything is ok, but what i am missing now is a simple docking manager. Did i missout something? Or is there no DockingManger like component? Is it plannned?

Bye
Markus
YodaKIRI
Top achievements
Rank 2
 answered on 17 Sep 2009
1 answer
184 views
Hi, I hope you can help me.

I have created a WPF xbap using telerik radchart, and some other telerik controls. I have configured my application to run as full trusted application internet. It runs correctly but when I publish it on a intranet server I have to install a certificate on the client running the application, following the next post http://blogs.microsoft.co.il/blogs/maxim/archive/2008/03/05/wpf-xbap-as-full-trust-application.aspx .

I see that  http://demos.telerik.com/wpf/ do not ask you to install a certificate. I want to make with my application the same way, could you tell my what's the correct configuration to make it works without install the certificate in every client browser?

My settings:

- WPF Browser Application
- Enable ClickOnce Security Settings -> This is a full trusted application
- Create a test certificate with password and install in every client.

Thank you!
Milan
Telerik team
 answered on 17 Sep 2009
3 answers
164 views
Hi,

I'm having some trouble using RadControls_for_WPF_2009_2_0813_TRIAL. I have used in a project RadWindow for WPF. "Sometimes" when I close a window the InvalidOperationException is thrown. I'm hoping to find help here, because for the moment I'm using the trial version of the controls, trying to demonstrate that this is a fine acquisition.

P.S. I'm adding this post here, because it seems like the Window for WPF forum section have some problems for the time being.

Thank you in advance for your response!

Here is part of my stack trace:

Startup URI: ....xbap
Application Identity: file:///....xbap

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.Max(IEnumerable`1 source)
   at Telerik.Windows.Controls.RadWindowPopup.WindowPopupAdornerFactory.WindowPopupAdornerImpl.BringToFront()
   at Telerik.Windows.Controls.RadWindowManager.BringToFront(RadWindow window)
   at Telerik.Windows.Controls.RadWindow.<BringToFront>b__3()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.StartDispatcherInBrowser(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

-----------------------

Thanks !!
Dan
Top achievements
Rank 1
 answered on 17 Sep 2009
1 answer
95 views
hi.
Can I trigger a cell_clicked event?Should I use MouseDown event instead?
I have another question about gridview.
When I select a row in gridview, is there any way to unselect this row only use a mouse? There is a control called ListCtrl in Visual C++. You can cancel a selection by click on blank area.

Thanks a lot.
Milan
Telerik team
 answered on 17 Sep 2009
1 answer
93 views
I apologize if this is a repost, or if I'm just being an idiot!  I am unable to view the code behind examples for any of the WPF demos.  Upon clicking on the tab (Example.xaml.cs), nothing happens and the standard xaml file remains showing.

Am I doing something wrong, or are these simply not updated / available?

Thanks,

Craig 
Missing User
 answered on 17 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?