Telerik Forums
UI for WPF Forum
2 answers
415 views
Additional information: A 'MultiBinding' cannot be set on the 'DataMemberBinding' property of type 'GridViewHyperlinkColumn'. A 'MultiBinding' can only be set on a DependencyProperty of a DependencyObject.

I run into this pretty much everywhere in Telerik components. MultiBinding is never supported :(

<telerik:GridViewHyperlinkColumn.DataMemberBinding>
<MultiBinding StringFormat="{}{0}x{1}">
    <Binding Path="X" />
    <Binding Path="Y" />
</MultiBinding>
</telerik:GridViewHyperlinkColumn.DataMemberBinding>
Kristoffer
Top achievements
Rank 1
 answered on 18 Mar 2013
5 answers
513 views

I am using Telerik WPF Q3 2012.

I am following the example in http://www.telerik.com/help/wpf/raddataform-customized-fields.html

Since I can only upload images, I am including the text of MainWindow here (see below).

Summary;

  • When I use the standard DataFormDataField with Label and DataMemberBinding, things are good (I can see data and it is read only until I click Edit).
  • When I use the DataFormDataField.ContentTemplate as per the example, I see a blank label and blank text field. I can not change the data
  • When I tried DataFormDataField.Content, I can see the data but it is always writable (even before I click the edit button).

I would like to get the DataFormDataField.ContentTemplate working so I can create the field layout that I want. I think I am missing something.

Please help

Thank you
Mark

------------MainWindow.xaml.cs ----------------

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Example
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            MyDataForm.ItemsSource = GetData();
        }
        private ObservableCollection<TestData> GetData()
        {
            ObservableCollection<TestData> result = new ObservableCollection<TestData>();

            TestData a = new TestData()
            {
                Name = "Hello",
                Remark = "Where are you?",
                Comment = "Bye"
            };

            result.Add(a);
            return result;
        }

        private void MyDataForm_EditEnded_1(object sender, Telerik.Windows.Controls.Data.DataForm.EditEndedEventArgs e)
        {
            TestData a = MyDataForm.CurrentItem as TestData;
            // Notice that a.Remark is not changed event if you edit data in the remarks field
        }
    }
    public class TestData
    {
        public String Name { get; set; }
        public String Remark{ get; set; }
        public String Comment { get; set; }
    }
}

----------------- MainWindow.xaml ---------------

 

<Window x:Class="Example.MainWindow"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.Resources>
            <DataTemplate x:Key="MyDataTemplate">
                <StackPanel>
                   
                    <!-- Basic definition -->
                    <telerik:DataFormDataField Label="Name" DataMemberBinding="{Binding Name}" ToolTip="Basic Layout" />
                   
                    <!-- Based on Custom Fields example, but nothing is displayed -->
                    <telerik:DataFormDataField ToolTip="Nothing is displayed"  >
                        <telerik:DataFormDataField.ContentTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Vertical">
                                    <TextBox Text="Remarks"  Background="Green"/>
                                    <TextBox Text="{Binding Remarks, Mode=TwoWay}" />
                                </StackPanel>                               
                            </DataTemplate>
                        </telerik:DataFormDataField.ContentTemplate>
                    </telerik:DataFormDataField>
                   
                    <!-- Another Attempt, but it is readable before click Edit button -->
                    <telerik:DataFormDataField Label="Comment" ToolTip="Always Editable" >
                        <telerik:DataFormDataField.Content>
                            <TextBox Text="{Binding Comment, Mode=TwoWay}" />
                        </telerik:DataFormDataField.Content>
                    </telerik:DataFormDataField>

                </StackPanel>
            </DataTemplate>
        </Grid.Resources>

        <!-- Metadata information -->
        <telerik:RadDataForm x:Name="MyDataForm"
                             AutoGenerateFields="False"
                             ReadOnlyTemplate="{StaticResource MyDataTemplate}"
                             EditTemplate="{StaticResource MyDataTemplate}"
                             CommandButtonsVisibility="Edit,Commit, Cancel"
                             EditEnded="MyDataForm_EditEnded_1">
        </telerik:RadDataForm>

    </Grid>
</Window>

 

Ivan Ivanov
Telerik team
 answered on 18 Mar 2013
3 answers
447 views
Hi,

I was using 2012.1 version of WPF.
Now am planning to upgrade to 2013 Q1 (Am using 2013.1.220.40 version).
Am using a RibbonBar in the old version. Since I can't find RibbonBar in the new release, am converting it to RibbonView. Should I convert?

If Yes, then I was using TabStripPanel as below,

