Telerik Forums
UI for WPF Forum
7 answers
550 views
Hi,

I have a property type if Image in the Model and i do not have path of the Image. It is designed at runtime through code.

I need to display in GridView Column, but Rad Grid View Image column needs URL of the image to display.

Please let me know how to bind the Image property to the grid column to display.

Thanks
Raja Gopal
Vanya Pavlova
Telerik team
 answered on 22 Sep 2014
3 answers
95 views
I have a RadGridView with AutoGenerateColumns="true". Now i need to change one of the columns from being a plain column to a comboboxcolumn in code behind. What is the best way to do this? 

So instead of displaying a grid with say 3 columns:

[id] [PersonId] [PersonName]

i want 2 columns and catch the column with PersonName an replace it with a comboboxcolumn so i can pick any row in the column. The comboboxvolumn sould display the [PersonName] but the value should be the [PersonId].

Also the grid is used to display various tables so i cant use a predefined template i think?

I dont know if this makes sense? :)
Dimitrina
Telerik team
 answered on 22 Sep 2014
1 answer
140 views
Hello,

I'm not able to get implicit themes (No Xaml) working when using a class inherited from RadCartesianChart.

The typical way to get this to work would be to add this to the Application's resource dictionary:

<Style TargetType="controls:RadCartesianChartEx" BasedOn="{StaticResource RadCartesianChartStyle}"/>

however, this does not work as there is no RadCartesianChartStyle resource defined in the theme assemblies.  Any ideas how to get this to work?  My inherited charts are not displaying when using the NoXaml libraries.

Thanks!
Joe
Top achievements
Rank 1
 answered on 22 Sep 2014
3 answers
124 views
Hello, I have a RadGridView with several columns. Only one column is editable, the rest are readOnly. When a user opens a cell in the editable column and press 'tab' an error that says IndexOutOfRangeException was unhandled' specifically: 'An unhandled eception of type 'System.IndexOutOfRangeException' occurred in Telerik.Windows.Controls.dll'. Can anyone help me understand this error and how to get rid of it to allow the user use tab to move to the next cell. Thank you.
Dimitrina
Telerik team
 answered on 22 Sep 2014
3 answers
27 views
Hi Team,

1) As I am providing my own customEditors based on my property types, I am unable to set the focus to the Custom Editors when I am tabbing through the PropertyGrid. I am providing my own style ( Grid layout) to the property Grid.Coud you please help me in this regards.

2) Secondly, I want to provide my style similiar to the style which telerik provides when we make AutogeneratePropertyDefintions as true.
Currently I am doing Autogenerate as False and providing my own style ( grid layout) as a result what happens is:
          a) The PropertyNames are getting overlapped by the Thumb(gripper that exists between the property name and the custom editor). I always have to hold the                gripper and move it right to see the complete name. Is there a way , so that I could align my property grid like: <PropertyName><gripper><Editor>. the                      Property Name takes the size as per its text and the rest space is completely taken by the Custom Editor.( Mostly Like Stack Layout)

Regards,
Imran
Dimitrina
Telerik team
 answered on 22 Sep 2014
1 answer
133 views
Hello.

My WPF code has several nodes that are textually identical (including their contents) but refer to different data-contexts:

