Telerik Forums
UI for WPF Forum
1 answer
243 views
I have to implement multilingual support for an application that is mainly an winform application. But some ​forms  of the application has been converted to WPF and they used Telerik RadGridview control. These WPF forms are launched from inside the Winform application. So the WPF project does not have any app.xaml.cs files , so no app_startup event. From examples I have seen that the UICulture has to be set in that event . Also the Localization manager has to be set in that particular event. I have tried setting the culture in form level, before initializing components, but did not work. Is there a way to implement Localization for Telerik controls in the mentioned scenario ?
Tanya
Telerik team
 answered on 20 Jul 2015
1 answer
378 views

In the below attached Code Snippet, ​While trying to generate a gridview dynamically , I was not able to bind the values of Datable to to Combox Column.

I have tried populating combox items but when I select a Value its saving back to the Datatable.

Please help me out to bind the Datable Value to Combo box selected value and save the new item selected from the combox list back to the Datatable

 

 


this.ItemsGrid.ItemsSource = this.Datable1.DefaultView;
List<LOV> lovs = new List<LOV>();
lovs.Add(new LOV { Id= "1", Value = "test1" });
lovs.Add(new LOV { Id= "2", Value = "​test2" });
lovs.Add(new LOV { Id= "3", Value = "​test3" });
lovs.Add(new LOV { Id= "4", Value = "​test4" });
lovs.Add(new LOV { Id= "5", Value = "test5" });

foreach ( Car cr in Cars)
{
switch (cr.CONTROL_TYPE.ToUpper())
{
case "COMBOBOX":
Telerik.Windows.Controls.GridViewComboBoxColumn comboBoxColumn = new Telerik.Windows.Controls.GridViewComboBoxColumn();                       comboBoxColumn.DataMemberBinding = new Binding(cr.Name);
comboBoxColumn.ItemsSource = lovs;
comboBoxColumn.DisplayMemberPath = "Value";
comboBoxColumn.SelectedValueMemberPath = "Id";
comboBoxColumn.Header = cr.Name;
this.ItemsGrid.Columns.Add(comboBoxColumn);
break;

case "TEXTBOX":
Telerik.Windows.Controls.GridViewDataColumn txtBoxColumn = new Telerik.Windows.Controls.GridViewDataColumn();
txtBoxColumn.DataMemberBinding = new Binding(cr.Name);
txtBoxColumn.Header = cr.Name;
this.ItemsGrid.Columns.Add(txtBoxColumn);
break;

case "CHECKBOX":
Telerik.Windows.Controls.GridViewCheckBoxColumn chkBoxColumn = new Telerik.Windows.Controls.GridViewCheckBoxColumn();
chkBoxColumn.DataMemberBinding = new Binding(cr.Name);
chkBoxColumn.Header = cr.Name;

this.ItemsGrid.Columns.Add(chkBoxColumn);
break;
}
}


public class LOV
{       
public string Id {get;set;}
public string Value{get;set;}
}

Dimitrina
Telerik team
 answered on 20 Jul 2015
5 answers
871 views
In my application I do not want to waste the space in TitleBar. So I wanted to have the menu in TitleBar. How do I achieve it using Rad controls of Telerik?
Martin Ivanov
Telerik team
 answered on 20 Jul 2015
7 answers
226 views

Please see my attach screenshot.

I want to add little point over each point in my chart view

Martin Ivanov
Telerik team
 answered on 20 Jul 2015
5 answers
170 views

hi i can change color but still i have any color in my bar series

i want remove white color and Be consistent colors

just blue color

remove gradient color

Milena
Telerik team
 answered on 20 Jul 2015
1 answer
284 views

We are using WPF telerik control RadColorPicker. In the beginning, we choose to set null color for the entity. The problem is, this null color is being treated as black color by the RadColorPicker and so we can't apply a black color immidiately. Refer to the working code below

XAML:

