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

Is there planned to insert the Excel Index function in the future?
Boryana
Telerik team
 answered on 18 Sep 2013
2 answers
668 views
Hi,
I'm using Telerik controls with version 2013.2.724.40, and VS 2010.
In the following code example, I'd like to use tab to navigate only between the 3 TextBoxes. IsTabStop is set to false, but the tab still stops at the RadExpander, is it an expected behavior?

Thanks.
Gong

<telerik:RadWindow x:Class="ExpanderWpfApp.MainWindow"
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                   Height="300" Width="300" >
    <StackPanel>
        <TextBox/>
        <telerik:RadExpander IsExpanded="True" IsTabStop="False">
            <TextBox/>
        </telerik:RadExpander>
        <TextBox/>
    </StackPanel>
</telerik:RadWindow>

Vadimir
Top achievements
Rank 1
 answered on 18 Sep 2013
4 answers
986 views
I have a situation where I would like to be able to add property definitions from code behind, however it doesn't appear to be working properly.

Here's what I have: I made a custom object for use in xaml called a PropertyDefinitionList:

public class PropertyDefinitionList : List<Telerik.Windows.Controls.Data.PropertyGrid.PropertyDefinition>
{
    public PropertyDefinitionList() { }
}

In a resource dictionary I instance such a list like follows:

<local:ObjectPropertyFilterList x:Key="PropertyDefinitions" >
    <propertyGrid:PropertyDefinition Binding="{Binding Name}" />
    <propertyGrid:PropertyDefinition Binding="{Binding ID}" />
</local:ObjectPropertyFilterList>

I get a reference to this list in my code behind and call it PropertyList. At a certain
point I want to the property definitions to the .PropertyDefinitions collection on the
RadPropertyGrid, so in the function that does it I have the following code:

rpg1.PropertyDefinitions.AddRange(propertyDefinitionList1);
rpg1.item = targetitem;

However when the code executes I get two blank definition entries in the property grid
display. There is no display name nor value. The properties definitely exist in the object
being assigned to "item", but its like these property definitions don't get their binding
set. In another thread it was stated that property definitions have their binding
evaluated when the .item property changes, so what is happening (or not happening) here? I
figure I must be doing something wrong.

Thanks!
Ivan Ivanov
Telerik team
 answered on 18 Sep 2013
3 answers
182 views
Hi ,
 i have a sample app using Telerik WPF(trial Version) Grid View and i try to bind data on data Template control with no chance Please Help


<telerik:RadGridView Name="DGV" ItemsSource="{Binding}" CanUserInsertRows="False" AutoGenerateColumns="False" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="300" Width="497"><br>            <telerik:RadGridView.Columns><br>                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name"><br>                    <telerik:GridViewDataColumn.CellTemplate><br>                        <DataTemplate><br>                            <Label Content="{Binding Name}"></Label><br>                        </DataTemplate><br>                    </telerik:GridViewDataColumn.CellTemplate><br>                </telerik:GridViewDataColumn><br>                <br>            </telerik:RadGridView.Columns><br>            <br>            <br>        </telerik:RadGridView><br><div></div>

_________________________________________________________
public MainWindow()<br>        {<br>            InitializeComponent();<br>            GetData();<br>        }<br><br>        public void GetData()<br>        {<br>            DataTable _dt = new DataTable();<br>            _dt.Columns.Add("ID");<br>            _dt.Columns.Add("Name");<br>            _dt.Columns.Add("Percentage");<br>            _dt.Rows.Add("1", "Ahmed", 25);<br>            _dt.Rows.Add("2", "Ali", 60);<br>            _dt.Rows.Add("3", "Mohamed", 80);<br>            _dt.Rows.Add("3", "Mohamed2", 50);<br><br>            DGV.DataContext = _dt;<br>        }
Dimitrina
Telerik team
 answered on 18 Sep 2013
3 answers
248 views
I am trying to build an editor for byzantine music and i want to see if i can achieve some modifications to the source so i can have an acceptable presentation of the characters
for instance i want to control the empty space between two lines , the first line is with byzantine symbols and the second line is music text
thanks
Boby
Telerik team
 answered on 18 Sep 2013
1 answer
197 views
Hi,

I am trying to dynamically add table to the RadRichTextBox so I have written following code


Code Executed successfully, but while reflecting this code to document error following message shown

{"'0' is not a valid value for property 'LineHeight'."}

I am not able to get LineHeight property from which class. How to set it.

Please Help

