Telerik Forums
UI for WPF Forum
3 answers
96 views
Have you stopped developing your UI tools?

There seems to be no internal builds since 2013 Q3.
Yana
Telerik team
 answered on 10 Feb 2014
10 answers
783 views
Hi,

I'm trying to display a standard context menu on a RadGridView that lists the columns that are contained within the grid.  The purpose of this is so that I can have a checkbox on the menu item that controls/changes the visibility of the column on the grid.  I've seen the article (http://www.telerik.com/help/wpf/radgridview-how-to-show-hide-columns-outside-of-the-radgridview.html) that shows how to dynamically populate a listbox with checkboxes using XAML and bindings - this is close to what I want.

I've tried to add the context menu directly to the RadGridView using the following XAML but had no luck so far:

<telerik:RadGridView HorizontalAlignment="Left" Margin="15" Name="radGridView1" VerticalAlignment="Top" AutoGenerateColumns="False"
                                 ItemsSource="{Binding ElementName=TheContext, Path=TestModels}">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="AA" DataMemberBinding="{Binding Path=AA}" />
                    <telerik:GridViewDataColumn Header="BB" DataMemberBinding="{Binding Path=BB}" />
                </telerik:RadGridView.Columns>
                <telerik:RadGridView.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Columns" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=telerik:RadGridView, AncestorLevel=1}, Path=Columns, Mode=TwoWay}">
                            <MenuItem.ItemTemplate>
                                <HierarchicalDataTemplate>
                                    <MenuItem Header="Binding Header, Mode=TwoWay}" IsCheckable="True" IsChecked="{Binding IsVisible, Mode=TwoWay}"/>
                                </HierarchicalDataTemplate>
                            </MenuItem.ItemTemplate>
                        </MenuItem>
                    </ContextMenu>
                </telerik:RadGridView.ContextMenu>
            </telerik:RadGridView>

In the Output window I can see I get the following error message: System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Telerik.Windows.Controls.RadGridView', AncestorLevel='1''. BindingExpression:Path=Columns; DataItem=null; target element is 'MenuItem' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')

I thought perhaps I should try creating a context menu on something other than the RadGridView I've tried adding a context menu to a label that's outside of the RadGridView just to test things out but so far have called no joy.  The XAML I was using for this was:

<Label>
                <Label.Content>I'm a label but right click me...</Label.Content>
                <Label.ContextMenu>
                    <ContextMenu Name="MainCollection">
                        <MenuItem Header="Columns">
                            <MenuItem ItemsSource="{Binding ElementName=radGridView1, Path=Columns, Mode=TwoWay}">
                                <MenuItem.ItemTemplate>
                                    <HierarchicalDataTemplate>
                                        <MenuItem Header="Binding Header, Mode=TwoWay}" IsCheckable="True" IsChecked="{Binding IsVisible, Mode=TwoWay}"/>
                                    </HierarchicalDataTemplate>
                                </MenuItem.ItemTemplate>
                            </MenuItem>
                        </MenuItem>
                    </ContextMenu>
                </Label.ContextMenu>
            </Label>

From the output window I get the following error message "System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=radGridView1'. BindingExpression:Path=Columns; DataItem=null; target element is 'MenuItem' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')"

Any ideas welcome,
Chris.
Ivan
Top achievements
Rank 1
 answered on 10 Feb 2014
3 answers
142 views
Hello
i am adding some comumns in my code behind to a radgridview
The problem i get is that these columns are not filterable neither groupable . I have some columns defnied in the xaml and these are filterable and groupable.

So i dont understand why the dinamicly created columns are not.

Here is my code

<telerik:RadGridView Name="GridViewListeConstituants" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Style="{DynamicResource RadGridViewStyle1}" HeaderRowStyle="{DynamicResource GridViewHeaderRowStyle1}"
                             Margin="5" ItemsSource="{Binding listeConstituants}" AutoGenerateColumns="False" >
            <telerik:RadGridView.RowStyleSelector>
                <telerik:ConditionalStyleSelector>
                    <telerik:StyleRule Condition="enCreation" Style="{DynamicResource RowEnCreationStyle}" >
                    </telerik:StyleRule>
                    <telerik:StyleRule Condition="enCreation=false" Style="{DynamicResource RowStandardStyle}">
                    </telerik:StyleRule>
                </telerik:ConditionalStyleSelector>
            </telerik:RadGridView.RowStyleSelector>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding LIBELLE}" Header="LibellĂ©" HeaderCellStyle="{DynamicResource HeaderCellStyle1}">
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding UNITE}" Header="UnitĂ©" HeaderCellStyle="{DynamicResource HeaderCellStyle1}">
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding VALEURDEFAUT}" Header="Valeur par dĂ©faut" HeaderCellStyle="{DynamicResource HeaderCellStyle1}">
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="PropriĂ©tĂ©s" HeaderCellStyle="{DynamicResource HeaderCellStyle1}" >
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <telerik:RadButton Name="ButtonProprietes" Content="{Binding StringPropriete}" Click="ButtonProprietes_Click_1"></telerik:RadButton>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>


