Telerik Forums
UI for WPF Forum
3 answers
106 views
Thanks for the help
Vlad
Telerik team
 answered on 31 May 2010
1 answer
112 views
Hey there!

I'm using Q1 2010 ComboBoxColumns in my GridView. For multi-editing 1-n items in my GridView i added a SelectionColumn and some controls outside the GridView so i can select as many items i want and use the outside controls for setting the properties for the selected items.

Furthermore it should be possible to edit one GridViewItem by setting the property directly by choosing from the ComboBoxColumn at the specific row. It would be great if i can do so without unselecting the other selected items. GridView.SelectedItems return all selected items of course, GridView.CurrentItem or GridView.SelectedItem returns the first selected item. I guess the GridView knows which row i'm editing because of the "cursor-editing" icon on the left side when clicking into one row.

For my purpose it is mandatory to retrieve this information in my CodeBehind, because i'm using 5 GridViewComboBoxColumns and their items are depending on the other selected ComboBoxItems, so if i select an item from the first ComboBoxColumn, the items of the second ComboBoxColumn have to be filtered because of my selection.

So i need to get the current row in my CodeBehing or a nice way to filter the ComboBoxColumns by DataBinding or any other way.

Looking forward to hearing from you.
All the best,
Markus
Maya
Telerik team
 answered on 31 May 2010
1 answer
47 views
Hello Telerik Team,

we need the RadTreeViewList for WPF. In development build its not included. Is there a delivery date for the Beta of 2010 Q2?

Best Regards

Bernhard
Veselin Vasilev
Telerik team
 answered on 31 May 2010
1 answer
96 views
I need a way to bind a SeriesMapping.LegendLabel to a custom object in code behind.  Can anyone provide an example of how to do this?
Velin
Telerik team
 answered on 31 May 2010
3 answers
197 views
Hi,
after I installed the latest build, 210.1.430.35,
my gridviewcomboboxcolumn gives exceptions, also cellstyle doesn't seem to work properly.
After  an item is added  to the itemssource of the comboboxcolumn inside the roweditended event handler of the radgridview, the following exception occurs after leaving this eventhandler:

System.ArgumentOutOfRangeException was unhandled by user code
  Message=Specified argument was out of the range of valid values.
Parameter name: index
  Source=Telerik.Windows.Data
  ParamName=index
  StackTrace:
       at Telerik.Windows.Data.QueryableCollectionView.GetItemAt(Int32 index) in c:\Builds\WPF_Scrum\Core_WPF_2010_Q1\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1202
       at Telerik.Windows.Data.DataItemCollection.get_Item(Int32 index) in c:\Builds\WPF_Scrum\Core_WPF_2010_Q1\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 431
       at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Generator.GenerateNext(Boolean stopAtRealized, Boolean& isNewlyRealized) in c:\Builds\WPF_Scrum\GridView_WPF_2010_Q1\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\GridViewItemContainerGenerator.cs:line 1204
       at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.GenerateNext(Boolean& isNewlyRealized) in c:\Builds\WPF_Scrum\GridView_WPF_2010_Q1\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\GridViewItemContainerGenerator.cs:line 236
       at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint) in c:\Builds\WPF_Scrum\GridView_WPF_2010_Q1\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewVirtualizingPanel.cs:line 1199
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
  InnerException:

The following style doesn't work with the latest build:
 <telerik:GridViewComboBoxColumn Header="Zit in"
                                                                     DataMemberBinding="{Binding ComponentCode}"
                                                                     DisplayMemberPath="SchemaCode"
                                                                          
                                                                     SelectedValueMemberPath=""
                                                                     EditTriggers="CellClick"
                                                                     ItemsSource="{Binding Source={StaticResource ParentSchemaCodes}}">
                                                    <telerik:GridViewComboBoxColumn.CellStyle>
                                                        <Style TargetType="{x:Type telerik:GridViewCell}">
                                                            <Setter Property="FontWeight" Value="Bold"/>
                                                            <Setter Property="Foreground" Value="DarkBlue"/>
                                                           
                                                            <Style.Triggers>
                                                                <DataTrigger Binding="{Binding IsVervallen}" Value="True">
                                                                    <Setter Property="Background" Value="#50FF0000"/>
                                                                </DataTrigger>
                                                            </Style.Triggers>
                                                        </Style>

                                                    </telerik:GridViewComboBoxColumn.CellStyle>
                                                </telerik:GridViewComboBoxColumn>

Thanks,
Thomas

Pavel Pavlov
Telerik team
 answered on 31 May 2010
1 answer
281 views
Hello,

I have a usercontrol that has a gridview in it binded to an observablecollection defined as a property of the usercontrol.
I need a 3 level cascading comboboxes on 3 columns, and I need to bind them to either properties or methods defined inside the usercontrol code behind class.
I've tried several things but I think I'm missing something, I'm kind of new to how binding works on wpf.
I'm trying to set the binding like this:

<telerik:GridViewDataColumn  
   Header="Questions" 
   DataMemberBinding="{Binding Operation, Mode=TwoWay}">     
   <telerik:GridViewDataColumn.CellEditTemplate>     
      <DataTemplate> 
         <telerik:RadComboBox DisplayMemberPath="operation" SelectedValuePath="id" 
         ItemsSource="{Binding Operations, Mode=TwoWay}" />     
      </DataTemplate> 
   </telerik:GridViewDataColumn.CellEditTemplate> 
</telerik:GridViewDataColumn> 

Where Operations is a Property of the UserControl, but I think it's trying to find Operations as a property of the Databound Object.

Any help would be appreciated.
Yavor Georgiev
Telerik team
 answered on 31 May 2010
