Telerik Forums
UI for WPF Forum
1 answer
113 views
Hi,

I'm using Telerik Control now for quite some time and telerik ist doing a great job on enhancing them. I like Telerik Controls a lot! But I live in Germany so I need to have all those nice features with german texts.

To simplify this task I build a very little app. And this App I want to share here, because I see a lot of questions in this direction...

I would like to attach the Code but it is not allowed to attach .zip files here in the forum...
so:

Create a WPF Solution, reference the Your telerik WPF DLLS and add the following Code and you will get all you need in the Textbox to implement in your real CustomLocalizationManager to get the Texts in your language.

MainWindow.xaml

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
 
        <TextBox Grid.Column="1" Text="{Binding Code}" Margin="10" VerticalScrollBarVisibility="Auto"/>
        
        <StackPanel Margin="10">
            <!-- TODO Put here all Telerik Controls to Localize-->
            <telerik:RadTreeView />
            <telerik:RadGridView />
        </StackPanel>
    </Grid>

ManiWindow.xaml.cs
    public partial class MainWindow : Window {
        private readonly MainWindowViewModel _mainWindowViewModel;
 
        public MainWindow() {
            _mainWindowViewModel = new MainWindowViewModel();
            LocalizationManager.Manager = new CustomLocalizationManager(_mainWindowViewModel);
            InitializeComponent();
            DataContext = _mainWindowViewModel;
        }
    }

MainWindowViewModel.cs
    public class MainWindowViewModel {
        public string Code { getset; }
    }

CustomLocalizationManager.cs

    public class CustomLocalizationManager : LocalizationManager {
        private readonly MainWindowViewModel _mainWindowViewModel;
 
        public CustomLocalizationManager(MainWindowViewModel mainWindowViewModel) {
            _mainWindowViewModel = mainWindowViewModel;
        }
 
        public override string GetStringOverride(string key) {
            var defaultText = base.GetStringOverride(key);
            _mainWindowViewModel.Code += GenerateCode(key, defaultText);
            return defaultText;
        }
 
        private static string GenerateCode(string key, string ret) {
            //TODO Change this line to get the Code you need
            return string.Format("   case \"{0}\": return \"{1}\";{2}", key, ret, Environment.NewLine);
        }
    }


Have fun :-)
Markus
Vlad
Telerik team
 answered on 06 Aug 2012
2 answers
157 views
Hi,

This is likely an uncommon question, but is it possible to set the column that the user clicks on to expand the tree and the same one that is indented, to be the second column (or any other column but the first one)?

Thanks
Peter
Top achievements
Rank 1
 answered on 05 Aug 2012
2 answers
309 views
Hi,

I'm trying to get Key Tips working for the buttons in my RadRibbonView. It's based on your mvvm example. I have managed to bind AccessText to the buttons with ease and to the RadRibbonGroup through a setter in ItemContainerStyle of the HierarchicalDataTemplate.

But none of these KeyTips will show unless the parent RadRibbonTab has AccessText set. But setting this property seems like a tough challenge.

<HierarchicalDataTemplate x:Key="GroupHeaderTemplate" ItemsSource="{Binding Buttons}"  DataType="{x:Type Menu:GroupViewModel}"
                   ItemTemplateSelector="{StaticResource groupsSelector}">
           <TextBlock Text="{Binding Text}" />
       </HierarchicalDataTemplate>
 
       <HierarchicalDataTemplate x:Key="TabTemplate" DataType="{x:Type Menu:TabViewModel}" ItemsSource="{Binding Groups}"                                             
                   ItemTemplate="{StaticResource GroupHeaderTemplate}">
           <HierarchicalDataTemplate.ItemContainerStyle>
               <!-- This works and AccessText binds to GroupViewModel.AccessText -->
               <Style TargetType="{x:Type telerik:RadRibbonGroup}">
                   <Setter Property="telerik:KeyTipService.AccessText" Value="{Binding AccessText}" />
               </Style>
           </HierarchicalDataTemplate.ItemContainerStyle>
           <TextBlock Text="{Binding Text}" />
       </HierarchicalDataTemplate>

Update:
I tried setting ItemContainerStyle directly on RibbonView, now KeyTips show for the Tabs, but not for Groups or Buttons (even though the AccessText property is invoked on each viewmodel)
<telerik:RadRibbonView  x:Name="ribbonView" ApplicationButtonVisibility="Collapsed"
                      VerticalAlignment="Top" ItemTemplate="{StaticResource TabTemplate}" ItemsSource="{Binding Tabs}"
                       Title="{Binding Title}" SelectedItem="{Binding SelectedTab, Mode=TwoWay}"                       
                      telerik:KeyTipService.IsKeyTipsEnabled="true"                       
                      telerik:KeyTipService.AccessKey="ALT">
          <telerik:RadRibbonView.QuickAccessToolBar>
              <telerik:QuickAccessToolBar ItemsSource="{Binding QuickAccessItems}"
                      ItemTemplate="{StaticResource ButtonTemplate}" />
          </telerik:RadRibbonView.QuickAccessToolBar>
  <telerik:RadRibbonView.ItemContainerStyle>
      <!-- This style seems to affect all containers, tabs, groups and buttons -->
          <Style>                   
              <Setter Property="telerik:KeyTipService.AccessText" Value="{Binding AccessText}" />
          </Style>
  </telerik:RadRibbonView.ItemContainerStyle>
  </telerik:RadRibbonView>