foreach (CONTEXTE monContexte in listeContextes)
            {
                Telerik.Windows.Controls.GridViewCheckBoxColumn maColonne = new Telerik.Windows.Controls.GridViewCheckBoxColumn();
                //Telerik.Windows.Controls.GridViewDataColumn maColonne = new Telerik.Windows.Controls.GridViewDataColumn();
                maColonne.HeaderCellStyle = this.FindResource("HeaderCellStyle1") as Style;
                maColonne.DataMemberBinding = new Binding("RowContextes[" + monContexte.LIBELLE + "]");
                maColonne.Name = "C"+ monContexte.ID_CONTEXTE.ToString();
                maColonne.Header = monContexte.LIBELLE;
                maColonne.Width =100;
                maColonne.TextAlignment = TextAlignment.Center;
                maColonne.CellStyle = this.FindResource("CheckBoxCellStyle") as Style;
                this.GridViewListeConstituants.Columns.Add(maColonne);
                maColonne.IsCustomSortingEnabled = true;
                maColonne.IsFilterable = true;
                maColonne.IsGroupable = true;
                maColonne.IsReorderable = true;
                maColonne.IsSortable = true;
                maColonne.IsThreeState = true;
                maColonne.DataType= System.Type.GetType("Boolean");
                //maColonne.
                 
            }


Any idea about what this isnt working?
Alexandre
Top achievements
Rank 1
 answered on 10 Feb 2014
0 answers
100 views
Hi,

is it possible to create a "facets-search view" in a Tree ListView? If i Change the entry in the treeListView i want to update my GridView!

Thanks
best regards
rene
ITA
Top achievements
Rank 1
 asked on 10 Feb 2014
1 answer
113 views
Hi,

I've added an option on my RadChart to toggle between the Y-axis being logarithmic & non logarithmic. This is at run time so a user can flick between the two after the data has been plotted.

I'm seeing some funny behaviour with points not appearing where they should. Before looking into this further I wanted to check if I should be clearing down the series and re drawing them whenever I change the value of IsLogarithmic on the Y-axis?

Any help is much appreciated.

Thanks,

Rob
Petar Marchev
Telerik team
 answered on 10 Feb 2014
2 answers
213 views
Steps:
1. Add a pdf viewer to code (see the attachement for the markup)
2  Set SelectedFilePath property to a valid file name
3. Pdf viewer displayed the loading image
4. Before it completes the file load, change SelectedFilePath property to null
5. Pdf viewer keep displaying the loading image (it doesnt get cleared).

As I checked, the Pdf viewer's loading image is cleared only when the pdf file is loaded, but not when a Document=null is set (if it was displaying the image).

Can you please check whether I have a solution to the problem
Indrajith
Top achievements
Rank 1
 answered on 09 Feb 2014
4 answers
766 views
For certain rows I don't want the cell to be editable or show any content. Maybe focusable but user wouldn't be able to go into edit mode. This behavior would be based on a value of the row's data context. Essentially, certain attributes don't apply to certain rows, so user shouldn't be able to interact with those columns at all.

How can you go about doing this that doesn't require that I recreate the data template?
Carlos
Top achievements
Rank 1
 answered on 08 Feb 2014
1 answer
902 views
Greetings Telerik,

  I have multiple RadGridViews which consist of both GridViewDataColumns as well as GridViewSelectColumns. Is there a way I can set the style for each column type once and have it apply to all RadGridViews? 

If I include this style in the resources section of my application's MainWindow, it works fine and all cells will receive the styling I desire:

<Style TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="VerticalContentAlignment" Value="Top"/>
</Style>


However that will affect checkboxes in GridViewSelectColumns which I would like to remain "centered" regarding their VerticalContentAlignment... so I tried this (also in the resources section of my Mainwindow):

<Style TargetType="{x:Type telerik:GridViewDataColumn}">
    <Setter Property="CellStyle">
        <Setter.Value>
<Style TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="VerticalContentAlignment" Value="Top"/>
</Style>
        </Setter.Value>
</Setter>
</Style>


However it does not seem to apply the styling to any cells... But, if I go to each column in each grid and set the style manually (using the same style) for each one it does work:

<Style x:Key="myStyle"  TargetType="{x:Type telerik:GridViewCell}">
    <Setter Property="VerticalContentAlignment" Value="Top"/>
</Style>

<telerik:RadGridView
            x:Name="mygridview"
            ShowGroupPanel="False"
            ItemsSource="{Binding Path=MyView}"
            AutoGenerateColumns="False"
            SelectionMode="Extended"
            SelectedItem="{Binding Path=SelectedRecord}"
            RowIndicatorVisibility="Collapsed"
            CanUserFreezeColumns="False"
            CanUserDeleteRows="False"
            ScrollMode="Deferred">
    <telerik:RadGridView.Columns>
        <telerik:GridViewSelectColumn />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=RecordName}" CellStyle="{StaticResource myStyle}" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=RecordName}" CellStyle="{StaticResource myStyle}" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=RecordName}" CellStyle="{StaticResource myStyle}" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>


Any advice you could provide would be greatly appreciated. I'm using .NET 4.5.1 with Telerik UI for WPF Q3 2013 SP2 (13.3.1316.0) in Visual Studio 2013. Thanks!

Cheers,
Beau
Yoan
Telerik team
 answered on 08 Feb 2014
1 answer
57 views
Got the latest DLL only dev build of the WPF controls, dropped the DLLs into my project folder, clean, rebuild and get
Error 1 The name "RadWindow" does not exist in the namespace "http://schemas.telerik.com/2008/xaml/presentation". 

Did the namespace change?

Why would updating the DLLs cause this?

Any help appreciated.

rjsjr
Sandra
Top achievements
Rank 1
 answered on 07 Feb 2014
1 answer
117 views
I was wanting to know if there was a way to add to the FilterOperator enums or change what they display as. If those were not possible, can I override the operators dropdown with my own collection?
Hristo
Telerik team
 answered on 07 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?