Telerik Forums
UI for WPF Forum
1 answer
1.5K+ views
Hello, 
i am working on an mapping application with a RadGridView and only two columns, in the second column, i have foreach row a GridViewComboBoxColumn.
The GridViewComboBoxColumn, looks in xaml like this:
<telerik:GridViewDataColumn  DataMemberBinding="{Binding PropName, UpdateSourceTrigger=PropertyChanged}" Header="MappingPropertyItem" Width="200"/>
Now my problem is how to bind the selectedItem to my ObservableCollection. Does anybody know how i can bind the selectedItem?
I already took a look at this thread: http://www.telerik.com/forums/contextmenu-bind-to-selected-value-of-radgridview-combobox
But this example didnt help me further....

Any help is welcome, thanks in advance!
Ivan Ivanov
Telerik team
 answered on 04 Nov 2016
2 answers
123 views

for example, 

Series 1:   X: P1 P1 P2

                 Y   2   3  4     

 

Series 2   X:P1 P1 P2

                Y: 5   6   7

 

If they are plotted in graph as bar series. I expected the plot order as (series1 ->P1,2) (series2->P1,5) (series 1->P1,3) (series 2->P1,6) (series1 ->P2,4) (series2 ->P2,7) . that means all the P1 category  will be grouped together and has the value order  as (2,5,3,6). And P2 category has value order(4,7)

 

 

 

but actually, it looks like P1 category  has the value order as (2,3,5,6)   and P2 category has value order(4,7)

 

in order to achieve what I want, I have to flatten the two series (series1 and series 2) into one series. But that approach is not exactly what I want. Thank you

mao
Top achievements
Rank 1
 answered on 04 Nov 2016
3 answers
221 views

Hi , I'm doing a WPF project in which I'm exporting the RadGridView data to a workbook , once there I figure it out the lenght of the row and columns (including the headers) then with that information I wanted to shift move cut offset the information to another location in the cell my problem right now is that I can't yet find any method which helps me in this task do you know what exactly do I have to do in order to CUT and paste the information? 

 

PS: I'm using RadSpreadProcessing Library

Boby
Telerik team
 answered on 04 Nov 2016
1 answer
94 views

I've noticed that there are some differences between several controls regarding watermark styling and left padding. It becomes quite visible if you put them next to each other. The left column only contains watermarkcontent and the right one contains text. I'm using the Windows7Theme but it looks the same in several other themes aswell.

 

<StackPanel Orientation="Horizontal">
    <StackPanel Width="200" HorizontalAlignment="Left">
        <telerik:RadWatermarkTextBox Margin="3" WatermarkContent="RadWatermarkTextBox"/>
        <telerik:RadAutoCompleteBox Margin="3" WatermarkContent="RadAutoCompleteBox"/>
        <telerik:RadMaskedTextInput HorizontalAlignment="Stretch" Margin="3" EmptyContent="RadMaskedTextInput" TextMode="PlainText"/>
        <telerik:RadComboBox IsEditable="True" Margin="3" EmptyText="RadComboBox"/>
    </StackPanel>
    <StackPanel Width="200" HorizontalAlignment="Left">
        <telerik:RadWatermarkTextBox Margin="3" Text="RadWatermarkTextBox"/>
        <telerik:RadAutoCompleteBox Margin="3" SearchText="RadAutoCompleteBox"/>
        <telerik:RadMaskedTextInput HorizontalAlignment="Stretch" Margin="3" Value="RadMaskedTextInput" TextMode="PlainText"/>
        <telerik:RadComboBox IsEditable="True" Margin="3" Text="RadComboBox"/>
    </StackPanel>
</StackPanel>
Dinko | Tech Support Engineer
Telerik team
 answered on 04 Nov 2016
4 answers
365 views

I'm developing a bar chart where when the label is selected I need to set the color of that label as well as call an event handler (a different one than what I have set up for the bar selection).

Is there a property that enables this, similar to the ChartSelectionBehavior? Starting with one of the examples I found (see XAML below) I've been able to get the bar selection working and I made the label change color on mouse over, but this isn't what I need - it needs to function more like the bar selection.

 

