Telerik Forums
UI for WPF Forum
8 answers
209 views
Howdy,

I have two questions dealing with the UriImageProvider:

1) Are there limits to what size/resolution image you should use with the UriImageProvider? I seem to be unable to load files that have huge resolution (25,200 x 18,000 3.3 MB GIF for example).

2) I need to be able to hide/disable the grey area of the map control when using UriImageProvider. I am allowing users to drag MapPinPoints onto the map, but want to deny them ability to do so outside the bounds of the underlying image. Any ideas how this can be accomplished? I also would like to prevent zooming too high so that the user can no longer see the image (I would hope that I could look at the underlying image, check the resolution, and set the MinZoomLevel of the map control based on it's size).

Thanks,
Seth
Andrey
Telerik team
 answered on 21 Oct 2011
1 answer
170 views
I'm trying to modify the text size for RadTabItem headers for the entire application. If I set fontsize on the control itself it will apply to all children so I'm modifying the template to change the size on just the header content control.

I'm using the Metro theme set in the app.xaml.cs.

When I use Expression Blend to Edit a Copy of the template I would expect that the template that gets generated would be exactly the same as the default Metro radtabitem template but it's not. If I drop a tabcontrol, edit template (copy) and run the app the background of the active tab is no longer white. I thought that setting the Theme explicitly on the control and then generating a copy might make a difference but it didn't.

Is the suggested way to make changes like this to use Blend and generate a copy like I would for normal controls or do I have to include the Telerik theme project and modify the xaml directly there?
Petar Mladenov
Telerik team
 answered on 21 Oct 2011
2 answers
261 views
Hi,

I have a very annoying issue. I bind the radgridview to a list of 100 items. I scroll down the list until item100. I rebind the gridview to a list of 3 items. The problem is the following: if AlternationCount is set to a value > 0, the list is not refreshed and the items in the list are not visible, until I force a refresh by maximizing the window that hosts the gridview. The scrollbar position is not reset to 0.

I attach an example of how to reproduce this problem using the latest stable version (.NET 3.5)

Steps:
1. run the app
2. scroll the grid to bottom
3. click on "Test" button
4. the grid is rebinded. The 3 items should be visible. If AlternationCount = 2 we have an issue. If you remove AlternationCount the items are visible.

MainWindow.xaml

<Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button Content="Test" Click="Button_Click" />
        <telerik:RadGridView Margin="0,10,0,0" Grid.Row="1" ItemsSource="{Binding Items}" AutoGenerateColumns="False" AlternationCount="2" AlternateRowBackground="#E6E3E3">
            <telerik:RadGridView.Columns>
                <telerik:GridViewColumn Width="80" Header="ID">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding ID}" VerticalAlignment="Center" HorizontalAlignment="Left" TextTrimming="CharacterEllipsis" />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Width="80" Header="Data">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" VerticalAlignment="Center" HorizontalAlignment="Left" TextTrimming="CharacterEllipsis" />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>

MainWindow.xaml.cs
public partial class MainWindow : Window
   {
       public MainWindow()
       {
           InitializeComponent();
       }
 
       private void Button_Click(object sender, RoutedEventArgs e)
       {
           ((MainWindowViewModel)DataContext).Test2();
       }
 
       private void Window_Loaded(object sender, RoutedEventArgs e)
       {
           DataContext = new MainWindowViewModel();
           ((MainWindowViewModel)DataContext).Test1();
       }
   }


MainWindowViewModel.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
 
namespace GridViewBug
{
    public class Stuff
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }
 
    public class MainWindowViewModel : INotifyPropertyChanged
    {
        private PropertyChangedEventHandler _propertyChangedEvent;
        public event PropertyChangedEventHandler PropertyChanged
        {
            add
            {
                _propertyChangedEvent += value;
            }
            remove
            {
                _propertyChangedEvent -= value;
            }
        }
 
        protected virtual void NotifyPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = _propertyChangedEvent;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
 
        private List<Stuff> _items;
        public List<Stuff> Items
        {
            get { return _items; }
            set
            {
                _items = value;
                NotifyPropertyChanged("Items");
            }
        }
 
        public void Test1()
        {
            Items = new List<Stuff>();
            for (int i = 0; i < 100; i++)
            {
                Items.Add(new Stuff() { Name = "item" + i.ToString(), ID = i });
            }
        }
 
        public void Test2()
        {
            var items = new List<Stuff>();
            items.Add(new Stuff() { Name = "item1", ID = 1 });
            items.Add(new Stuff() { Name = "item2", ID = 2 });
            items.Add(new Stuff() { Name = "item3", ID = 3 });
 
            Items = items;
        }
    }
}

Jean
Top achievements
Rank 1
 answered on 21 Oct 2011
1 answer
113 views

WPF v2011.2.712.40

We have a grid showing a list of contacts with email addresses.  If an email is not valid a UriFormatException is thrown when just hovering over the hyperlink or trying to click on the hyperlink.  How can we trap this and stop the exception from being thrown?  I looked for error events on the grid and could not find anything obvious.

<telerik:GridViewDynamicHyperlinkColumn Header="Email" NavigateUrlMemberPaths="EmailAddress" NavigateUrlFormatString="{} mailto:{0}"  DataMemberBinding="{Binding EmailAddress}" />
Vlad
Telerik team
 answered on 21 Oct 2011
1 answer
144 views
Hello,

We have a RadTreeView inside the selected contents of a RadOutlookbar.
 
