Telerik Forums
UI for WPF Forum
4 answers
211 views
hello there,
I want to get Commmand Object pass into the custom attached property with this control but then there is no result, but when I used the built in .net ContextMenu is okay, I'm trying to get this done in MVVM way is there any suggestion or ideas?

Juzailie
Top achievements
Rank 2
 answered on 15 Jul 2014
6 answers
153 views
I have a master detail screen using gridviews.

When a new master row is saved, the server creates detail rows, but the detail gridview does not display/retrieve these new rows until a different master row is selected and then the new master row is again selected.

How can I get the detail gridview to retrieve these new rows as soon as the save is done?

Putting detailDataSource.Refresh() after the masterDataSource.SubmitChanges() does not work.

Thanks. (This is in a MVVM system btw).
Yoan
Telerik team
 answered on 14 Jul 2014
3 answers
115 views
hi there,

I've got a problem in adding some Data items to RadTreeView's DataContext. Here is the code and descriptions:

in My XAML side, I've added a RadTreeView like this:

<telerik:RadTreeView x:Name="trvGeoDevisions" Grid.Row="1" Margin="0,15,0,0" HorizontalContentAlignment="Stretch" IsVirtualizing="True" IsExpandOnSingleClickEnabled="True"><br>            <telerik:RadTreeViewItem x:Name="TrootItem"  IsExpanded="True"><br>                <telerik:RadTreeViewItem.Header><br>                    <StackPanel><br>                        <TextBlock Text="Geo Devisions"/><br>                        <telerik:RadWatermarkTextBox x:Name="txtNewCountry" WatermarkContent="New Country..." Style="{StaticResource tk}" KeyDown="txtNewCountry_KeyDown"/><br>                    </StackPanel><br>                </telerik:RadTreeViewItem.Header><br>                <telerik:RadTreeViewItem.ItemTemplate><br>                    <HierarchicalDataTemplate ItemsSource="{Binding GeographicalDevisions}"><br>                        <Grid Margin="0,10,0,0"><br>                            <StackPanel><br>                                <TextBlock Text="{Binding Path=Name}" /><br>                                <telerik:RadWatermarkTextBox x:Name="txtNewEntry" WatermarkContent="{Binding Path=Type,Converter={StaticResource wp},ConverterParameter='New 1...'}" Visibility="{Binding Type.Types.Count,Converter={StaticResource numberToVisiblity}}" Style="{StaticResource tk}" KeyDown="txtNewEntry_KeyDown" <br>                                                             Tag="{Binding Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadTreeViewItem}}}" /><br>                            </StackPanel><br>                        </Grid><br>                    </HierarchicalDataTemplate><br>                </telerik:RadTreeViewItem.ItemTemplate><br><br>            </telerik:RadTreeViewItem><br>        </telerik:RadTreeView><br>

I want to add some Items when user types something in RadWatermark and presses Enter key, Thus I Write the following code:
 Private Sub txtNewEntry_KeyDown(sender As Object, e As KeyEventArgs)<br>        If e.Key = Key.Enter Then<br>            Dim control = CType(sender, Telerik.Windows.Controls.RadWatermarkTextBox)<br>            Dim GeoDev = CType(control.DataContext, GeographicalDevision)<br>            Dim tag As Telerik.Windows.Controls.RadTreeViewItem = control.Tag<br><br>            Dim nEntry As New GeographicalDevision With {.Name = control.Text, .ParentGeographicalDevision = GeoDev, .Type = GeoDev.Type.Types(0)}<br>            GeoDev.GeographicalDevisions.Add(nEntry)<br><br>            control.Clear()<br>        End If<br>    End Sub

The Sub runs successfully but right after End Sub, I got this Error in Sub Main of Application:

​Object reference not set to an instance of an object.
Source: Telerik.Windows.Controls.Navigation
HResult: -2147467261
StackTrace:    at Telerik.Windows.Controls.TreeView.TreeViewPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   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, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   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.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at Shoniz.HRMS.HRMSApplication.Application.Main() in E:\6. HRMS Application\HRMSApplication\HRMSApplication\obj\Debug\Application.g.vb:line 77
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()


