Telerik Forums
UI for WPF Forum
1 answer
147 views
Hi,
  I was trying to use the dynamic layer and my goal was to only get items within the viewport. My data is stored with a quadkey up to lever 2^14 and because of that  I need to set the ZoomGrid to 2^level * 2^level cells.
    Looking with reflector in the the DynamicLayer code I've realized that the call back for getting the items for a particular cell is iterating through the entire cell set rather than being restirected to the one in the view.
  This is obviously causing the application to freeze on high levels(9+). Am I missing something in my implementation? 
   Are there any plans to introduce a DynamicLayer class that is similar with the Bing Tile system? I would take any beta version into consideration as where I am standing now I have to implement my own. Please advise!
Regards,
Dan
Andrey
Telerik team
 answered on 28 Sep 2010
8 answers
1.0K+ views
I have a small RadTabControl that has 3 RadTabItems as children. I've tried setting up the GetFocus events on the RadTabItem in both XAML and in code, but they do not fire. Has anyone else seen this issue?

Also, I tried to use the RadTabControl.SelectionChanged event as a work around, but that fires when the control loads, not just when the user changes selection so it didn't help.
Arnstein
Top achievements
Rank 1
 answered on 28 Sep 2010
1 answer
324 views
I am in the process of evaluating the Telerik controls and have moved to trying to use them in our actual project.  However, I cannot get a design time experience for any Rad control in Blend.  I get an error in the results panel that reads: Cannot locate resource 'themes\genericvista.xaml'.  I can create a standard out-of-the-box project and it works ok.  Our project is a bit different.  Here is the setup to hopefully find a solution:

VS2010, Blend 4, .Net 3.5
Telerik 2010.1.422.35

Our WPF exe project is separate from where we design.  We have a Shell.exe project and it references our "Views.dll" project where all of the design takes place. Our shell project builds to a non-default location.  It builds to ..\bin\Debug instead of bin\debug.  We have also changed all project to have a build target platform of x86 instead of Any CPU.  (Just pointing this out because you never know what might help get an answer).

My next step is to create an out of the box solution - get it to work with Telerik - and then step by step mirror what we are doing in our project.  If I get the same error then I will have a solution I can upload it here.   I am hoping someone can read this and help me with a solution before I go through all of that :)

Thanks.
Vlad
Telerik team
 answered on 28 Sep 2010
1 answer
88 views
I want to add a button inside the treeview container style & how can I add click event.
I am using a HierarchicalDataTemplate.

this.OfficesDataSource = new List<OfficeName>();
OfficeName o;
EmployeeName e;
this.OfficesDataSource.Add(o = new OfficeName("A"));
            o.EmployeeNames.Add(e = new EmployeeName("X"));
            o.EmployeeNames.Add(new EmployeeName("Y"));
            this.OfficesDataSource.Add(o = new OfficeName("B"));
            o.EmployeeNames.Add(new EmployeeName("Z"));
            this.DataContext = this.OfficesDataSource;


Thanks
Pravesh
Pravesh
Top achievements
Rank 1
 answered on 28 Sep 2010
2 answers
346 views
Hi, I have a database set up with a Client table and a Project table. Clients have projects, and I set up a Hierarchical Data Template to display them in the treeview. I am now putting functionality in for adding/removing both clients and projects, but I've run into an issue.

Adding and removing Clients (the parent nodes) will update the treeview immediately when I call the INotifyPropertyChanged on the ObservableCollection that it is bound to, but the Projects (the children nodes) won't update until I close the application and start it again.

Here is all the relevant code I can think of:

my xaml:
    <Page.Resources>
        <DataTemplate x:Key="Projects" DataType="{x:Type local:Project}">
            <StackPanel Orientation="Horizontal">
                <Image Source="/Images/Project.png" Height="20" Margin="0,0,8,0" />
                <TextBlock Text="{Binding Name}" />
            </StackPanel>
        </DataTemplate>
        <HierarchicalDataTemplate x:Key="Clients" DataType="{x:Type local:Client}" ItemTemplate="{StaticResource Projects}" ItemsSource="{Binding Projects}">
            <StackPanel Orientation="Horizontal">
                <Image Source="/Images/Client.png" Height="20" Margin="0,0,2,0" />
                <TextBlock Text="{Binding Name}" />   
            </StackPanel>           
        </HierarchicalDataTemplate>
        <Style x:Key="ItemContainerStyle" TargetType="{x:Type telerik:RadTreeViewItem}">
            <Setter Property="Template" Value="{StaticResource SavanetekTreeItem}"/>
        </Style>
    </Page.Resources>
 
<telerik:RadTreeView x:Name="RadTreeView1" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                         Style="{StaticResource SavanetekTreeViewStyle}" ItemsSource="{Binding ClientList}" SelectedItem="{Binding Path=SelectedObject, Mode=TwoWay}"
                         ItemTemplate="{StaticResource Clients}" ItemContainerStyle="{StaticResource ItemContainerStyle}">
            <telerik:RadTreeView.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="New Client..." Click="MenuItemNewClientDetails_Click" />
                    <MenuItem Header="New Project..." Command="{Binding NewProjectCommand}" />
                    <Separator />
                    <MenuItem Header="Edit..." Click="MenuItemEditClientDetails_Click"/>
                    <Separator />
                    <MenuItem Header="Remove..." />
                </ContextMenu>
            </telerik:RadTreeView.ContextMenu>
        </telerik:RadTreeView>


my remove function:

Public Sub Remove()
        If (IsProject(SelectedObject)) Then
            DB.Projects.DeleteOnSubmit(SelectedObject)
            SubmitChangesToDatabase()
        ElseIf (IsClient(SelectedObject)) Then
            DB.Clients.DeleteOnSubmit(SelectedObject)
            SubmitChangesToDatabase()
        Else
 
        End If
 
        RefreshClientList()
    End Sub

