Telerik Forums
UI for WPF Forum
1 answer
106 views
I have created the following RadTreeView:


<Style TargetType="telerik:RadTreeViewItem" x:Key="RadTreeViewItemStyle">
    <Setter Property="CheckState" Value="{Binding Path=CheckState, Mode=TwoWay, Converter={StaticResource ToggleStateToBoolean}}" />
    <Setter Property="DefaultImageSrc" Value="{Binding ListImage}" />
    <Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
</Style>
<HierarchicalDataTemplate x:Key="TreeViewItemTemplate" ItemsSource="{Binding DirectoryList}" ItemContainerStyle="{StaticResource RadTreeViewItemStyle}">
    <TextBlock Text="{Binding DisplayName}"  Margin="0,0,5,0"/>
</HierarchicalDataTemplate>
  
        <telerik:RadTreeView Grid.Column="0" IsLineEnabled="True" ItemsOptionListType="CheckList" IsOptionElementsEnabled="True" IsTriStateMode="True"
                             BorderBrush="Black" BorderThickness="1" ItemsSource="{Binding RootItems}" ItemTemplate="{StaticResource TreeViewItemTemplate}"
                             IsLoadOnDemandEnabled="True" LoadOnDemand="RadTreeView_LoadOnDemand" ItemContainerStyle="{StaticResource RadTreeViewItemStyle}"
                             Background="White" Name="ExplorerTree">
        </telerik:RadTreeView>

In the codebehind, I am passing the LoadOnDemand back to my viewmodel for processing.  Everything is working exactly as it should except for when I attempt to load a node that has been selected.  If I select the node and then fire the LoadOnDemand event, it loads properly and displays all the child nodes, but then deselects the node itself.  How can I get it to stop doing this?






Petar Mladenov
Telerik team
 answered on 31 Aug 2011
1 answer
356 views
Hi All,
I am using MVVM pattern in my WPF application. I am using the Modal created by Entity Framework and my ViewModel class have public properties for binding. I have a specific requirements that my GridView should have two checkboxes columns and one TextBox column (all time in Edit mode) and all other remaining columns will be in ReadOnly mode. When user either Check/Uncheck these checkboxes OR change value in TextBox, I will have to do custom calculation on it (Note that for firing these calculation, I should have separate property in ViewModel so that I can fire in its SET clause....Am I right?)
I created the Grid in XAML like this.
<telerik:RadGridView Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="0" Name="radGridView1" AutoGenerateColumns="False" ShowGroupPanel="False"
                             ItemsSource="{Binding IndicatorsList}">
            <telerik:RadGridView.Columns>
                <col:MyColumn Header="#" Width="35"/>
                <telerik:GridViewColumn IsReadOnly="False" Header="Inc." Width="35">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding IncludeIt, Mode=TwoWay}"/>
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>
                <telerik:GridViewDataColumn Header="Indicator" DataMemberBinding="{Binding DisplayName}" IsReadOnly="True" Width="250" />
                <telerik:GridViewColumn IsReadOnly="False" Header="Log" Width="35">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding LOG, Mode=TwoWay}"/>
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>
                <telerik:GridViewColumn IsReadOnly="False" Header="Lag" Width="75">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding LAG, Mode=TwoWay}"/>
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Del." Width="35">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <telerik:RadButton Command="{Binding Delete}" CommandParameter="{Binding}" Width="27" Height="20">
                                <Image Source="/finStat.MacroVal.UI;component/Images/del_small.png"></Image>
                            </telerik:RadButton>
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

Here is my ViewModel
public List<Indicator> IndicatorsList
        {
            get { return Indicators.ToList(); }
        }
public bool IncludeIt
{
       get { /******Here How I get current object item (i.e. Indicator) of the row so that I can return its value *********/ }
       set {  /******Here How I get current object item (i.e. Indicator) of the row so that I set its value *********/ }
}
I am really stuck that how can I create properties for these check boxes and TextBox. Basically how can I get specific row DataItem in checkbox property so that I can return specific field from that DataItem.
Although my actual Model object is Entity Framework Model, but here is sample model for this example.
public class Indicator
{
    public bool IncludeIndicator { get; set; }
    public string Name { get; set; }
    public bool Log { get; set; }
    public double Lag { get; set; }
}

Any help please?
Maya
Telerik team
 answered on 31 Aug 2011
3 answers
196 views
I am using Telerik Docking Control 2010.3.1314.35. I have set IsPinned=False in docking RadPane, but after loading it is showing animation and then hiding it. Is there any way I can disable this animation?
Miroslav Nedyalkov
Telerik team
 answered on 31 Aug 2011