Thanks
Sopan Vaidya
Table ttable = new Table();
                                ttable.Style = MyTableStyle;
 
                                var TabRowColl = TableRowHelpCollection.Where(x => x.ParentTableId == item.ElementKey).ToList();
                                foreach (var TR in TabRowColl)
                                {
                                    TableRow TBLR = new TableRow();
                                    TBLR.Height = 10;
                                     
//                                    TBLR.Style = MyRowStyle;
                                    foreach (var TC in TR.TableCellCollection)
                                    {
                                        TableCell TBLC = new TableCell();
                                         
                                        //TBLC.Style = new StyleDefinition ();
                                        foreach (var CB in TC.CellDocumentCollection)
                                        {
 
                                            if (CB is Paragraph)
                                            {
                                                Paragraph PP = new Paragraph();
                                                 
                                                foreach (var Child in CB.Children)
                                                {
                                                    if (Child is Span)
                                                    {
                                                        Span Spn = new Span((Child as Span).Text);
                                                         
                                                        PP.Children.Add(Spn);
                                                    }
                                                    else if (Child is ImageInline)
                                                    {
 
                                                    }
                                                }
                                                TBLC.Children.Add(PP);
                                            }
                                            else if (CB is Table)
                                            {
 
                                            }
                                        }
                                        TBLR.Cells.Add(TBLC);
                                    }
                                    ttable.Rows.Add(TBLR);
                                }
 
                                CurrentSelectedSection.Children.AddAfter(CurrPara, ttable);



Boby
Telerik team
 answered on 18 Sep 2013
5 answers
255 views
Hi,

I want to divide the current selected paragraph into three different parts as paragraph. 
I have selected to words from the paragraph so, first paragraph is start position of original paragraph up to end position of selected word after then I want to insert new empty DocumentElement as Paragraph or Table. After then third paragraph as remaining words from the original paragraph.

How to do this.

see attached image for more details about functiopnality.

Thanks
Petya
Telerik team
 answered on 17 Sep 2013
5 answers
150 views
Hi all of you,

I'm using this control under trial license. I'm trying to do a very simple binding but it doesn't work at all:

xaml header:

Here you can see the reference to one of my RESX files (I've got one for English and another one for Spanish where every key is named alike.
Names of resources files:

MasterGIT.resx and MasterGIT.en.resx

This line uses one RESX under criteria language:

     ResxExtension.DefaultResxName="GIT_CuadroMando.MasterGIT" Language="{UICulture}"

<Window
        ResxExtension.DefaultResxName="GIT_CuadroMando.MasterGIT" Language="{UICulture}"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="GestorDocumental"
 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="Window_Loaded"
    xmlns:local="clr-namespace:GIT_CuadroMando"
    xmlns:commands="clr-namespace:Telerik.Windows.Media.Imaging.ImageEditorCommands.RoutedCommands;assembly=Telerik.Windows.Controls.ImageEditor"       
    xmlns:tools="clr-namespace:Telerik.Windows.Media.Imaging.Tools;assembly=Telerik.Windows.Controls.ImageEditor"
    Title="{Resx TitleGestorDocumental}" Height="701" Width="1000" ResizeMode="CanResize" WindowStyle="ToolWindow">


xaml stuff:
<telerik:RadImageEditorUI x:Name="BodyWorkAndPaintingTool" Grid.ColumnSpan="4" Margin="10,49,33,10" Grid.Row="1" Grid.RowSpan="4">
          <telerik:RadImageEditorUI.ImageToolsSections>
              <telerik:ImageToolsSection Header="{Resx Disenador_Blur}"  >
 
                  <telerik:ImageToolItem ImageKey="Resize" Text="Resize" Command="commands:ImageEditorRoutedCommands.ExecuteTool">
                      <telerik:ImageToolItem.CommandParameter>
                          <tools:ResizeTool x:Name="resizeTool"/>
                      </telerik:ImageToolItem.CommandParameter>
                  </telerik:ImageToolItem>
 
                  <telerik:ImageToolItem ImageKey="Resize" Text="Canvas resize" Command="commands:ImageEditorRoutedCommands.ExecuteTool">
                      <telerik:ImageToolItem.CommandParameter>
                          <tools:CanvasResizeTool/>
                      </telerik:ImageToolItem.CommandParameter>
                  </telerik:ImageToolItem>

Code-behind:


  Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)
 
        CultureManager.UICulture = Thread.CurrentThread.CurrentCulture
'        Thread.CurrentThread.CurrentUICulture = New CultureInfo("es")
 
    End Sub


Thanks in advance for any hint or advice,
Petya
Telerik team
 answered on 17 Sep 2013