<UserControl x:Class="TelerikChartDemo.ChartUserControl2"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Chart"
             xmlns:charting="clr-namespace:Telerik.Charting;assembly=Telerik.Windows.Controls.Chart"
             xmlns:chartView="clr-namespace:Telerik.Windows.Controls.ChartView;assembly=Telerik.Windows.Controls.Chart"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:TelerikChartDemo"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.DataContext>
        <local:PerformanceViewModel />
    </UserControl.DataContext>
    <UserControl.Resources>
 
        <Style x:Key="ItemLabelStyle" TargetType="TextBlock">
            <Setter Property="Padding" Value="4"/>
            <Setter Property="Background" Value="LightBlue" />
            <Setter Property="Foreground" Value="Black" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="Black" />
                    <Setter Property="Foreground" Value="White" />
                    <!--<Setter Property="FontSize" Value="13.333" />
                    <Setter Property="FontWeight" Value="Bold" />-->
                </Trigger>         
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="6*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
 
        <chart:RadCartesianChart x:Name="RadCartesianChart"
                                  
                                 Palette="Windows8"
                                 Margin="0,18,0,0">
 
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartSelectionBehavior DataPointSelectionMode="Single" SelectionChanged="ChartSelectionBehavior_Changed" />
            </telerik:RadCartesianChart.Behaviors>
 
            <chartView:BarSeries ItemsSource="{Binding Q1}"
                                 ValueBinding="Performance"
                                 CategoryBinding="RepresentativeName"                          
                                
                                 ShowLabels="{Binding ShowLabels, Mode=TwoWay}"
                                 CombineMode="{Binding BarCombineMode, Mode=TwoWay}"
                               
                                 FontFamily="Segoe UI"
                                 FontSize="10">
            </chartView:BarSeries>
 
 
            <chart:RadCartesianChart.HorizontalAxis>
                <chartView:CategoricalAxis FontFamily="Segoe UI"
                                           FontSize="12"
                                           GapLength="{Binding GapLength}" />
            </chart:RadCartesianChart.HorizontalAxis>
 
            <chart:RadCartesianChart.VerticalAxis>
                <chartView:LinearAxis FontFamily="Segoe UI"
                                      FontSize="12"
                                      Title="{Binding AxisTitle}"
                                      Minimum="0"
                                      Maximum="{Binding AxisMaxValue}"
                                      LabelFormat="{Binding AxisLabelFormat}" />
            </chart:RadCartesianChart.VerticalAxis>
 
        
        </chart:RadCartesianChart>
 
    </Grid>
</UserControl>


Sam
Top achievements
Rank 2
 answered on 03 Nov 2016
2 answers
95 views

Hello,

dnd between two gridviews is not working since the upgrade from 2016.3.914.45 to 2016.3.1024.45.