WHAT'S WRONG WITH ME?
Martin Ivanov
Telerik team
 answered on 14 Jul 2014
2 answers
101 views
Hi,
Does RadChartView has a SplineRange series implementation?
Also any new progress with implementation of series descriptor for range series? (http://feedback.telerik.com/Project/143/Feedback/Details/98763-add-series-descriptor-for-range-series)
Thanks,
Alex
Pavel R. Pavlov
Telerik team
 answered on 14 Jul 2014
1 answer
225 views
hi everybody
i wanna use raddocking
but when i want use telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" i get error

i add   xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=QuickStart.Common" but dont help me
in
some thread write
xmlns:tkqs="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
but this not work in my project
<Page x:Class="WpfAtestdock.Page1"
      xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=QuickStart.Common"
      mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" Title="Page1">
 
    <Grid>
        <telerik:RadDocking BorderThickness="0" Padding="0" telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" >
            <telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer>
                <telerik:RadPaneGroup>
                    <telerik:RadDocumentPane Header="document1" Title="document1"/>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="pan left1">
                        <TextBlock Text="pan left 1"/>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="pane left 2">
                        <TextBlock Text="pane left 2"/>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </Grid>
</Page>

please see my attach file
http://uplod.ir/jj74goijoexi/WpfAtestdock.zip.htm


error:
An unhandled exception of type 'System.IO.FileLoadException' occurred in PresentationCore.dll

Additional
information: Could not load file or assembly 'Telerik.Windows.Controls,
Version=2013.3.1016.40, Culture=neutral,
PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)
Kalin
Telerik team
 answered on 14 Jul 2014
1 answer
262 views
I read some threads on it forum on this topic and I produced the following code in  xaml:

 <Grid>           
                                <telerik:XamlDataProvider x:Name="XamlDataProvider" Xaml="{Binding xxx}"
                                    RichTextBox="{Binding ElementName=RadRichTextBox}"/>
                                <telerik:RadRichTextBox x:Name="RadRichTextBox" IsSpellCheckingEnabled="False"/>
                                <!--<TextBlock Text="{Binding xxx}"></TextBlock>-->
                            </Grid>

The xxx is a property in my view model. The data from RadRichTextBox document I convert to xaml and save in database and when I open a window and in database is the xxx I want to display it in RadRichTextBox. Now it's don't work. When I uncomment the line with textblock then in it there is the xaml string so datacontex should be good.
Dariusz
Top achievements
Rank 1
 answered on 14 Jul 2014
1 answer
157 views
Dear all,
I create an application using WPF (MVVM) along with Telerik UI for WPF. I got into a problem with exporting gridview to excel using GridView's export method.
Simply saying, all column headers that contain custom header show a type name instead of Header.Text:
<t:GridViewComboBoxColumn  Name="InterestAlgorithmColumn"
                                               
                                             ItemsSourceBinding="{Binding Source={StaticResource InterestAlgorithmsViewSource},UpdateSourceTrigger=PropertyChanged}"
                                             DataMemberBinding="{Binding InvestmentAlgorithmCode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                             DisplayMemberPath="AlgorithmName"
                                             SelectedValueMemberPath="AlgorithmCode"
                                             IsReadOnly="True">
                        <t:GridViewComboBoxColumn.Header>
                            <TextBlock Text="Algorithm Name" TextWrapping="Wrap"  Width="100"/>
                        </t:GridViewComboBoxColumn.Header>
                    </t:GridViewComboBoxColumn>

Is there a solution for this? Maybe there is another approach since I use custom .Header section because of Business wants to have the headers wrapped and setting Wrap in GridViewComboBoxColumn seems not working.

Regards
Tom
 
Yoan
Telerik team
 answered on 14 Jul 2014
2 answers
575 views
Hi Telerik,

I have a problem getting the correct mouse coordinates(lineSeries is a RadCartesianChart). I know how to get the coordinates:

var mousePosition = e.GetPosition(lineSeries);
DataTuple tuple = lineSeries.ConvertPointToData(mousePosition);

double x = (double)tuple.FirstValue;
double y = (double)tuple.SecondValue;