1 answer
119 views
i have used a RadTileView, 
<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             x:Class="DemoShow.usercontrol.UserControl1" 
             mc:Ignorable="d" >
    <UserControl.Resources>

        <Style x:Key="TextBoxThumb" TargetType="TextBox">
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="true">
                    <Setter Property="BorderThickness" Value="1,1,1,1" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="BorderThickness" Value="0,0,0,0"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <DataTemplate x:Key="headerTemplate">
            <TextBlock Text="{Binding Number}" />
        </DataTemplate>
        <DataTemplate x:Key="contentTemplate">
            <Grid Margin="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <TextBox Grid.Row="0" Style="{StaticResource TextBoxThumb}" IsEnabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  Text="{Binding Name,Mode=TwoWay}" />
                <TextBox Grid.Row="1" Style="{StaticResource TextBoxThumb}" IsEnabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Text="{Binding Birthday,Mode=TwoWay}" />
                <TextBox Grid.Row="2" Style="{StaticResource TextBoxThumb}" IsEnabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Text="{Binding age,Mode=TwoWay}" />
                <TextBox Grid.Row="3" Style="{StaticResource TextBoxThumb}" IsEnabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Text="{Binding Sex,Mode=TwoWay}" />
                <TextBox Grid.Row="4" Style="{StaticResource TextBoxThumb}" IsEnabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Text="{Binding CheckType,Mode=TwoWay}" />
                <TextBox Grid.Row="5" Style="{StaticResource TextBoxThumb}" IsEnabled="{Binding Path=ShowFlag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Text="{Binding Time,Mode=TwoWay}" />
                <Button Grid.Row="5"  Content="123" >
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction  Command="{Binding DataContext.LoginCommand,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}, AncestorLevel=1}}"
                                CommandParameter="{Binding Name}"
                                />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>

            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <telerik:RadTileView  
                         IsAutoScrollingEnabled="True"
                    IsDockingEnabled="True"
                    IsVirtualizing="True"
                         ColumnsCount="2"
                         RowHeight="200"
                         ColumnWidth="300"
                         MinimizedColumnWidth="300"
                         MinimizedRowHeight="200"
                         MinimizedItemsPosition="Bottom"
                         ContentTemplate="{StaticResource contentTemplate}"
                    ItemsSource="{Binding Path=Items,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                    ItemTemplate="{StaticResource headerTemplate}"
                    PreservePositionWhenMaximized="False"
                    TileStateChangeTrigger="SingleClick">
        </telerik:RadTileView>

    </Grid>

</UserControl>

i change the BindingList<People>

  public class MainViewModel : ViewModelBase
    {
        private BindingList<People> items;
        private BindingList<People> itemstem;

        public ICommand LoginCommand
        {
            get
            {
                return new RelayCommand<object>(
                    (parameter) =>
                    {
                        ChangeInputEnable(parameter);
                    }
                    );
            }
        }

ui not update      public class People
    {
        public string Name { get; set; }
        public string Birthday { get; set;}
        public string age { get; set; }
        public string Sex { get; set; }
        public string CheckType { get; set; }
        public string Time { get; set; }
        public string Number { get; set; }
        public bool ShowFlag { get; set; }
    }

        private void ChangeInputEnable(object parameter)
        {

            //string str = parameter.ToString();
            //var obj = items.FirstOrDefault(x => x.Name == str);
            //int n = items.IndexOf(obj);
            //MessageBox.Show(items[n].ShowFlag.ToString());
            //if (obj != null)
            //{
            //    if (obj.ShowFlag) obj.ShowFlag = false;
            //    else obj.ShowFlag = true;

            //    RaisePropertyChanged("ShowFlag");
            //    RaisePropertyChanged("Items");
            //    MessageBox.Show(items[n].ShowFlag.ToString());
            //    MessageBox.Show(str);
            //}


            string str = parameter.ToString();
            var obj = items.FirstOrDefault(x => x.Name == str);
            int n = items.IndexOf(obj);
            if (obj != null)
            {
                if (obj.ShowFlag) obj.ShowFlag = false;
                else obj.ShowFlag = true;
                obj.Name += "tttt";
                items.ListChanged += (o, e) => RaisePropertyChanged(("Items"));

                itemstem = items;
                items = null;
                items = itemstem;
                RaisePropertyChanged("Name");
                
                RaisePropertyChanged("Items");
            }


            //items.Add(new People()
            //{
            //    Birthday = "1985-08-08",
            //    age = "38",
            //    Sex = "Male",
            //    CheckType = "PET-CT",
            //    Time = "10:30",
            //    Name = "tttt",
            //    Number = "10"
            //});

            //RaisePropertyChanged("Items");


        }

        public MainViewModel()
        {
            List<People> itemsSource = new List<People>();
            for (int i = 0; i < 5; i++)
            {
                itemsSource.Add(new People()
                {
                    Birthday = "1985-08-08",
                    age = "38",
                    Sex = "Male",
                    CheckType = "PET-CT",
                    Time = "10:30",
                    Name = this.names[i % 12],
                    Number = i.ToString(),
                    ShowFlag =true
                });
            }

            this.items = new BindingList<People>(itemsSource);
        }


        public BindingList<People> Items
        {
            get
            {
                return this.items;
            }
            set
            {
                this.items =value;
                RaisePropertyChanged("Items");
            }
        }

        private List<string> names = new List<string>
        {
            "Andrew Fuller",
            "Martin Sommer",
            "Anne Dogsworth",
            "Steven Buchanan",
            "Janet Leverling",
            "Michael Suyama",
            "Margaret Peacock",
            "Robert King",
            "John Steel",
            "Laura Gallahan",
            "Nancy Davolio",
            "Ann Devon"
        };
    }

can you help me ?

Pavel R. Pavlov
Telerik team
 answered on 17 Sep 2013
4 answers
220 views
hi there,

I would need more power with this control. I mean, being able to show more buttons would be great. I wonder, is it possible?
My aim is display a button where the user can save the images and their later treatment against my RDBMS (Sql2k8)

Also I would fancy show a Context Menu on the bare surface of the control.

Telerik 2013 Q1 NET 4.5 for WPF.

Thanks in advance,
Enric
Top achievements
Rank 1
 answered on 17 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?