<telerik:RadColorPicker x:Name="radColorPicker" IsRecentColorsActive="True" SelectedColor="{Binding Path=MyColor}" SelectedColorChanged="radColorPicker_SelectedColorChanged">
<telerik:RadColorPicker.ContentTemplate>
<DataTemplate>
<Rectangle MinWidth="40" MinHeight="20">
<Rectangle.Fill>
<SolidColorBrush Color="{Binding ElementName=radColorPicker, Path=SelectedColor, Mode=TwoWay}"/>
</Rectangle.Fill>
</Rectangle>
</DataTemplate>
</telerik:RadColorPicker.ContentTemplate>
</telerik:RadColorPicker>

Code Behind/View Model:

public Window9()
{
InitializeComponent();
this.DataContext = this;

MyColor = null; // I can't apply a black color in this case because null is being treated as black color
//MyColor = "Red"; // I can apply a black color, when the already applied color is red.
}

private void radColorPicker_SelectedColorChanged(object sender, EventArgs e)
{
MessageBox.Show("Color changed!");
}

public string MyColor { get; set; }

 

However, if I would choose some other color than black, say Red, then after that I am able to apply a black color or if we by default set a red color first as shown in the code, then also we would be able to set a black color.
How to make RadColorPicker treat null color as null only and not black, so that we can apply black color immidiately.​

 

Petar Mladenov
Telerik team
 answered on 20 Jul 2015
3 answers
258 views

I have followed this guide line for custom date format dd mmm yyyy (http://docs.telerik.com/devtools/wpf/controls/raddatetimepicker/features/formatting.html#changing-the-display-format)

 But it affected date resolution when I manual enter date. Please refer attached screenshot.

 

Rosi
Telerik team
 answered on 17 Jul 2015
3 answers
123 views
We are back on trying your suite, and we have encountered a little situation with the RadMaskedNumericInput
If the user enter any number, and then selects all the content and press DEL or Backspace, it shows "0" (thats what we want). BUT, if the user then selects all the content again and again press DEL or Backspace, then the text is empty, although the Value property still is 0. We want that everytime that the content is deleted, allways the maskedinput shows "0" (or 0.00 if its double / decimal)

The steps:
1) input any numer:  4587
2) Shift+home to select all
3) DEL to delete (it shows 0, OK!)
4) shit+home to select all, again
5) DEL to delete (it should show 0, but it is empty! BAD!)


Here is a simple App:


<Window
        x:Class="WpfApplication3.MainWindow"
        xmlns:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
 
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
 
        <telerik:RadMaskedNumericInput            
            Grid.Column="0"
            IsClearButtonVisible="False"            
            UpdateValueEvent="PropertyChanged"
            SpinMode="PositionAndValue"
            Mask="#4"
            Culture="es-AR"
            HorizontalAlignment="Left"
            Margin="3" 
            maskedInput:MaskedInputExtensions.AllowNull="False"           
            maskedInput:MaskedInputExtensions.Maximum="7500"
            maskedInput:MaskedInputExtensions.Minimum="0"
            AllowInvalidValues="False"
            x:Name="MyMasked"
            />
 
        <TextBlock Text="{Binding ElementName=MyMasked,Path=Value}" Grid.Column="1" />
         
        <Button Grid.ColumnSpan="2" Grid.Row="1" Content="SAVE" />
 
    </Grid>
</Window>
Petar Mladenov
Telerik team
 answered on 17 Jul 2015
23 answers
3.3K+ views
Hello,
I'm trying to use the Expression Dark in a WPF application and can not find a way to have the window background automatically to the right color.
Following what I've found in the forums, documentations and examples, I've come with the following code, but it does not work: the window background remains white. I know that I can code manually the background of the window to Black, but I really want the theme to be changeable, so I want the color to come from the theme.

MainWindow.xaml.cs:
using System;
using System.Windows;
using Telerik.Windows.Controls;
 