<telerik:RadTabControl IsSynchronizedWithCurrentItem="True">
    <telerik:RadTabControl.Resources>
        <system:String x:Key="Mandatory">* Mandatory field</system:String>
    </telerik:RadTabControl.Resources>
    <telerik:EventToCommandBehavior.EventBindings>
        <telerik:EventBinding Command="{Binding PreviewSelectionChanged}" EventName="PreviewSelectionChanged" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
    </telerik:EventToCommandBehavior.EventBindings>
    <telerik:RadTabItem Visibility="{Binding ProjectVisibility}">
        <telerik:RadTabItem.Header>
            <Label Content="_Projects" />
        </telerik:RadTabItem.Header>
        <DockPanel>
            <DockPanel.DataContext>
                <local:ProjectGridViewModel />
            </DockPanel.DataContext>
            <local:ButtonPanel DockPanel.Dock="Top"/>
            <TextBlock Text="{StaticResource Mandatory}" DockPanel.Dock="Bottom"/>
            <telerik:RadGridView ItemsSource="{Binding Path=ItemCollectionProperty, Mode=TwoWay}" SelectedItem="{Binding CurrentlySelectedItem, Mode=TwoWay, Converter={StaticResource ignoreNewItemPlaceHolderConverter}}" AutoGenerateColumns="False" CanUserDeleteRows="True" IsSynchronizedWithCurrentItem="True" ShowGroupPanel="False" DockPanel.Dock="Top" AlternateRowBackground="Beige" AlternationCount="2" SelectionMode="Extended">
                <telerik:EventToCommandBehavior.EventBindings>
                    <telerik:EventBinding Command="{Binding SelectionChangingCommand}" EventName="SelectionChanging" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding NewEventCommand}" EventName="AddingNewDataItem" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding DeleteEventCommand}" EventName="Deleting" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                </telerik:EventToCommandBehavior.EventBindings>
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Name*" IsReadOnly="False" DataMemberBinding="{Binding ItemProperty.Name, Mode=TwoWay}">
                        <telerik:GridViewDataColumn.CellEditTemplate>
                            <DataTemplate>
                                <TextBox Text="{Binding ItemProperty.Name, Mode=TwoWay}" telerik:TextBoxBehavior.UpdateTextOnTextChanged="True" />
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellEditTemplate>
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Header="Description" IsReadOnly="False" DataMemberBinding="{Binding ItemProperty.Description, Mode=TwoWay}">
                        <telerik:GridViewDataColumn.CellEditTemplate>
                            <DataTemplate>
                                <TextBox Text="{Binding ItemProperty.Description, Mode=TwoWay}" telerik:TextBoxBehavior.UpdateTextOnTextChanged="True" />
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellEditTemplate>
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewComboBoxColumn Header="Coordinator*" ItemsSource="{Binding RelativeSource={RelativeSource Findancestor, AncestorType={x:Type Window}}, Path=DataContext.EmployeeCollection}" DataMemberBinding="{Binding Path=ItemProperty.coordinator}" DisplayMemberPath="ItemProperty.Name" SelectedValueMemberPath="ItemProperty.Name" IsVisible="{Binding CoordinatorColumnIsVisible}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </DockPanel>
    </telerik:RadTabItem>
    <telerik:RadTabItem Visibility="{Binding EmployeeVisibility}">
        <telerik:RadTabItem.Header>
            <Label Content="_Employees" />
        </telerik:RadTabItem.Header>
        <DockPanel>
            <DockPanel.DataContext>
                <local:EmployeeGridViewModel />
            </DockPanel.DataContext>
            <local:ButtonPanel DockPanel.Dock="Top"/>
            <TextBlock Text="{StaticResource Mandatory}" DockPanel.Dock="Bottom"/>
            <telerik:RadGridView ItemsSource="{Binding Path=ItemCollectionProperty, Mode=TwoWay}" SelectedItem="{Binding CurrentlySelectedItem, Mode=TwoWay, Converter={StaticResource ignoreNewItemPlaceHolderConverter}}" CurrentItem="{Binding CurrentlySelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource ignoreNewItemPlaceHolderConverter}}" AutoGenerateColumns="False" CanUserDeleteRows="True" IsSynchronizedWithCurrentItem="True" ShowGroupPanel="False" DockPanel.Dock="Top" AlternateRowBackground="Beige" AlternationCount="2" SelectionMode="Extended" VerticalContentAlignment="Stretch">
                <telerik:EventToCommandBehavior.EventBindings>
                    <telerik:EventBinding Command="{Binding SelectionChangingCommand}" EventName="SelectionChanging" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding NewEventCommand}" EventName="AddingNewDataItem" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding DeleteEventCommand}" EventName="Deleting" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                </telerik:EventToCommandBehavior.EventBindings>
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Name*" IsReadOnly="False" DataMemberBinding="{Binding ItemProperty.Name, Mode=TwoWay}">
                        <telerik:GridViewDataColumn.CellEditTemplate>
                            <DataTemplate>
                                <TextBox Text="{Binding ItemProperty.Name, Mode=TwoWay}" telerik:TextBoxBehavior.UpdateTextOnTextChanged="True" />
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellEditTemplate>
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewComboBoxColumn Header="Location*" x:Name="Location" ItemsSource="{Binding RelativeSource={RelativeSource Findancestor, AncestorType={x:Type Window}}, Path=DataContext.ROLocationDbmCollectionProperty}" DataMemberBinding="{Binding Path=ItemProperty.Location}" DisplayMemberPath="ItemProperty.Name" SelectedValueMemberPath="ItemProperty.Name" />
                    <telerik:GridViewDataColumn Header="Recruitment Date*" DataMemberBinding="{Binding ItemProperty.RecruitmentDate}" DataFormatString="dd/MM/yyyy" Width="86" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </DockPanel>
    </telerik:RadTabItem>
    <telerik:RadTabItem Visibility="{Binding LocationVisibility}">
        <telerik:RadTabItem.Header>
            <Label Content="_Locations" />
        </telerik:RadTabItem.Header>
        <DockPanel>
            <DockPanel.DataContext>
                <local:LocationGridViewModel />
            </DockPanel.DataContext>
            <local:ButtonPanel DockPanel.Dock="Top"/>
            <TextBlock Text="{StaticResource Mandatory}" DockPanel.Dock="Bottom"/>
            <telerik:RadGridView ItemsSource="{Binding Path=ItemCollectionProperty, Mode=TwoWay}" SelectedItem="{Binding CurrentlySelectedItem, Mode=TwoWay, Converter={StaticResource ignoreNewItemPlaceHolderConverter}}" CurrentItem="{Binding CurrentlySelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource ignoreNewItemPlaceHolderConverter}}" AutoGenerateColumns="False" CanUserDeleteRows="True" IsSynchronizedWithCurrentItem="True" ShowGroupPanel="False" DockPanel.Dock="Top" AlternateRowBackground="Beige" AlternationCount="2" SelectionMode="Extended" VerticalContentAlignment="Stretch">
                <telerik:EventToCommandBehavior.EventBindings>
                    <telerik:EventBinding Command="{Binding SelectionChangingCommand}" EventName="SelectionChanging" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding NewEventCommand}" EventName="AddingNewDataItem" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding DeleteEventCommand}" EventName="Deleting" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                </telerik:EventToCommandBehavior.EventBindings>
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Name*" IsReadOnly="False" DataMemberBinding="{Binding ItemProperty.Name, Mode=TwoWay}">
                        <telerik:GridViewDataColumn.CellEditTemplate>
                            <DataTemplate>
                                <TextBox Text="{Binding ItemProperty.Name, Mode=TwoWay}" telerik:TextBoxBehavior.UpdateTextOnTextChanged="True" />
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellEditTemplate>
                    </telerik:GridViewDataColumn>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </DockPanel>
    </telerik:RadTabItem>
 