1 answer
48 views
Hi,

I have tree list view, when user mouse hover on  particular cells of column, I want to generate a pup up to showing elements.It is working fine, but if there are so many elements in the pup up, it will crush and stop run anything.Can anyone help?   

<telerik:GridViewDataColumn  Header="Name" DataMemberBinding="{Binding Name, Converter={StaticResource InsensitiveRevConverter}}">
                      <telerik:GridViewDataColumn.CellTemplate>
                          <DataTemplate>
                              <StackPanel Orientation="Horizontal" >
                                  <Image Source="{Binding Image}" />
                                  <TextBlock x:Name="ShowELementPupUp"  Text="{Binding Name}" />
                                  <Popup PlacementTarget="{Binding ElementName=ShowELementPupUp}" Style="{StaticResource TooltipPopupStyle}" PopupAnimation="Scroll" >
                                      <telerik:RadGridView x:Name="RadGridViewOfPopUp"  Visibility="{Binding ShowElements}" AllowDrop="True" AutoGenerateColumns="False" CanUserFreezeColumns="False"
                                                                                                              CanUserInsertRows="False" CanUserReorderColumns="False" CanUserSortColumns="False"
                                                                                                              CanUserDeleteRows="False" ShowGroupPanel="False"
                                                                                                              GridLinesVisibility="None"  RowIndicatorVisibility="Collapsed"
                                                                                                              ShowColumnHeaders="False">
                                          <telerik:RadGridView.Columns>
                                              <telerik:GridViewDataColumn DataMemberBinding="{Binding Name, Mode=OneWay}" />
                                              <telerik:GridViewDataColumn MinWidth="20" DataMemberBinding="{Binding UnweightedPercentage, Mode=OneWay}"/>
                                          </telerik:RadGridView.Columns>
                                      </telerik:RadGridView>
 
                                  </Popup>
                              </StackPanel>
                          </DataTemplate>
                      </telerik:GridViewDataColumn.CellTemplate>
                  </telerik:GridViewDataColumn>

Thanks,

Fendy
Vlad
Telerik team
 answered on 31 Aug 2011
1 answer
92 views
Hello Telerik Team,

My application has a RadTreeListView control that can be filtered by the user.

I want to save the Filter settings in a user preferences file on application shutdown and then load and apply the filters back to the RadTreeListView on application startup.

Can you help me with  C# code snippets that will dump the filter settings to a text file and load them back from that file please?

I am using version 2011.1.419.35 of your WPF controls.

Thanks,
Kumar
Vlad
Telerik team
 answered on 31 Aug 2011
1 answer
67 views
I'm creating a dynamic number of line series in code.  Is there a way to set a different Legend Item Marker Shape for each line series?
Evgenia
Telerik team
 answered on 31 Aug 2011
1 answer
78 views
This is by far the strangest bug I've encountered.

If I select a cell for edit using the mouse and edit the cell and then select another cell using the mouse, and edit the newly selected cell, when I save the values revert.  If I perform the same edits but rather than selecting cells using the mouse I instead tab to the cell, or hit enter to move to the next row, and edit a different cell my edits persist.

On the off chance someone has encountered this or a similar kind of behavior I'm posting this in the hopes of getting this resolved.

I'm using entity framework 4 as my O.R. and like I said when I navigate using the tab key there are no problems. It's only when I make cell selections via the mouse. 

Frankly I'm stumped so any suggestions as to what might be causing this will be greatly appreciated.

Thanks in advance.


Pete
Top achievements
Rank 1
 answered on 31 Aug 2011
1 answer
109 views
Hi,

i was wondering if it is possilbe to save the item's property of an element using the persistence framework.
To be exact, i have a tileview with an itemssource bound to a collection of inside my viewmodel and i want to save the items and the position of the items.
Alex Fidanov
Telerik team
 answered on 30 Aug 2011
2 answers
187 views
Hi,

I have a treeview nested inside the item template of another treeview.

I would like to be able to use the preview line default behavior for drop targeting in the inner treeview.

I would like for the top level treeview to pass the previewdragended event down to the nested treeview, but only for certain payload types.

Is there any way this can be done?

Thank you,
Justin
Justin
Top achievements
Rank 1
 answered on 30 Aug 2011
2 answers
124 views
I have seen examples that show a nice border with a title over the Grid View. I see the telerikQuickStart (below) beeing used

<telerikQuickStart:QuickStart.ExampleHeader>

along with a Border control on top of the GridVew declaration but I can't see the "title". What am I missing?

<Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" Grid.RowSpan="3" />

Thanks,
Marcelo
Top achievements
Rank 1
 answered on 30 Aug 2011
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?