Telerik Forums
UI for WPF Forum
11 answers
1.3K+ views
Hi,

I need to be able to select items on right click so that the context menu functions can look at SelectedItem and get the right result. I looked at using the ContextMenuOpening event but this doesnt show which item the mouse was over when triggering the event.

Any suggestions will be greatly appreciated thanks.

p.s. When is dragging items between multiple treeviews likely to be available?

Thanks,
Martin
Kiril Stanoev
Telerik team
 answered on 15 Jul 2010
3 answers
93 views
I noticed that certain events like ToolTipOpening and PreviewMouseDown are not being fired from objects (like MapPolygon and Ellipse) in the information layer. Is there a specific reason for this? Is it possible to handle these events in some way?
Andrey
Telerik team
 answered on 14 Jul 2010
4 answers
108 views
I have a simple collection with: name, title, category, position. I want all with category=1 Aggregated, but in the order then come in the collection always sorted on "position". And I want no Aggregation on Category=0.  I also ned in the custom header for "Category=1", how many items there are in that segment

Or should I do this by Hierarchy?  This is a n Example wo the grid should look like. 

"Name", "Title", "Cat", "Pos"  (>--  is the aggregated rows)

Name 1, Title 1, 0, 0
Name 2, Title 2, 0, 1
Name 3, Title 3, 0, 2
>-- Name 4, Title 4, 1, 3
>-- Name 5, Title 5, 1, 4
>-- Name 6, Title 6, 1, 5
Name 7, Title 7, 0, 6
Name 8, Title 8, 0, 7
Name 9, Title 9, 0, 8
>-- Name 10, Title 10, 1, 9
>-- Name 11, Title 11, 1, 10
Name 12, Title 12, 0, 11


/Ken
Kennet
Top achievements
Rank 2
 answered on 14 Jul 2010
5 answers
684 views

When binding and setting Visibility to Collapsed the item's empty space still remains. I have tested with many examples. Simple one is here

        <ListBox x:Name="HorizontalListBox">  
            <ListBox.ItemsPanel>  
                <ItemsPanelTemplate>  
                    <telerik:RadCarouselPanel/>  
                </ItemsPanelTemplate>  
            </ListBox.ItemsPanel>  
            <ListBox.ItemTemplate>  
                <DataTemplate>  
                    <TextBlock Text="{Binding Name}" Visibility="{Binding Visible}" />  
                </DataTemplate>  
            </ListBox.ItemTemplate>  
        </ListBox>  
        <Button Height="23" Width="70" Content="lol" Click="Button_Click" /> 

    public class Person : INotifyPropertyChanged  
    {  
        private int age;  
        private String name;  
 
        public Person(String name, int age)  
        {  
            this.name = name;  
            this.age = age;  
        }  
 
        public int Age  
        {  
            get { return this.age; }  
            set { this.age = value; }  
        }  
 
        public String Name  
        {  
            get { return this.name; }  
            set { this.name = value; }  
        }  
 
        Visibility _visible = Visibility.Visible;  
        public Visibility Visible  
        {  
            get { return _visible; }  
            set { _visible = value; OnPropertyChanged("Visible"); }  
        }
        #region INotifyPropertyChanged Members  
 
        public event PropertyChangedEventHandler PropertyChanged;  
        protected void OnPropertyChanged(string pname)  
        {  
            if (PropertyChanged != null)  
                PropertyChanged(thisnew PropertyChangedEventArgs(pname));  
        }
        #endregion  
    }  
 
              
 
        HorizontalListBox.ItemsSource = this.CreateItemSource(); // call from anywhere, like constructor  
 
        ObservableCollection<Person> list = new ObservableCollection<Person>();  
        private ObservableCollection<Person> CreateItemSource()  
        {  
            list.Add(new Person("George", 15));  
            list.Add(new Person("Rashko", 55));  
            list.Add(new Person("Britney", 60));  
            list.Add(new Person("Joe", 32));  
            list.Add(new Person("Vader", 34));  
            list.Add(new Person("Luke", 16));  
            list.Add(new Person("Jimmy", 105));  
            list.Add(new Person("Batman", 45));  
            list.Add(new Person("Butters", 9));  
            list.Add(new Person("Cartman", 9));  
            list.Add(new Person("Bender", 150));  
 
            return list;  
        }  
 
        private void Button_Click(object sender, RoutedEventArgs e)  
        {  
            list[3].Visible = System.Windows.Visibility.Collapsed;  
        } 

Now, when you click the button you can see the 4th item got invisible but still taking the space. However if you remove ListBox.ItemsPanel tagand then check again it will be collapsed as it should.

I have checked it with few examples and all are same, is there anyway to do that except removing the item from collection ?

x
Top achievements
Rank 1
 answered on 14 Jul 2010
3 answers
271 views

Summary: Setting the 'Maximum' property to a value less than the 'Minimum' property causes any binding on the

'Maximum' property to break.

I have a control that has the following bindings:

<telerik:RadNumericUpDown

Minimum="0"