... several more similar-looking tab-items
 
</telerik:RadTabControl>


As you can see, the EventBindings of all RadGridView instances are textually identical, only under different data-contexts of each RadTabItem. This is code duplication, and I need to have code-reuse in order to solve it.
Is there a way to put all of those identical nodes in a single place and just make a reference to that place in each RadTabItem?
(If you also manage to do that for the identical repetitive appearances of ButtonPanel and Mandatory in each RadTabItem that would be great.)
Dimitrina
Telerik team
 answered on 22 Sep 2014
1 answer
137 views
I have exactly the same problem as described here

http://www.telerik.com/forums/suspend-sorting-during-paste

Basically I want to disable column sorting when users wants to paste their data into the grid
Just let the column unsorted and let user decide whether they want to sort again

I tried this on Pasting event of the grid, but it doesn't work
private void OnGridPasting(object sender, GridViewClipboardEventArgs e)
{
    ((RadGridView) sender).CurrentColumn.SortingState = SortingState.None;
}
It actually doing nothing, the column still get sorted on pasting, and I can see the sorting caret on the column header, which is weird !!

So I switched to PastingCellClipboardContent event and do this
private void OnPastingCellClipboardContent(object sender, GridViewCellClipboardEventArgs e)
{
    e.Cell.Column.SortingState = SortingState.None;
}
The sorting caret on column header disappears, but as the data being modified, they still get sorted <-- I believe this is a bug

What else can I do to get my problem solved?

Thanks
Dimitrina
Telerik team
 answered on 22 Sep 2014
2 answers
282 views
Hi,

i use the RadPropertyGrid to show the properties of an ExpandoObject in unbound mode (AutoGenerateBindingPaths=false and AutoGeneratePropertyDefinitions=false). The PropertyDefinitions are created in code by my ViewModel.

In pseudo code my view model looks like:

dynamic model = new ExpandoObject();
model.MyProperty = 42;
 
PropertyDefinition property = new PropertyDefinition
{
     DisplayName = "MyProperty",
    Binding = new Binding("MyProperty")
    {
        Source = model,
        Mode = BindingMode.TwoWay
    }
};

On a first glance it seems to work. The property with the current value appears in the PropertyGrid.
But unfortunally the update is not working. When I change the value of the property in the PropertyGrid, the model is not updated. 

Is there a mistake on my side?


Best regards,
Thomas


Stefan
Top achievements
Rank 1
 answered on 22 Sep 2014
5 answers
177 views
Operating System: Windows 7
Telerik: 2012.2.912.40 (RadControls for WPF)

Issue: After adding RadPropertyGrid control in my WPF Class Library project and running the application,  I get "Could not load file or assembly 'Telerik.Windows.Controls.Data, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The system cannot find the file specified."

Note- This works fine if the project type is of Windows application.  As mentioned above, does not work in  a class library project.
Dimitrina
Telerik team
 answered on 22 Sep 2014
16 answers
362 views
Hi,

I have html document(xyz.html),Under click event i want to open PDF file from html Document using Telerik.

Please let me know how can I proceed.

Regards,
Ranjith
Runjith
Top achievements
Rank 2
 answered on 22 Sep 2014
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?