And my code for the ClientList with the Refresh and the function to cast the SelectedObject to a Client or a Project:

Private _clientList As ObservableCollection(Of Client)
    Public Property ClientList() As ObservableCollection(Of Client)
        Get
            Return _clientList
        End Get
        Set(ByVal value As ObservableCollection(Of Client))
            _clientList = value
            OnPropertyChanged("ClientList")
        End Set
    End Property
 
Public Sub RefreshClientList()
        ClientList = New ObservableCollection(Of Client)()
        ClientList = ClientRepo.FindAll()
        OnPropertyChanged("ClientList")
    End Sub


I had tried putting a for each loop in the refresh function that listed all the projects in the ClientList, and it does in fact delete/add the Projects to it, so I know that it has the proper data. It just isn't displaying it for some reason.

I would greatly appreciate if anyone knows how to remove a child from a parent on the treeview and have it refresh
Eric
Top achievements
Rank 1
 answered on 28 Sep 2010
1 answer
100 views

Hello,

I am really hoping that someone can help me. I am new to the Telerik controls and am having an issue with the saving of the layout of a RadDocking control when it is embedded within a RadTabControl's ContentTemplate.

I am saving the layout to a file so I can verify that it is being formatted correctly, however the SerializationTags are not getting output to the file.

Here is a snippet of the XAML to show that I am setting the SerializationTag for my RadDocumentPane:

 

 

 

 

<telerikNavigation:RadTabControl.ContentTemplate>  

 

<DataTemplate>  

 

<Grid>  

 

<radDock:RadDocking x:Name="ResultDocuments" Background="Transparent"

 

 

<radDock:RadDocking.DocumentHost>

 

 

 

 

<radDock:RadSplitContainer SizeChanged="SplitContainer_SizeChanged" >

 

 

 

 

<radDock:RadPaneGroup Name="RadDocumentGroup" Background="Transparent"

 

 

 

                                           radDock:RadDocking.SerializationTag="DocumentGroup">

 

 

 

 

<radDock:RadDocumentPane

 

 

 

                            DataContext="{Binding DataContext,ElementName=ResultDocuments}"

 

 

 

                            Margin="0,0,0,-5" Name="DocumentPane" Title="Documents"

 

 

 

                            radDock:RadDocking.SerializationTag="DocumentPane"

 

 

 

                            HorizontalContentAlignment="Left" CanUserClose="False">

 

 

 

 


Here is a snippet of the output file I am getting:

 

 

 

  <RadDocking>
  <DocumentHost>
  <RadSplitContainer>
  <Items>
  <RadPaneGroup SelectedIndex="0">
  <Items>
  <RadDocumentPane IsDockable="True" Header="Documents" />
  </Items>
  </RadPaneGroup>
  </Items>
  </RadSplitContainer>
  </DocumentHost>

 

 

 

 

Tracy
Top achievements
Rank 1
 answered on 27 Sep 2010
4 answers
737 views
It is necessary to find a specific named element in the CellTemplate of a GridViewColumn.

There is a GridViewColumn defined like this:

<GridViewColumn Header="column 1">
     <GridViewColumn.CellTemplate>
          <DataTemplate>
               <TextBox x:Name="txtcontent"/>
          </DataTemplate>
     </GridViewColumn.CellTemplate>
</GridViewColumn>

It is possible to find an element in a DataTemplate by getting the ContentPresenter where the DataTemplate is applied, and using the FindName method of the DataTemplate to find a specific element.

DataTemplate celltemplate = column.CellTemplate;
ContentPresenter contentpresenter = ...
TextBox txtbox = (TextBox)celltemplate.FindName("txtcontent", contentpresenter);

How can you find the ContentPresenter where the GridViewColumn CellTemplate is applied?
Adam Clark
Top achievements
Rank 1
 answered on 27 Sep 2010
3 answers
254 views
Hi,

I have a situation which my legend text are long. I want to identify the series by placing a text label on the chart area to act as legend. Is there anyway to do that?

Thanks
Evgenia
Telerik team
 answered on 27 Sep 2010
1 answer
181 views
Hi I just ran the Rad Map ItemsVirtualization example from the demo code and I notice certain sluggishness when running the map. Looking at the output window of Visual studio I've noticed a large amount of the errors

A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Any idea why are those thrown?
And also if I increase the density of the grid like the next line of code

 this.dynamicLayer.ZoomGridList.Add(new ZoomGrid(2 << 13, 2 << 13, 13));
the number of the errors increases tremendously.
EDIT>> I looked more into the call stack and this is the error thrown




System.ArgumentOutOfRangeException occurred Message=The added or subtracted value results in an un-representable DateTime.
Parameter name: t
  Source=mscorlib
  ParamName=t
  StackTrace:
       at System.DateTime.op_Addition(DateTime d, TimeSpan t)
  InnerException:

 

Andrey
Telerik team
 answered on 27 Sep 2010
3 answers
145 views
public static bool DisplayInfoMessage1(string strMsg)
        {
           if (MessageBox.Show(strMsg, mstrProjectName, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                return true;
            }
            else
            {
                return false;
            }       
        }

I want to do this using the RadWindow.Confirm box Please Help I try it any times but cannot done it


RadWindow.Confirm(strMsg, new EventHandler<WindowClosedEventArgs>(OnClosed));        can not write inside static Method

private void OnClosed(object sender, WindowClosedEventArgs e)
        {
            
            if (e.DialogResult == true)
            {
                ConfirmationStatus = true;
            }
            else
            {
                ConfirmationStatus = false;
            }
        }
 
ConfirmationStatus  is Public Boolean value.
Miroslav Nedyalkov
Telerik team
 answered on 27 Sep 2010
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?