There are
4 items for RadOutlookbar, and each click on each item loads the same TreeView.

However we have an unpleasant side effect, the control gives the impression of a collapse / expand every time.

1. Is it possible to avoid this behavior?
2. Is there a way to load a xaml part in a right side (imagine the details of the mails in Outlook after clicking folder). This means that the left side would never be reloaded. (FYI : We have implemented a MVC with Magellan)

thank you very much
Herve
Petar Mladenov
Telerik team
 answered on 21 Oct 2011
1 answer
118 views
Hello Telerik,
I've to develop a new project based on WPF (I've done SL for 3 years), one request is modularity so I've studied a bit and found my needs in prism 4.0 and in a MVVM pattern. Since prims utilize a shell, can I have it living with a Telerik Docking control? I've seen that there's a SL implementation of a template : http://www.telerik.com/community/code-library/silverlight/general/sl-mvvm-modular-prism-4-0-template.aspx

does it also work with WPF?

What's the approach of Telerik controls with MVVM?
Thanks
Paolo
George
Telerik team
 answered on 21 Oct 2011
5 answers
302 views
Hello

I add a ComboboxColumn to my grid
and I bind the data to the grid with a datatable
but no value is set to the combobox column
this is my code

<

 

telerik:GridViewComboBoxColumn

 

 

 

DataMemberBinding="{Binding Path=ActivityType}"

 

 

DisplayMemberPath="Name"

 

 

SelectedValueMemberPath="ID"

 

 

HeaderText="‘…‚&#13;”’‰Œ…š"

 

 

UniqueName="ActivityType" /> 

 

 

((

GridViewComboBoxColumn)this.RadGridView1.Columns[10]).ItemsSource = GetActivityTypes();

 

 

RadGridView1.ItemsSource = GetDataGrid();

 

 

 

 

 

 

 

 

 

 

 

christine
Top achievements
Rank 1
 answered on 21 Oct 2011
1 answer
86 views
I am attempting to use the ExpressionEditor to build an expression string for an object (building a custom template designer) pretty similar to the examples using it to filter data. The difference however is I'll have multiple tables/objects, and won't know which one I'll need till run time (I'll only build the string for one table/object like in the examples).

 I currently have the Item bound to an object, and that gets set after the user selected the object to build the string for. The object is getting set, but the Selected Category Items Pane is not getting refreshed after the object gets updated. I can set up to where the user selected the item on a previous screen, but would really like the list to be truly dynamic.

Item="{Binding BindingObject,NotifyOnSourceUpdated=True,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"

Basically, is there a way to refresh the Selected Category Items Pane, or a better way to bind the item dynamically?
Maya
Telerik team
 answered on 20 Oct 2011
3 answers
121 views
Does anyone have a behavior or attached property that would enabled me to create GridViewDataColumn "templates" for all of the possible columns that are autogenerated from DataTable?  The ItemsSource is a DataTable that could have various different columns from a finite list of all potential columns.  I'd like to template every potential column.
AdaDog
Top achievements
Rank 1
 answered on 20 Oct 2011
7 answers
322 views
Hi,
  I am working on dynamic loading of RadPanelBar Control. I am having a collections where 2 levels of topics would be there
The data would be in the below format
Id             Name             ParentCategoryID     LEVEL
19741         A                         19737                         1
19749         B                         19737                         1
19750         C                         19749                         2
19772         D                         19749                         2
19742         E                         19741                         2
19743         F                         19741                         2
19744         G                        19741                         2
I want to bind the Level 1 data in the parent level and Level 2 data with whose parentid matches with the id will be displayed as the child level
Eg) A and B are at the parent levels.
C,D will be displayed under B and E,F,G will be displayed under A
I created the following template to display this

<telerik:RadPanelBar x:Name="pnlTopic" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" ExpandMode="Single" telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" ItemsSource="{Binding Topics}" SelectedItem="{Binding SelectedTopic}">
                                          <telerik:RadPanelBar.ItemTemplate>
                                              <DataTemplate>
                                                  <telerik:RadPanelBarItem Header="{Binding Name}" IsSelected="True" IsExpanded="{Binding DataContext.IsExpanded,ElementName=pnlTopic}" x:Name="pnliTopic" >
                                                      <ListBox x:Name="lstSubTopics" ItemsSource="{Binding DataContext.SubTopics,ElementName=pnlTopic}">
                                                          <ListBox.ItemTemplate>
                                                              <DataTemplate>
                                                                  <TextBlock Text="{Binding Name}" Margin="2" FontWeight="SemiBold" />
                                                              </DataTemplate>
                                                          </ListBox.ItemTemplate>
                                                      </ListBox>
                                                  </telerik:RadPanelBarItem>
                                              </DataTemplate>
                                          </telerik:RadPanelBar.ItemTemplate>
                                          <i:Interaction.Triggers>
                                              <i:EventTrigger EventName="SelectionChanged">
                                                  <i:InvokeCommandAction Command="{Binding AccordionSelectionChange}" CommandParameter="{Binding Item}"/>
                                              </i:EventTrigger>
                                          </i:Interaction.Triggers>
                                      </telerik:RadPanelBar>

I am getting the topics correctly and I was not able to filter the second level elements since the selecteditem for RadPanelBar always return null values(I'm using MVVM model). Also I was not able to expand the radpanelbar items in design. Should i need to add code for that? i want to expand the selected element. please respond me asap.

Regards,
R.Saranya.
 
Petar Mladenov
Telerik team
 answered on 20 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?