I am trying to implement a very standard feature...
 Please help me,
Thanks
Oscar Ågren
Top achievements
Rank 1
 answered on 04 Aug 2012
0 answers
109 views
I have hierarchy level RadGridView in wpf application. I want to export all level data in excel format. But it exports only first level data into excel.

waiting for your reply
thank you. 
Nikita
Top achievements
Rank 1
 asked on 04 Aug 2012
1 answer
511 views
Hi all,

Is there a way to increase or decrease the spacing between letters in a word (code behind)?

thanks
Iva Toteva
Telerik team
 answered on 03 Aug 2012
1 answer
134 views
Sir,

I have a situation where i want to handle Handling One to Many relation in Mail Merge of radrichtextbox.

e.g

 

 

public class Employee

 { 

public string FirstName { get; set; }  

public string LastName { get; set; }  

public string JobTitle { get; set; }  

public List<Address> EmpAddress { get; set; }  

}

 

public class Address  

public string Addresses { get; set; }  

}

How i will handle this situation in the case of Mail Merge. Where i want to show one employee with its multiple addresses in the table in the mail merge.

Thanks
Rizwan

Iva Toteva
Telerik team
 answered on 03 Aug 2012
0 answers
202 views
Hello


There is a demo application to test some components of telerik. No complex code, only "play" with some properties.

From visual studio works great, including the publication did not present any problems, no warning, no errors.

So far so good ...

However, when you want to run the published application from the IE browser, it displays an error window abruptly.

Running the application from within visual studio shows aparentmente an initialization error telerik controls, something like:

System.TypeInitializationException was unhandled<br>Message: Se produjo una excepción en el inicializador de tipo de 'Telerik.Windows.Documents.UI.Extensibility.RadCompositionInitializer'.


This application in the event Page_Loaded performs an initial load of data in a RadGridView against sqlserver is performed without any problems, showing the data and then to the second application is aborted with the error described above.

How I can solve this?


In advance thank you all ....
Romell
Top achievements
Rank 1
 asked on 03 Aug 2012
5 answers
253 views
Am I aiming for the wrong thing to think I can use the RadTimePicker to select a Timepsan?

I need get rid of the AM PM and also stop it from thinking/displaying 00:00:00 as 12:00PM?

ohhh and what exactly am i binding to? SelectedTime={binding TimeSpan}?

thanks in advance

Michael
Michael
Top achievements
Rank 1
 answered on 03 Aug 2012
3 answers
149 views
Hi,

I have created new GridViewDateTimeColumn that will handle DateTime properties. In this column I have added one dependency property that will define StringFormat for DateTime values.

// Dependency Property
public static readonly DependencyProperty StringFormatProperty =
             DependencyProperty.Register("StringFormat", typeof(string),
             typeof(GridViewDateTimeColumn), new FrameworkPropertyMetadata(string.Empty, StringFormatChanged));
 
public string StringFormat
{
    get { return (string)GetValue(StringFormatProperty); }
    set { SetValue(StringFormatProperty, value); }
}
 
private static void StringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var column = (GridViewDateTimeColumn)d;
    column.DataMemberBinding.StringFormat = e.NewValue.ToString();
    column.Refresh();
}

xaml

<my_controls:GridViewDateTimeColumn DataMemberBinding="{Binding SomeDateTimeProperty, Mode=TwoWay}"
                 StringFormat="{Binding DataContext.StringFormat, RelativeSource={RelativeSource AncestorType=UserControl}}"
                                                        >

However, since the cell/column layout is created only once, I am unable to force the Column to rebind its values. StringFormatChanged is executed, and StringFormat property for column DataMemberBinding is set correctly, but original StringFormat is still active.

How can I make this work?

Regards,
Goran
Goran
Top achievements
Rank 1
 answered on 03 Aug 2012
3 answers
142 views
Hello,

I have a TreeListView which is supposed to show a collection with different filters applied in two view states, the states are maintained by one bool property in the view model.

The value converter works correctly in that I can see the values being passed and returned, and in one of the states all items in the collection are shown correctly in the view. When switching back to the previous state, and the second collection view is bound, only a few of the rows are shown, even though this second collection contains the required number rows.

<telerik:RadTreeListView.ItemsSource><br>               
<
MultiBinding Converter="{StaticResource IsExpandedToCollectionViewConverter}">
                    <Binding Path="IsExpanded"/>
                    <Binding Path="DataContext" RelativeSource="{RelativeSource AncestorType=Grid}"/>
        </MultiBinding>
</telerik:RadTreeListView.ItemsSource>


The above code shows how the ItemsSource is bound, the IsExpanded property maintains the state is a boolean, and DataContext is the viewModel with the two collection view properties.

The two collectionview sources are SummaryView and SortedView. When the control is first loaded, the summary view is shown, when expanded the SortedView is shown. 

Additionally, if the SummaryView is empty, then the Visibility of the treelistview is set to collapsed. In the expanded view the treelistview, the visibility however works fine.

Thank You

Hasanain



Vera
Telerik team
 answered on 03 Aug 2012
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
DataPager
PersistenceFramework
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?