Maximum="{Binding Path=SnapshotCount, ElementName=GameDisplay, Mode=OneWay, Converter={StaticResource

SnapshotCountToMaxIndexConverter}}"

Value="{Binding Path=SnapshotIndex, ElementName=GameDisplay, Mode=TwoWay}"

/>

The problem is that when the SnapshotCountToMaxIndexConverter converter returns a value less than the minimum (in my particular case it was returning -1) then the following code is triggered to execute in RadRangeBase.cs:

 

private void CoerceMaximum()

{

if (this.Maximum < this.Minimum)

{

this.SetValue(MaximumProperty, this.Minimum);

}

 

This appears to break the binding because afterwardsI can see via breakpoints that the

OnMaximumPropertyChanged() method is no longer called.

The net effect of this is that the control becomes unusable because the only value that can then be entered into the field is the minimum value since the minimum and the maximum values are the same and the binding doesn't update what the maximum should be.

 

Interestly, I also have the exact same binding on a RadSlider() and the binding does not appear to break for that control.

NOTE: This problem is easy to avoid by ensuring that you never specify a maximum value that is less than the minimum.

PS: I love the controls by the way.

Konstantina
Telerik team
 answered on 14 Jul 2010
10 answers
1.1K+ views
Hello!

There is a detail that I need to change somehow.
I use a simple GridView bounded to a ObservableCollection of objects. These objects have a boolean property that it's represented in the table as a checkbox. 
My case is similar with the GridView/CellEditTemplate example
The only operation I do on this GridViev is to check or uncheck these check-boxes in order to use the checked items further in my program.
Now, in order to do that I have to make 3 mouse clicks: one for selecting the row, one for selecting the cell and one for check/uncheck. Since all my columns are read only excepting that one I've mentioned before, I would like to check/uncheck an item from the first click, or at least from the second one.
I've tried to add behavior for double click for example

private void radGridView_MouseDoubleClick( object sender, MouseButtonEventArgs e ) { 
            RadGridView radGrid = (RadGridView)sender; 
            DataInfo actualRow = (DataInfo)radGrid.SelectedItem; 
            actualRow.IsSelected = actualRow.IsSelected == false; 
        } 

but this will change my DataInfo object without actually checking it's combobox in the user interface.
Of course, you would say to call radGrid.Rebind(); method, but in this case, for a 100 objects collection the entire focus of this table will move up to the first one (considering that I make the checking on a row in the end of the table) and I'm not happy with that.

Is there other work around for this?

Hopping that I was coherent enough!
Best wishes,
Roxana C



Milan
Telerik team
 answered on 14 Jul 2010
1 answer
115 views
Hi,

I want to know if it is possible to change the column header ,column type and column visibility of a child in a hierarchical gridview that has been bound to a dataset?

Is this possible and how will i go about?




Milan
Telerik team
 answered on 14 Jul 2010
1 answer
45 views
Hi, I'm trying to compile the TreeView examples, but VS2010 does not find the  Style="{StaticResource DefaultHeaderedContentControlStyle}"
All the examples requires this style. Where is?

What I've to do?

Thanks a lot and regards.
Andrea
Dimitrina
Telerik team
 answered on 14 Jul 2010
6 answers
570 views
Hi,

I am having a problem achieving what I want to with the WPF RadGridView and the DataFormatString property. I have a grid with various numeric values and need to set the format of these values at a row level as opposed to a column level. It has not been possible to bind the DataFormatString to a property of the row data item.

I have tried to use control templates both declarative and programmatic with template selector but the performance is not good compared with the standard GridViewDataColumn implementation.

Is there any way that I can bind to this property or any other suggestions as to how I achieve the requirement of formatting the data of a cell based a property of the row dataitem.

To explain a little further here is my object:

public class PlanningItem
{
    public string ItemName { get; set; }
    public string ItemFormat { get; set; }
    public double ItemValue { get; set; }
}

And the GridView would look something like:

<telerik:RadGridView AutoGenerateColumns="False" Name="radGridView1" ItemsSource="{ Binding Path=PlanningItems }">
   <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn UniqueName="ItemName" Header="Item Name" DataMemberBinding="{ Binding Path=ItemName }" IsReadOnly="True" />
        <telerik:GridViewDataColumn UniqueName="ItemValue" Header="Item Value" DataMemberBinding="{ Binding Path=ItemValue}" DataFormatString="{ Binding ItemFormat }"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>

Thanks

Oliver
Veselin Vasilev
Telerik team
 answered on 14 Jul 2010
1 answer
103 views
The sampling and performance of RadChart's ability to show thousands of data points in an intelligent way is great. The biggest problem for me is how to transfer this data from the server to client. In a real world scenario, this data is going to reside in a persistent store like database and a WCF service will help getting it.

All the example's I've seen so far works with random data generation on the client side. How can I efficiently bring such a large volume of data from a WCF service.

I believe the sampling only occurs on the client side after you have bound all the datapoints, series mapping to the chart.

Many Thanks in Advance.

Saravana. 
Giuseppe
Telerik team
 answered on 14 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?