In the OnDragInitialize methode I'm assigning a DnD object to eventargs.Data which is not recognized by the drop table "eventargs.Data.GetDataPresent()".
It worked perfectly in the previous version but caused yesterday a lot of trouble after upgrading an application to the latest version :(

 

        private void OnDragInitialize(object sender, Telerik.Windows.DragDrop.DragInitializeEventArgs ea) {
            string displayText = "";
            var selectedRows = ((RadGridView)sender).SelectedItems;
            if (selectedRows.Count == 0) {
                return;
            }

            var list = new List<PsCore.DataObjects.DragAndDrop.BusinessPartnerEntityDndDO>();
            foreach (PsCore.Interfaces.IDndDataObject row in selectedRows) {
                list.Add(new PsCore.DataObjects.DragAndDrop.BusinessPartnerEntityDndDO(row.PrimaryID, row.DisplayText));
                displayText = row.DisplayText;
            }
            ea.Data = new PsCore.DataObjects.DragAndDrop.DndContainerDO<PsCore.DataObjects.DragAndDrop.BusinessPartnerEntityDndDO>(list, displayText);

            ea.DragVisual = new ContentControl { ContentTemplate = LayoutRoot.Resources["DraggedItemTemplate"] as DataTemplate, Content = ea.Data };
            this.dragVisualTemp = ea.DragVisual;
            ea.DragVisualOffset = new Point(ea.RelativeStartPoint.X, ea.RelativeStartPoint.Y - 20);
            ea.AllowedEffects = DragDropEffects.All;
            ea.Handled = true;
        }



        private bool IsDndObjectAllowed(DragEventArgs ea) {
            Type dndContainerType = typeof(DndContainerDO<BusinessPartnerEntityDndDO>);
            if (!ea.Data.GetDataPresent(dndContainerType)) {
                Console.WriteLine("DND object NOT recognized");
                return false;
            }
            var draggedData = (ea.Data as DataObject).GetData(dndContainerType) as DndContainerDO<BusinessPartnerEntityDndDO>;
            if ((draggedData != null) && (draggedData.Items.GetType() == typeof(List<BusinessPartnerEntityDndDO>))) {
                return true;
            }
            return false;
        }

Best Regards,

Raul

Ivan Ivanov
Telerik team
 answered on 03 Nov 2016
8 answers
122 views

Hello, 

I want to add Windows8 and windows8theme to a RadGridView, but I cannot find this 2 themes.

I put other using this syntax 

StyleManager.ApplicationTheme = new TransparentTheme();

 

I fount that WPF Controls have these themes: 

Telerik WPF controls support the following themes:

Office_Black, Office_Blue, Office_Silver, Expression_Dark, Summer, Vista, Windows 7, Transparent, Windows8, Windows8Touch.

My version is 2012.1.326.40

Lance | Senior Manager Technical Support
Telerik team
 answered on 03 Nov 2016
1 answer
592 views

Hello,

i am trying to implement a command (LeftDoubleClick) from my view to viewmodel using mvvm pattern (without code behind and event).

I saw some samples but they don't work for me!

Please can someone tell me i i am making wrong?

xaml:

<telerik:RadGridView x:Name="radGridView" Margin="8" ItemsSource="{Binding Source={StaticResource DataSource}}"
   IsReadOnly="True"   >
 
        <telerik:RadGridView.InputBindings>
            <MouseBinding Gesture="LeftDoubleClick" helpers:AttachedMouseBinding.Command="{Binding Path=DoubleClickCommand}" />
        </telerik:RadGridView.InputBindings>
 
    </telerik:RadGridView>

 

.cs:

public class UC_SEGridViewModel : InterfaceDescription.ViewModels.ViewModelBase
{
    private ViewModelMaster viewModelMaster;
    public ICommand DoubleClickCommand { get; set; }
 
    public UC_SEGridViewModel()
    {
        DoubleClickCommand = new RelayCommand(GridItemDoubleClick);
    }
 
    private void GridItemDoubleClick(object obj)
    {
        //do something
    }
}

but i don't reach my callback method (GridItemDoubleClick) when i set a breackpoint

the helper:

public class AttachedMouseBinding
    {
        const string PROPERTYNAMECOMMAND = "Command";
 
        public static readonly DependencyProperty CommandProperty = DependencyProperty.RegisterAttached(PROPERTYNAMECOMMAND, typeof(ICommand),
            typeof(AttachedMouseBinding), new FrameworkPropertyMetadata(CommandChanged));
 
        private static void CommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FrameworkElement fe = d as FrameworkElement;
             
            ICommand command = e.NewValue as ICommand;
 
            InputBinding inputBinding = new InputBinding(command, new MouseGesture(MouseAction.LeftDoubleClick));
            fe.InputBindings.Add(inputBinding);
 
            //if (inputBinding != null)
            //    inputBinding.Command = command;
        }
 
        public static ICommand GetCommand(DependencyObject obj)
        {
            return (ICommand)obj.GetValue(CommandProperty);
        }
 
        public static void SetCommand(DependencyObject obj,ICommand value)
        {
            obj.SetValue(CommandProperty, value);
        }            
    }

 

Thanks for your help,

Richard

Ivan Ivanov
Telerik team
 answered on 03 Nov 2016
0 answers
100 views

Hi,

I have a usercontrol which is set IsEnabled = "False". Hence the RadGridView in the usercontrol will be light grey color. I had set the some of the cell to be in red color. Is there any way to avoid grey color for RadGridView when usercontrol is disabled.

Thanks.

CSL
Top achievements
Rank 1
 asked on 03 Nov 2016
3 answers
1.1K+ views

i have table like

 Id     Name      Age       Sex       Address

 1        xxx         23          m           yyyyyyyy

2        eee         24          f          zzzzzzzzzz

So i want the name When i select the row ,  so please tell me ............
Lance | Senior Manager Technical Support
Telerik team
 answered on 02 Nov 2016
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?