xmlns:Telerik_Windows_Controls_RibbonBar_Primitives="clr-namespace:Telerik.Windows.Controls.RibbonBar.Primitives;assembly=Telerik.Windows.Controls.RibbonBar"

<telerikNavigation:RadTabControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <Telerik_Windows_Controls_RibbonBar_Primitives:TabStripPanel
IsItemsHost="True" SeparatorOpacityThreshold="3"
VariablePaddingLength="15" />

                                    </ItemsPanelTemplate>
                                </telerikNavigation:RadTabControl.ItemsPanel>

After Converting to RibbonView, below is my code

    xmlns:Telerik_Windows_Controls_RibbonBar_Primitives="clr-namespace:Telerik.Windows.Controls.RibbonView.Primitives;assembly=Telerik.Windows.Controls.RibbonView"

<telerikNavigation:RadTabControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <!--<Telerik_Windows_Controls_Primitives:TabStripPanel
IsItemsHost="True" SeparatorOpacityThreshold="3"
VariablePaddingLength="15" />-->
                                        <Telerik_Windows_Controls_Primitives:TabStripPanel
IsItemsHost="True" Opacity="3" />
                                    </ItemsPanelTemplate>
                                </telerikNavigation:RadTabControl.ItemsPanel>

After this change, my RadRibbonTab items are not getting displayed.

Below are my questions,

1. I can't find SeparatorOpacityThreshold="3" VariablePaddingLength="15" in RibbonView TabStripPanel.
Is this the reason?
2. Doesn't the TabStripPanel work in RadRibbonView? If not, how will i display RadRibbonTab Items in a RibbonView?

Cheers
VS
Top achievements
Rank 1
 answered on 18 Mar 2013
2 answers
475 views
Hi!

I'm using RadTabControl as a Prism region and Tab items are successfully created. I have a Shell window which has a RadTabControl. Can I somehow get the view/viewmodel of the selected TabItem (tab's content) when TabControl's selected item changes so that I could call a method of that view model?

All of this is because I'm using PRISM RegionNavigationService in the Shell's viewmodel and I want each tab to be able to publish their NavigationService via EventAggregator event when tab is selected.

Other ways of doing this are also accepted of course :)

Br,

Kalle
Kalle
Top achievements
Rank 1
 answered on 16 Mar 2013
4 answers
746 views
Hello Telerik Team,
I have one more stupid question about GridView component. Our application have a main window with menu toolbar and frame which is filled by some content (page with gridview) which is selected by some button or menu item. When I click on the button (menu item), I would like to show my data grid in content frame, however grid loading time seems to me quite long. First, i thought it is caused by cell templates/metro style/disabled virtualization/placing into grid without fixed size ... , but then a make a simplification and application behaves exactly the same. It means, that I have approximatelly at least 2-3s data grid loading time after click on the button even if I display only few records (about 3 columns and 40 rows). It can be quite annoying for our users, thus i would like to ask You, if there is some technique to decrease this loading time or You can identify some fault I made in the code??? I made a simplification of our project, but because i cannot attach compressed source codes, i try to add some code in this post. It seems to me, that i have used all possible actions described in your "performance guide" or those described in forums (default theme, no cell templates, virtualization, fixed size, read only, simple binding, ...).

MainVindow.xaml
<Window x:Class="SimpleGrid.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="280" />
        </Grid.RowDefinitions>
        <StackPanel  Grid.Row="0">
            <Button Content="Create grid" x:Name="button1" Grid.Row="0" Click="button1_Click"/>          
        </StackPanel>
        <Frame x:Name="Frame1" Background="Black" Grid.Row="1"  Height="280" Width="500"/>
         
    </Grid>
</Window>

MainWindow.xaml.cs
namespace SimpleGrid
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Page p = new Grid();
            this.Frame1.Content = p;        
        }
       
    }
}

Grid.xaml (grid page to be inserted)
<Page x:Class="SimpleGrid.Grid"
      xmlns:my="clr-namespace:SimpleGrid"
      mc:Ignorable="d"
      d:DesignHeight="280" d:DesignWidth="500"
    Title="Grid">
    <Page.Resources>
        <my:MyViewModel x:Key="MyViewModel"/>       
    </Page.Resources>
     
     <Grid DataContext="{StaticResource MyViewModel}"  Height="280" Width="500">
 
            <telerik:RadGridView
                                Name="clubsGrid"
                                ItemsSource="{Binding Clubs}"
                                AutoGenerateColumns="False"        
                                ShowGroupPanel="False"
                                IsReadOnly="True"
                                MaxHeight="280"
                                MaxWidth="500"
                                EnableColumnVirtualization="True"
                                EnableRowVirtualization="True"
                                CanUserFreezeColumns="False"
                                RowIndicatorVisibility="Collapsed"
                                CanUserResizeColumns="False">
 
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Width="155" IsGroupable="False" IsFilterable="False" IsSortable="False"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Established}" Header="Est." Width="180" IsGroupable="False" IsFilterable="False" IsSortable="False"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}"  Header="Stadium" Width="155" IsGroupable="False" IsFilterable="False" IsSortable="False"/>                   
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
     </Grid>
