Telerik Forums
UI for WPF Forum
2 answers
158 views

Hello,

I have a RadGridView Control and I can't get it to restore a row after canceling an edit.

For example if I'm editing one cell, then editing another cell in the same row then press ESC twice 

I expect both of the cells to return to their previous state because the data source, correctly, isn't changed, but only

the last edited cell is changing.

It does work well however on your sliverlight demos, for example here:  http://demos.telerik.com/silverlight/#GridView/Commands

Thanks

Evgeny
Top achievements
Rank 1
 answered on 28 Feb 2011
4 answers
124 views
Hi Team,
   I have resgistered SliderValueChanged  event for RadSlider and when i am showing a validation thriugh MessageBox.show() in this event the event is being called multiple times unitl it reaches either first tick or last tick.

Please suggest me a solution to avoid this.

Thanks in advance.
Swathi.
Alex Fidanov
Telerik team
 answered on 28 Feb 2011
1 answer
289 views
Hello,

I have a RadGridView bound to a CollectionViewSource. The items in the collection view are sorted by Group Name (e.g "Group 1", "Group 2", etc...).

What is the best way to select all the items (based on group) when a user selects a single row? 

Thanks!
Maya
Telerik team
 answered on 28 Feb 2011
3 answers
377 views
Hi - I have a functioning tree view that is displaying a folder structure based collections of products, folders, and files.   When I navigate to  the file item, I would like to be able to double click the file and so be able to access the file object that was created for that item.  In my double click event however, I am unable to cast the tree view item as my file class:  I receive the error "Object reference not set to an instance of an object." for the line that attempts to cast the item as the file.  Is there an alternate way to get at my file object ?

private void radTreeView_DoubleClick(object sender, MouseButtonEventArgs e)
{
    e.Handled = true;
     
    RadTreeViewItem  selectedItem = e.OriginalSource as RadTreeViewItem;
    LogFile logfile = selectedItem.Item as LogFile;
 
        if (logfile != null)
        {
            MessageBox.Show("selected is file ");
            return;
        }
        return;
   }

Thanks!

Rich
Hristo
Telerik team
 answered on 28 Feb 2011
1 answer
124 views
Hi there, 

I have .NET ListView and I want to drag and item from the ListView to Telerik's RadTreeListView component.

I follow the example in here, but still doesn't work. Looks like the example only works two Telerik's component. So let's say if we want to do drag and drop between .NET standard component and Telerik component, how should I proceed?