1 answer
91 views
Hello!
I have a carousel that is using a ListCollectionView of a "CutomObject" List as ItemsSource ( for filtering purpose I need it this way )
Every time the user creates a new CustomObject, I make a refresh setting again the ItemSource of this carousel, with this new object in it.

view = new ListCollectionView( LayoutCapturer.GetSavedLayouts() ); 
            view.Filter = FilterObject; 
            this.carousel.ItemsSource = view; 
 
            this.carouselPanel.ItemsPerPage = ( carousel.Items.Count < 15 ) ? 
                ( ( carousel.Items.Count % 2 == 0 ) ? carousel.Items.Count - 1 : carousel.Items.Count ) : 15; 

But at this point I need that the top most element of the carousel to be the CustomObject I've just created.
Is that possible?

Thank you!
Roxana

Maya
Telerik team
 answered on 31 May 2010
8 answers
162 views
I have a custom RadPane control which inherits from RadPane.

I use the MVVM design pattern.

I programmatically add Panes to a RadPaneGroup contained in a DocumentHost.

I add one of my custom RadPanes. Everything is fine. Then I add another one - still fine.

I switch back to the first one and all content is gone - for example textboxes are empty, DropDownLists are in default selected state etc.

I switch back to the second one - same story.

In debug mode I can see that the custom RadPanes still have their respective ViewModel as DataContext and these ViewModel also have their properties correct but by switching between panes, these properties don't seem to bind to their respective controls (Textboxes, DropDownLists ...) anymore or the controls don't update their values correctly.


Jason Moore
Top achievements
Rank 1
 answered on 31 May 2010
1 answer
189 views
Hi.

I have a problem with setting up Selected event for RadPanelBar.
My aim is to catch an event when RadPanelBarItem is selected.

I am using DataTemplate for Item, and EntityObject entityObject containing a List<Employee>

XAML:
Resources:
<Window.Resources>   
 
<DataTemplate x:Key="RadPanelBarItemTemplate">   
 
<StackPanel MouseLeftButtonDown="pnlEmployee_MouseLeftButtonDown" Background="Transparent" Name="pnlEmployee" Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">   
 
<Image Source="{Binding Photo}" Stretch="Uniform" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="50" Height="50"></Image> 
 
<Label Name="lblEmployeeName" Height="50" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="{Binding Name}" />   
 
<Label Name="lblEmployeeID" Content="{Binding Id}" Visibility="Hidden" />   
 
</StackPanel>   
 
</DataTemplate >   
 
</Window.Resources>   
 
 

 


RadPanelBar: 

 

<telerik:RadPanelBar Grid.Row="1" Name="rpbLeftMenu" ExpandMode="Single" Selected="rpbLeftMenu_Selected">   
 
<telerik:RadPanelBarItem Name="rpbiEmployee" IsExpanded="True" ItemsSource="{Binding Employees}" ItemTemplate="{StaticResource RadPanelBarItemTemplate}">   
 
<telerik:RadPanelBarItem.Header>   
 
<StackPanel HorizontalAlignment="Left">   
 
<Label Name="lblEmployees" Content="Сотрудники"></Label>   
 
<TextBox HorizontalAlignment="Left" Name="txtEmployeesFilter" TextChanged="txtEmployeesFilter_TextChanged" Width="200"></TextBox>   
 
</StackPanel>   
 
</telerik:RadPanelBarItem.Header>   
 
</telerik:RadPanelBarItem> 
 
...  
 
</telerik:RadPanelBar>   
 

 

 

CodeBehind:

Getting data from DB:

try 
 
{   
 
IMSSDataClassesDataContext db = new IMSSDataClassesDataContext();   
 
var query = from employees in db.imss_employees   
            orderby employees.emp_lastname   
            select new { employees.emp_ID };   
 
foreach (var emp in query)   
{  
var em = db.get_employee_name_by_id(emp.emp_ID).First();   
entityObject.Employees.Add(  
new Employee(em.name, emp.emp_ID, ShowEmpImage(emp.emp_ID)));   
}  
 
rpbLeftMenu.DataContext = entityObject;  
 
}  
catch (Exception ex)   
{  
...  
}  
 


My solution for selecting Item event is to handle a StackPanel MouseLeftButtonDown event:

 

private void pnlEmployee_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)   
{  
StackPanel sp = sender as StackPanel;   
Label lb = sp.FindName("lblEmployeeID"as Label;   
this.Title = Convert.ToString(lb.Content); //just for testing purposes   
}  
 
 

But it works only when clicking correctly inside a stackpanel.

I want something like this:

  

<telerik:RadPanelBarItem Selected="RadPanelBarItem_Selected">   
<telerik:RadPanelBarItem.Header>   
<StackPanel Orientation="Horizontal" Margin="5">   
<TextBlock Text="BMW 128i Coupe" Margin="15 10 0 0" />   
</StackPanel>   
</telerik:RadPanelBarItem.Header>   
</telerik:RadPanelBarItem>   
   
private void RadPanelBarItem_Selected(object sender, Telerik.Windows.RadRoutedEventArgs e)   
{  
...  
}  
 

 

 

 

But I can't set Selected event handler for Items which are binded like mine:
ItemsSource="{Binding Employees}" 

How should I catch selection of Items?

Best regards,

Mike Ro
Top achievements
Rank 2
 answered on 31 May 2010
1 answer
74 views
Hi, I'm new to using your controls, but so far I'm liking it alot :)

I'm building a grid displaying data in a two level hierarchy which is easily achieved, but I was wondering if it was possible to display the rows of the second level in the same "master grid" in stead of generating a new gridviewdatacontrol? In my scenario this would give the best user experience.

Thanks in advance,

Best regards,
Kasper Schou
Kasper Schou
Top achievements
Rank 1
 answered on 29 May 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?