</Page>

Data are binded from MyViewModel.cs + Clubs.cs which is used in your examples  (322627_RadGridView-WPF-AR-20).


George
Top achievements
Rank 1
 answered on 16 Mar 2013
3 answers
109 views
print for  Diagram  didnot print as shapes loacation , it always print from page start
how i can solve it
Ahmed
Top achievements
Rank 1
 answered on 15 Mar 2013
2 answers
116 views
Is it possible with RadDocking to do this?   Windows start out four floating (ToolWindow) windows all the same sized squares.  The docking area is made up of four equally sized squares.   The user can essentially snap the floatings window into one of those four squares, or leave it floating.  So the key point is the ToolWindow never loses its size.   Right now I have them set to 400x400.  

The idea is the user has a dashboard and can snap in window/user controls or leave them floating.
Tina Stancheva
Telerik team
 answered on 15 Mar 2013
1 answer
80 views
Hi,
first my situation. I use a RadGridView with following settings:
CanUserSortColumns="False"
CanUserReorderColumns="False"
ShowGroupPanel="True"
AutoGenerateColumns="False"

Some of my Columns contains following property:
IsGroupable="False"

1) The user has the ability to reorder the columns, only because of activating the GroupPanel.

2) I want to block the ability to drag columns which are not groupable. In the moment the user can drag them and can't drop them on the GroupPanel. Is there a known way to handle these request?

Thanks for support.
Mark
Top achievements
Rank 1
 answered on 15 Mar 2013
1 answer
113 views
Hi,

Code below!

I am using a converter to change the fontweight or foreground color.  The problem only occurs when the number of rows exceed available screen space.  Assume that the visible portion of the column has one visible cell with a fontweight of Bold.  When you scroll down to see the remaining rows there may be one row where that cell is also bold.  Also of interest is that the converter was not executed for someof the scrolled items.  When I increase the screen height and try it again there is no problem.

Thanks
Rich



<telerik:GridViewDataColumn
        IsFilterable="False" 
        Width="*"
        Name="ColumnName"
        Header="Column Name"
        DataMemberBinding="{Binding ColumnName}">
    <telerik:GridViewDataColumn.CellStyle>
    <Style TargetType="telerik:GridViewCell">
<Setter Property="FontWeight" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Converter={StaticResource FontConverter}}"/>
                <Setter Property="Foreground" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Converter={StaticResource ForegroundConverter}}"/>
</Style>
    </telerik:GridViewDataColumn.CellStyle>
</telerik:GridViewDataColumn>


public class FontConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        FontWeight fontWeight = new FontWeight();
        AvailableColumnItem availableColumnItem = ((GridViewRowItem)((GridViewCell)value).ParentRow).DataContext as AvailableColumnItem;
        if (availableColumnItem.IsPrimaryKey)
            fontWeight = FontWeights.Bold; 
        else
            fontWeight = FontWeights.Normal;
        return fontWeight;
    }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}


public class ForegroundConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        Brush foreground; 
        AvailableColumnItem availableColumnItem = ((GridViewRowItem)((GridViewCell)value).ParentRow).DataContext as AvailableColumnItem;
        Debug.WriteLine(availableColumnItem.ColumnName);
        if (availableColumnItem.IsPrimaryKey)
            foreground = new SolidColorBrush(Colors.DarkSlateGray);
        else
            foreground = new SolidColorBrush(Colors.Black);
        return foreground;
        }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

Yordanka
Telerik team
 answered on 15 Mar 2013
1 answer
157 views
I have an application where I use MEF to dynamically load XAP and use composition imports/exports to load the views.
Using the same exact view in a project without MEF, everything works fine.
But, when I use that view in my MEF project, the documents are not loaded.
It use to work properly until I updated to version 2013.1.0220.  I noticed that there were more requirements for DLLs and added them to both projects.  What could be the problem?  I have spent several hours trying to figure out the issue.
What I'm trying to do is just open a PDF from the client PC using the "Open" command from the toolbar (I'm using the exact code as the example in the Demos).

By the way,  My solution is too big to send to you, so in case you need to see it would be better to give you access to my PC and have a life chat/call to explain to you where to find things.  

Thank you.
Kammen
Telerik team
 answered on 15 Mar 2013
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
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?