But i have 3 axes on my graph and when i extract the mouse coordinates i get the coordinates for the wrong axes. They are defined like this:

<telerik:RadCartesianChart.HorizontalAxis>
<telerik:LinearAxis VerticalLocation="Bottom" Title="Concentration(µmol/L)" x:Name="HorizontalAxis"/>
</telerik:RadCartesianChart.HorizontalAxis>

<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis IsInverse="True" Title="Depth(µm)" x:Name="VerticalAxis"/>
</telerik:RadCartesianChart.VerticalAxis>

Haxis = new LinearAxis();
Haxis.Title = "Rate (nmol cm-3 s-1)";
Haxis.VerticalLocation = AxisVerticalLocation.Top;
Haxis.IsInverse = true;

I get the mouse coordinates for the horizontal axis defined in XAML but i want mouse coordinates for the horizontal axis defined in the C# code.

So how would i extract mouse coordinates for the correct axes when i have more than two?

Best regards,
Jeppe
Unisense
Top achievements
Rank 1
 answered on 14 Jul 2014
1 answer
210 views
Hello,
I would like to bind entity from the itemsource collection to the command parameter.

My goal is to open certain entity when it is clicked from the grid, but have unable to bind
the entity from the binded collection.

Is this possible to do by using MVVM approach?
One challenge is that I have two telerik:BarSeries defined for the chart.

So this code line at the below needs to be sorted out,
"CommandParameter="???????????????" 

Here is the full code:


<telerik:RadCartesianChart Margin="10" IsHitTestVisible="True">

           <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="XY" MajorXLinesRenderMode="All">
                </telerik:CartesianChartGrid>
           </telerik:RadCartesianChart.Grid>

            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeContinuousAxis MajorStepUnit="Minute" MajorTickStyle="{StaticResource MajorTickStyle}" PlotMode="OnTicksPadded">
                    <telerik:DateTimeContinuousAxis.TitleTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding}"></TextBlock>
                        </DataTemplate>
                    </telerik:DateTimeContinuousAxis.TitleTemplate>
                </telerik:DateTimeContinuousAxis>
            </telerik:RadCartesianChart.HorizontalAxis>
            
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis Minimum="0" Maximum="200" ShowLabels="False"></telerik:LinearAxis>
            </telerik:RadCartesianChart.VerticalAxis>

            <telerik:BarSeries ItemsSource="{Binding EntityData1}" ValueBinding="EntityTime" CategoryBinding="EntityTakingTime" Height="1000">
                <telerik:BarSeries.PointTemplate>
                    <DataTemplate>
                        <Rectangle x:Name="RectangleGreen" Fill="Green" MaxWidth="20"/>
                    </DataTemplate>
                </telerik:BarSeries.PointTemplate>
            </telerik:BarSeries>

            <telerik:BarSeries ItemsSource="{Binding EntityData2}" ValueBinding="EntityTime" CategoryBinding="EntityTakingTime" Height="1000">
                <telerik:BarSeries.PointTemplate>
                    <DataTemplate>
                        <Rectangle x:Name="RectangleRed" Fill="Red" MaxWidth="20"/>
                    </DataTemplate>
                </telerik:BarSeries.PointTemplate>
            </telerik:BarSeries>

           <telerik:EventToCommandBehavior.EventBindings>
                <telerik:EventBinding Command="{Binding OpenEntityCommand}" 
                                      EventName="MouseLeftButtonDown" 
                                      RaiseOnHandledEvents="True"
                                      CommandParameter="???????????????" />
            </telerik:EventToCommandBehavior.EventBindings>

</telerik:RadCartesianChart>


Check the attached screenshot to see the generated chart.
Green and red bars should work as links to open certain entity.

Best Regards, Tommi







Petar Marchev
Telerik team
 answered on 14 Jul 2014
10 answers
225 views
Hi,

In my ScheduleView control, I display from monday to friday, from 8:00AM to 9:00PM. In the grid, I can have appointments, specials slot and empty cells, so, I know there is an event when an appointment selection changed but I didn't find anything for "special slot" or "empty cell" selection changed!!! Can you tell me if something exist for that?

Thank's
Alain
Yana
Telerik team
 answered on 14 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?