Do I need to use .NET standard DragDrop manager and perform my own conversion to destination GridView (let's say we drop to RadGridView) ?

Regards, 

Arinto

Arinto
Top achievements
Rank 1
 answered on 28 Feb 2011
10 answers
246 views
Hi,

I have just started with evaluating telerik RadGridView. 
What I want is to make RadGridView behave like the wpf toolkit DataGrid regarding the last adding new row.
This row should be always visible and it should add the bound object to the underlaing list just when you click away or press enter.
A new empty adding row should be displayed as a last row immediately after.

I would really appreciate some hints on how to proceed with achieving this using telerik RadGridView.

Nikolay
Top achievements
Rank 1
 answered on 28 Feb 2011
3 answers
278 views

WPF 4.0, VB, 2010.3.110.40

If I put a button in the Header and click on it the IsExpanded property of the expander does not change (as I expected).
If I put a checkbox in the Header and click on it the IsExpanded property DOES change (as well as the IsChecked of the checkbox.  How can I have a checkbox in my header but not have it process as if the Expander Headerbar was clicked?

<telerik:RadExpander IsExpanded="True">
  <telerik:RadExpander.Header>
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>
      <Label Content="Filter Options" />
      <Button Grid.Column="1" Content="Test" />
      <CheckBox Name="showgrouppanel" Content="Show GroupBy Area" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right" />
    </Grid>
  </telerik:RadExpander.Header>
Tina Stancheva
Telerik team
 answered on 28 Feb 2011
1 answer
65 views
I am using a gridviewcomboboxcolumn to select a transaction code.  Because the description of the code may be fairly long, I would like to display the Code and Description in the Dropdown in Edit mode (e.g. 0110 Long Description) but when it is in Display mode I would like only the Code to show without the description (e.g. 0110).  (The ID of the transaction is saving perfectly to my MVVM model right now so this is a display issue only.)

thanks!
Maya
Telerik team
 answered on 28 Feb 2011
1 answer
159 views
Hi,

Is there any way to get the same EmptyText property in a GridViewComboBoxColumn as there is in a RadComboBox?

Many thanks
Jeremy
Maya
Telerik team
 answered on 28 Feb 2011
5 answers
288 views
RadControls for WPF Q3 2009.

I would like to know how best to represent two collections of data in two GridView controls.
We currently have situation where we have a collection of a data to be displayed and edited.  The objects in this collection have additional collections of other data, also which need to be edited.  (there are also cases where we have third level collections).

Currently we are forced to use WPF ListView controls to display this data, and edit them in TextBox/ComboBox fields.  The ListView supports the IsSynchronizedWithCurrentItem property, which synchonises the ListViews at multiple levels of the Business Object.

From what I can tell, the RadGridView does not appear to support IsSynchronizedWithCurrentItem.  I have attempted to use the SelectionChanged event on the RadGridView, with dissapointing results.  On particular occasions when clearing the binding on the second RadGridView, I get an exception "Cannot change ObservableCollection during a CollectionChanged event".
This occurs when the user clears the Row selection, by holding down the Ctrl key, and clicks on the row on the second time.  (Ie.  Selects a row, unselects the row, selects a row, unselects the row.)

Is there a particular method or way that I can occomplish this?

Here is an example of the ListView, next to our partially functioning RadGridView.
<Grid> 
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition/> 
            <RowDefinition/> 
        </Grid.RowDefinitions> 
        <Grid.ColumnDefinitions> 
            <ColumnDefinition/> 
            <ColumnDefinition/> 
            <ColumnDefinition/> 
            <ColumnDefinition/> 
        </Grid.ColumnDefinitions> 
        <ListView Name="uxListView1" Grid.Column="1" Grid.Row="0">  
            <ListView.View> 
                <GridView> 
                    <GridView.Columns> 
                        <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" /> 
                        <GridViewColumn Header="City" DisplayMemberBinding="{Binding City}" /> 
                        <GridViewColumn Header="Country" DisplayMemberBinding="{Binding Country}" /> 
                    </GridView.Columns> 
                </GridView> 
            </ListView.View> 
        </ListView> 
        <ListView Name="uxListView2" Grid.Column="1" Grid.Row="1">  
            <ListView.View> 
                <GridView> 
                    <GridView.Columns> 
                        <GridViewColumn Header="AreaCode" DisplayMemberBinding="{Binding AreaCode}" /> 
                        <GridViewColumn Header="Number" DisplayMemberBinding="{Binding Number}" /> 
                    </GridView.Columns> 
                </GridView> 
            </ListView.View> 
        </ListView> 
        <telerik:RadGridView xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"   
                Grid.Column="3" Grid.Row="0" 
                AutoGenerateColumns="False" CanUserFreezeColumns="False"   
                CanUserSortColumns="True" 
                CanUserInsertRows="True" 
                ShowGroupPanel="False" 
                x:Name="uxRad4GridView" UseAlternateRowStyle="False" telerik:StyleManager.Theme="Office_Black">  
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn IsFilterable="False" DataMemberBinding="{Binding Name}" /> 
                <telerik:GridViewDataColumn IsFilterable="False" DataMemberBinding="{Binding City}"/>  
                <telerik:GridViewDataColumn IsFilterable="False" DataMemberBinding="{Binding Country}"/>  
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
        <telerik:RadGridView xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"   
                Grid.Column="3" Grid.Row="1" 
                AutoGenerateColumns="False" CanUserFreezeColumns="False"   
                CanUserSortColumns="True" 
                CanUserInsertRows="True" 
                ShowGroupPanel="False" 
                x:Name="uxRad5GridView" UseAlternateRowStyle="False" telerik:StyleManager.Theme="Office_Black">  
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn IsFilterable="False" DataMemberBinding="{Binding AreaCode}" /> 
                <telerik:GridViewDataColumn IsFilterable="False" DataMemberBinding="{Binding Number}"/>  
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</Grid> 
 
using System.Collections.ObjectModel;  
using System.ComponentModel;  
 
public class Customer : INotifyPropertyChanged  
{
    #region fields  
    private string _name;  
    private string _country;  
    private string _city;  
    private ObservableCollection<Phone> _phoneNumbers;
    #endregion  
 
    #region ctor  
    public Customer()  
    {  
        _phoneNumbers = new ObservableCollection<Phone>();  
    }  
 
    public Customer(string name, string country, string city)  
    {  
        _name = name;  
        _country = country;  
        _city = city;  
        _phoneNumbers = new ObservableCollection<Phone>();  
    }  
 
    public Customer(string name, string country, string city, ObservableCollection<Phone> phoneNumbers)  
    {  
        _name = name;  
        _country = country;  
        _city = city;  
        _phoneNumbers = phoneNumbers;  
    }
    #endregion  
 
    #region properties  
    public string Name  
    {  
        get { return _name; }  
        set 
        {  
            _name = value;  
            NotifyPropertyChanged("Name");  
        }  
    }  
 
    public string City  
    {  
        get { return _city; }  
        set 
        {  
            _city = value;  
            NotifyPropertyChanged("City");  
        }  
    }  
 
    public string Country  
    {  
        get { return _country; }  
        set 
        {  
            _country = value;  
            NotifyPropertyChanged("Country");  
        }  
    }  
 
    public ObservableCollection<Phone> PhoneNumbers  
    {  
        get { return _phoneNumbers; }  
        set 
        {  
            _phoneNumbers = value;  
            NotifyPropertyChanged("PhoneNumbers");  
        }  
    }
    #endregion  
 
    #region Interface INotifyPropertyChanged  
    public event PropertyChangedEventHandler PropertyChanged;  
 
    private void NotifyPropertyChanged(string propertyName)  
    {  
        if (PropertyChanged != null)  
            PropertyChanged(thisnew PropertyChangedEventArgs(propertyName));  
    }
    #endregion  
}  
 
public class Phone : INotifyPropertyChanged  
{
    #region fields  
    private string _areaCode;  
    private string _number;
    #endregion  
 
    #region ctor  
    public Phone()  
    {  
 
    }  
 
    public Phone(string areaCode, string number)  
    {  
        _areaCode = areaCode;  
        _number = number;  
    }
    #endregion  
 
    #region properties  
    public string AreaCode  
    {  
        get { return _areaCode; }  
        set 
        {  
            _areaCode = value;  
            NotifyPropertyChanged("AreaCode");  
        }  
    }  
 
    public string Number  
    {  
        get { return _number; }  
        set 
        {  
            _number = value;  
            NotifyPropertyChanged("Number");  
        }  
    }
    #endregion  
 
    #region Interface INotifyPropertyChanged  
    public event PropertyChangedEventHandler PropertyChanged;  
 
    private void NotifyPropertyChanged(string propertyName)  
    {  
        if (PropertyChanged != null)  
            PropertyChanged(thisnew PropertyChangedEventArgs(propertyName));  
    }
    #endregion  
}  
 
using System;  
using System.Collections.ObjectModel;  
using System.Windows;  
using System.Windows.Controls;  
using System.Windows.Data;  
using Telerik.Windows.Controls;  
 
/// <summary>  
/// Interaction logic for Window5.xaml  
/// </summary>  
public partial class Window5 : Window  
{  
    public Window5()  
    {  
        InitializeComponent();  
 
        Binding binding;
        #region ListView.  Works by using IsSynchronizedWithCurrentItem  
        ObservableCollection<Customer> list2 = CreateList();  
        binding = new Binding();  
        binding.Source = list2;  
        uxListView1.IsSynchronizedWithCurrentItem = true;  
        uxListView1.SetBinding(ListView.ItemsSourceProperty, binding);  
 
        binding = new Binding();  
        binding.Source = list2;  
        binding.Path = new PropertyPath("PhoneNumbers");  
        uxListView2.IsSynchronizedWithCurrentItem = true;  
        uxListView2.SetBinding(ListView.ItemsSourceProperty, binding);
        #endregion  
 
        ObservableCollection<Customer> list4 = CreateList();  
        binding = new Binding();  
        binding.Source = list4;  
        //uxRad4GridView.IsSynchronizedWithCurrentItem = true;   // Doesn't seem to be supported.  
        uxRad4GridView.SelectionChanged += new EventHandler<SelectionChangeEventArgs>(uxRad4GridView_SelectionChanged);  // Using this instead of IsSynchronizedWithCurrentItem  
        uxRad4GridView.SetBinding(RadGridView.ItemsSourceProperty, binding);  
 
        /// No point in binding it, as IsSynchronizedWithCurrentItem isn't supported.  
        //binding = new Binding();  
        //binding.Source = list4;  
        //binding.Path = new PropertyPath("PhoneNumbers");  
        //uxRad5GridView.IsSynchronizedWithCurrentItem = true;      // Doesn't seem to be supported.  
        //uxRad5GridView.SetBinding(RadGridView.ItemsSourceProperty, binding);  
    }  
 
    void uxRad4GridView_SelectionChanged(object sender, SelectionChangeEventArgs e)  
    {  
        /// When the user holds "ctrl" to unselect a row, we must clear the secondary Grid.  
        /// This however causes an exception to occur the second time a Row is unselected.  
        if (uxRad4GridView.SelectedItem == null)  
        {  
            uxRad5GridView.ClearValue(RadGridView.ItemsSourceProperty);  
        }  
        else 
        {  
            Binding binding = new Binding();  
 
            binding.Source = uxRad4GridView.SelectedItem;  
            binding.Path = new PropertyPath("PhoneNumbers");  
            uxRad5GridView.SetBinding(RadGridView.ItemsSourceProperty, binding);  
        }  
    }  
 
 
    private ObservableCollection<Customer> CreateList()  
    {  
        ObservableCollection<Customer> customers = new ObservableCollection<Customer>();  
        customers.Add(new Customer("John""USA""Chicago"new ObservableCollection<Phone>(new Phone[] { new Phone("XX""1234"), new Phone("XX""5678") })));  
        customers.Add(new Customer("Tim""USA""NY"new ObservableCollection<Phone>(new Phone[] { new Phone("AA""2345"), new Phone("AA""6789") })));  
        customers.Add(new Customer("Jeff""USA""W.D.C"new ObservableCollection<Phone>(new Phone[] { new Phone("ZZ""3456"), new Phone("ZZ""7890") })));  
        customers.Add(new Customer("Zhang""China""Shanghai"new ObservableCollection<Phone>(new Phone[] { new Phone("BB""4567"), new Phone("BB""8901") })));  
        customers.Add(new Customer("Li""China""Beijing"new ObservableCollection<Phone>(new Phone[] { new Phone("YY""5678"), new Phone("YY""9012") })));  
        customers.Add(new Customer("Wang""China""HongKong"new ObservableCollection<Phone>(new Phone[] { new Phone("CC""6789"), new Phone("CC""0123") })));  
        return customers;  
    }  
}  
 






Hidayet ÇELEN
Top achievements
Rank 1
 answered on 26 Feb 2011
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?