namespace WpfApplication2
{
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      StyleManager.ApplicationTheme = new Expression_DarkTheme();
      InitializeComponent();
    }
  }
}

MainWindow.xaml:
<Window
  x:Class="WpfApplication2.MainWindow"
  xmlns:tkqs="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
  Title="MainWindow" Height="350" Width="525">
  <Grid tkqs:ThemeAwareBackgroundBehavior.IsEnabled="True"
        tk:StyleManager.Theme="Expression_Dark">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <TextBlock HorizontalAlignment="Left"
               Margin="5"
               Text="TextBlock"
               tk:StyleManager.Theme="Expression_Dark" />
    <TextBox HorizontalAlignment="Left"
             Margin="5"
             Text="TextBox"
             tk:StyleManager.Theme="Expression_Dark"
             Grid.Row="1" />
    <Button Content="Button"
            HorizontalAlignment="Left"
            Margin="5"
            tk:StyleManager.Theme="Expression_Dark"
            Grid.Row="2" />
  </Grid>
</Window>

What must I change to have the background changed automatically?

Patrick
Masha
Telerik team
 answered on 17 Jul 2015
1 answer
410 views

I have a GridView where the ItemsSource is bound to the PagedSource property of a DataPager.  The DataPager ItemsSource is bound to an EntityDataSource.  The problem is that this is blocking my UI thread.  The GridView has a "DataLoadMode" property which can be set to Asynchronous... but the pager doesn't.  How would I go about loading the data to the pager asynchronously?  I tried doing this in another thread but I keep getting a cross-thread exception even though I use the dispatcher to set the property to which the pager is bound.

 

<telerik:RadGridView x:Name="RadGridView1"
                                         Grid.Row="0"
                                         Margin="5,5,5,0"
                                         HorizontalAlignment="Stretch"
                                         VerticalAlignment="Stretch"
                                         AlternateRowBackground="LightBlue"
                                         AlternationCount="2"
                                         AutoGenerateColumns="False"
                                         CanUserDeleteRows="False"
                                         CanUserFreezeColumns="False"
                                         CanUserInsertRows="False"
                                         DataLoadMode="Asynchronous"
                                         GroupRenderMode="Nested"
                                         IsReadOnly="True"
                                         ItemsSource="{Binding ElementName=DataPager1,
                                                               Path=PagedSource}"
                                         RowIndicatorVisibility="Collapsed"
                                         ShowGroupPanel="False"
                                         telerik:StyleManager.Theme="Summer">
                        <telerik:RadGridView.Columns>
 
                            <telerik:GridViewDataColumn Width="60"
                                                        DataMemberBinding="{Binding StoreNumber}"
                                                        Header="Store"
                                                        ShowDistinctFilters="True"
                                                        ShowFieldFilters="False"
                                                        TextAlignment="Center" />
 
                            <telerik:GridViewDataColumn Width="80"
                                                        DataFormatString="dd-MMM-yyyy"
                                                        DataMemberBinding="{Binding ASNDate}"
                                                        Header="Ship Date"
                                                        ShowDistinctFilters="False"
                                                        SortingState="Descending"
                                                        TextAlignment="Center" />
 
                            <telerik:GridViewDataColumn Width="Auto"
                                                        MinWidth="80"
                                                        DataMemberBinding="{Binding PONumber}"
                                                        Header="PO"
                                                        ShowDistinctFilters="False"
                                                        TextAlignment="Center" />
 
                            <telerik:GridViewDataColumn Width="80"
                                                        DataFormatString="dd-MMM-yyyy"
                                                        DataMemberBinding="{Binding PODate}"
                                                        Header="PO Date"
                                                        ShowDistinctFilters="False"
                                                        TextAlignment="Center" />
 
                            <telerik:GridViewDataColumn Width="Auto"
                                                        MinWidth="80"
                                                        DataMemberBinding="{Binding InvoiceNumber}"
                                                        Header="Invoice"
                                                        ShowDistinctFilters="False"
                                                        TextAlignment="Center" />
 
                            <telerik:GridViewDataColumn Width="Auto"
                                                        DataMemberBinding="{Binding ToteID}"
                                                        Header="Tote"
                                                        ShowDistinctFilters="True"
                                                        TextAlignment="Center">
                                <telerik:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Width="Auto"
                                                   Height="Auto"
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Center">
                                            <Hyperlink Click="OnToteClick" Tag="{Binding}">
                                                <TextBlock Width="Auto"
                                                           Height="Auto"
                                                           HorizontalAlignment="Center"
                                                           VerticalAlignment="Center"
                                                           Text="{Binding ToteID}" />
                                            </Hyperlink>
                                        </TextBlock>
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
 
                            <telerik:GridViewDataColumn Width="80"
                                                        DataFormatString="dd-MMM-yyyy"
                                                        DataMemberBinding="{Binding Closed}"
                                                        Header="Completed"
                                                        ShowDistinctFilters="False" />
 
                            <telerik:GridViewDataColumn Width="Auto"
                                                        DataMemberBinding="{Binding ClosedByName}"
                                                        Header="Complete By"
                                                        ShowDistinctFilters="True"
                                                        ShowFieldFilters="False"
                                                        TextAlignment="Center" />
 
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
 
                    <telerik:RadDataPager x:Name="DataPager1"
                                          Grid.Row="1"
                                          Width="{Binding ActualWidth,
                                                          ElementName=RadGridView1}"
                                          Margin="5,0,5,5"
                                          DisplayMode="FirstLastPreviousNextNumeric"
                                          PageSize="{Binding PageSize,
                                                             Mode=TwoWay}"
                                          Source="{Binding ShipmentData}"
                                          telerik:StyleManager.Theme="Summer" />

 

