Dim idordine As String = DirectCast(testGrid.SelectedItem, Orders).OrderIDDim query = From employee In employees Join order In orders On employee.EmployeeID = order.EmployeeID Select New With { _ .EmployeeName = employee.LastName, _ .OrderName = order.ShipName, _ .OrderDate = order.OrderDate _}testGrid.ItemsSource = query Me.Griglia.ItemsSource = qryHi,
Is there an option to use RadCartesianChart with zoom capability on the X axis in a way that when the zoom/pan had changed the Y axis will fit its min and max values automatically?
If not, How can I get which parts of the series is visible on the chart, so I can calculate Y values by myself?
Thanks.
Dear all,
I want to drag items from one listbox to another. The drag seems to work fine, but the target listbox doesn't get updated with the new item. I do notice that, once dropped, the item is removed from the source list. I try to do stuff declaratively (XAML) as much as I can
Here's the XAML for the enabling of dragging.
<Window.Resources> <!-- Make "ViewModel" represent an instance of ViewModel--> <local:ViewModel x:Key="ViewModel"/> <Style x:Key="DraggableListBoxItem" TargetType="telerik:RadListBoxItem"> <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" /> </Style>
</Window.Resources>Here's where I display my listboxes
<Grid x:Name="_grid" HorizontalAlignment="Left" Height="436" Margin="10,10,0,0" VerticalAlignment="Top" Width="1297" DataContext="{Binding Source={StaticResource ViewModel}}"><telerik:RadListBox HorizontalAlignment="Left" Margin="10,48,0,0" VerticalAlignment="Top" Width="106" Height="306" ItemContainerStyle="{StaticResource DraggableListBoxItem}" ItemsSource="{Binding Segments.AllSegments}" DisplayMemberPath="Code"> <telerik:RadListBox.DragDropBehavior> <telerik:ListBoxDragDropBehavior /> </telerik:RadListBox.DragDropBehavior> <telerik:RadListBox.DragVisualProvider> <telerik:ScreenshotDragVisualProvider /> </telerik:RadListBox.DragVisualProvider> </telerik:RadListBox> <telerik:RadListBox HorizontalAlignment="Left" Margin="133,48,0,0" VerticalAlignment="Top" Width="205" Height="306" ItemsSource="{Binding Segments.SelectedSegments}" DisplayMemberPath="Code" AllowDrop="True"> </telerik:RadListBox></grid></Window>For your information: My main ViewModel exposes another viewmodel called Segments which has 2 ObservableCollection<> properties, called AllSegments and SelectedSegments. Both contain the same data type (a viewmodel called Segment).
I was under the impression that I can implement this d&d fully declaratively, since there's no need for data conversion. (Both viewmodels accept the same data type). But the SelectedSegments ObservableCollection is never updated when I drop an item on the target listbox. What am I missing here?
Thanks for responding.
Regards,
~Rob
_dataGrid.Columns.Clear(); _dataGrid.ColumnGroups.Clear(); foreach (var period in currentPeriods) { var periodGroupName = "test" + col; var periodGroup = new GridViewColumnGroup {Header = period.Name, Name = periodGroupName}; var runGroupName = "test2" + col; var runGroup = new GridViewColumnGroup { Header = "Run", Name = runGroupName }; periodGroup.ChildGroups.Add(runGroup); _dataGrid.ColumnGroups.Add(periodGroup); var origColumn = new GridViewDataColumn { ColumnGroupName = periodGroupName, Header = "Orig", DataMemberBinding = new Binding("OriginalValue") }; _dataGrid.Columns.Add(origColumn); var repeatColumn = new GridViewDataColumn { ColumnGroupName = periodGroupName, Header = "Repeat", DataMemberBinding = new Binding("RepeatValue") }; _dataGrid.Columns.Add(repeatColumn) col += 2; }I´m setting up a RadGridView in my WPF application. I´ve already created a database and connected a data source to my Grid. I want the user to be able to edit the entries in the RadGridView and I want the database to update according the that.
How is that possible ?
here is my code:
<Window x:Class="TheHomeApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Height="780"
Width="1012"
xmlns:my="clr-namespace:TheHomeApp"
Loaded="Window_Loaded"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls">
<Window.Resources>
<my:HeimilisAppidDBDataSet x:Key="heimilisAppidDBDataSet" />
<CollectionViewSource x:Key="accountingViewSource" Source="{Binding Path=Accounting, Source={StaticResource heimilisAppidDBDataSet}}" />
</Window.Resources>
<Grid DataContext="{StaticResource accountingViewSource}">
<telerik:RadGridView x:Name="AccountingGridView" GroupRenderMode="Flat"
ShowGroupPanel="False"
ItemsSource="{Binding}"
MinHeight="386"
IsReadOnly="False"
MaxHeight="700" CanUserFreezeColumns="False"
RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
ShowColumnFooters="True"
Margin="12,29,0,12"
HorizontalAlignment="Left"
Width="452"
telerikControls:StyleManager.Theme="Windows8"
GridLinesVisibility="Both"
ValidatesOnDataErrors="None"
>
<telerik:RadGridView.Columns >
<telerik:GridViewDataColumn Header="Liður"
DataMemberBinding="{Binding nameAccounting}"
Width="150" />
<telerik:GridViewDataColumn Header="Áætluð upphæð"
DataMemberBinding="{Binding amountAccounting}"
Width="150"
DataFormatString="{}{0:C}"/>
<telerik:GridViewDataColumn Header="Raunupphæð"
DataMemberBinding="{Binding actualAmountAccounting}"
DataFormatString="{}{0:C}"
Width="*" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<telerik:RadChart Content="{Binding}" Height="288" HorizontalAlignment="Left" Margin="506,42,0,0" Name="accountingRadChart" VerticalAlignment="Top" Width="457" />
</Grid>