public class ShipmentsViewModel : ViewModelBase
    {
        private readonly TIMS.Data.TIMSContext ctx =new Data.TIMSContext();
 
        public ShipmentsViewModel()
        {
            
        }
 
        #region Properties
 
        private int PageSizeValue = 20;
        public int PageSize
        {
            get { return PageSizeValue; }
            set
            {
                SetPropertyValue((() => PageSize), ref PageSizeValue, value);
            }
        }
 
 
        private QueryableEntityCollectionView<TIMS.Data.Entities.ToteView> ShipmentDataValue;
        public QueryableEntityCollectionView<TIMS.Data.Entities.ToteView> ShipmentData
        {
            get {
                    return ShipmentDataValue;
            }
            private set
            {
                SetPropertyValue((() => ShipmentData), ref ShipmentDataValue, value);
            }
        }
 
        #endregion
 
        #region Methods
 
        public override void OnNavigatedTo(Uri view, object data)
        {
            try
            {
                IsBusy = true;
                System.Threading.ThreadPool.QueueUserWorkItem(delegate
                {
                    var shipments = new QueryableEntityCollectionView<Data.Entities.ToteView>(((IObjectContextAdapter)ctx).ObjectContext, "ToteViews");
                    if (App.Store != null)
                    {
                        shipments.FilterDescriptors.Add(new FilterDescriptor("StoreNumber", FilterOperator.IsEqualTo, App.Store.Value, false));
                    }
 
 
                    App.Current.Dispatcher.Invoke(new Action(delegate
                    {
                        ShipmentDataValue = shipments;
                        IsBusy = false;
                    }));
 
                });
            }
            catch (Exception e)
            {
                App.Current.Dispatcher.BeginInvoke(new Action(delegate
                {
                    var dlg = new ChildWindows.ErrorDialog("0012:  An unknown error occured.");
                    App.LogError(e);
                    dlg.ShowDialog();
                    IsBusy = false;
                }));
            }
        }
 
        #endregion
 
        #region Commands
 
 
        #endregion
    }

Dimitrina
Telerik team
 answered on 16 Jul 2015
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?