Telerik Forums
UI for WPF Forum
3 answers
209 views
I would like to have a grid with a button on each row that when pressed launches another window; the handler will have to know the contents of one of the data fields on the row (the pk) in order to display the new window. Based on the outcome of this process the user may or may not check a checkbox on that row that is not bound to data. There will be a button on the window outside of the grid that when pressed will run another process on all rows that have the checkboxes checked. I would also like to have buttons external to the grid that will check or uncheck all of the checkboxes. I have searched the examples and documentation and cannot find out how to determine the PK of the row when the button is pressed nor a way to iterate through the rows and process the ones with the checkbox checked. Some sample code would be appreciated as I'm new to WPF.
Stefan Dobrev
Telerik team
 answered on 12 Feb 2009
3 answers
142 views
Hi,

I've got a little question.

When i've got a lot of rows in my grid and i want to do scrolling using the scrollbar my cpu usage jumps to 80% or more until i stop scrolling!

Same happens with the fade effect when i hover over rows, then my cpu jumps to 60% or more until is stop hovering.

Do you have any explication or solution for this?

Valeri Hristov
Telerik team
 answered on 12 Feb 2009
2 answers
223 views
Hello,

I am having trouble enabling drag/drop functionality in a RadTreeView when I set its ItemsSource to a ListCollectionView. Here is an example:

<Window x:Class="WpfApplication6.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    SizeToContent="WidthAndHeight" 
    Title="Window1"
    <Telerik:RadTreeView x:Name="sourceTree" Height="300" Width="300" IsDragDropEnabled="True"/> 
</Window> 

    public partial class Window1 : Window 
    { 
        public Window1() 
        { 
            InitializeComponent(); 
 
            ObservableCollection<string> testCollection = new ObservableCollection<string>(); 
            testCollection.Add("one"); 
            testCollection.Add("two"); 
            testCollection.Add("three"); 
 
            ListCollectionView view = new ListCollectionView(testCollection); 
            sourceTree.ItemsSource = view; 
        } 
    } 

The items display fine, but when I drag and drop them nothing seems to happen. If I set the ItemsSource directly to the testCollection, it works just fine, but I need to use a ListCollectionView in my case in order to enable filtering. Is this a bug in the control, or am I doing something improperly? Thanks.

Martin
Top achievements
Rank 1
 answered on 11 Feb 2009
1 answer
121 views
Hello,

I believe I may have discovered a bug with the mousewheel scroll on RadNumericUpDown controls inside of a RadGridView. Here is some example code:

<Window x:Class="RadGridViewBug.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:t="http://schemas.telerik.com/2008/xaml/presentation" 
    Title="Window1" Height="300" Width="300"
  <StackPanel> 
    <t:RadGridView x:Name="grid" Height="300"/> 
  </StackPanel> 
</Window> 

    public partial class Window1 : Window 
    { 
        public Window1() 
        { 
            InitializeComponent(); 
            TestRow[] rows = new TestRow[2]; 
            rows[0] = new TestRow(); 
            rows[1] = new TestRow(); 
            grid.ItemsSource = rows; 
        } 
    } 
 
    class TestRow 
    { 
        public RadNumericUpDown updown1 { getset; } 
        public RadNumericUpDown updown2 { getset; } 
 
        public TestRow() 
        { 
            updown1 = new RadNumericUpDown(); 
            updown2 = new RadNumericUpDown(); 
        } 
    } 

When I run that code, if I press up or down on a couple of the RadNumericUpDown controls and then use the mousewheel to scroll them, the values of them all change instead of just the last one I clicked on. I would expect only the last one I clicked on to change while scrolling the middle mouse wheel. Thanks in advance for your response!


Valeri Hristov
Telerik team
 answered on 11 Feb 2009
2 answers
121 views
Hi,
I get the following exception when I mark IsHierarchyRoot as "False".

   at Telerik.Windows.Controls.GridView.GridViewItemsControl.ExpandToAvailableSpace() in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\GridViewItemsControl.cs:line 1329 
   at Telerik.Windows.Controls.GridView.GridViewItemsControl.GridViewItemsControl_Loaded(Object sender, RoutedEventArgs e) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\GridViewItemsControl.cs:line 852 
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) 
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) 
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) 
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) 
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent) 
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root) 
   at MS.Internal.LoadedOrUnloadedOperation.DoWork() 
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks() 
   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, Boolean isSingleParameter) 
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
   at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 
   at System.Threading.ExecutionContext.runTryCode(Object userData) 
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) 
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
   at System.Windows.Threading.DispatcherOperation.Invoke() 
   at System.Windows.Threading.Dispatcher.ProcessQueue() 
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) 
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) 
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) 
   at System.Windows.Threading.Dispatcher.Run() 
   at System.Windows.Application.RunDispatcher(Object ignore) 
   at System.Windows.Application.RunInternal(Window window) 
   at System.Windows.Application.Run(Window window) 
   at System.Windows.Application.Run() 
   at Imis.Kinetik.TeamPlayer.Client.App.Main() in C:\Projects\TeamPlayerClient\TeamPlayer.Client\obj\Development\App.g.cs:line 0 
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
   at System.Threading.ThreadHelper.ThreadStart() 

My define the grid like this (Info.Fields is a list):

<Telerik:RadGridView  MinHeight="200"   IsHierarchyRoot="False"  ShowGroupPanel="False" Grid.Row="7" Grid.ColumnSpan="2" Margin="5" AutoGenerateColumns="False" ItemsSource="{Binding Path=Info.Fields, ElementName=workunitNodeUC}" > 
            <Telerik:RadGridView.Columns> 
                <Telerik:GridViewDataColumn AutofitWidth="0" UniqueName="{x:Null}"
                    <Telerik:GridViewDataColumn.CellStyle> 
                        <Style TargetType="{x:Type Telerik:GridViewCell}"
                            <Setter Property="Template"
                                <Setter.Value> 
                                    <ControlTemplate  TargetType="{x:Type Telerik:GridViewCell}"
                                        <CheckBox x:Name="chbChosen" HorizontalAlignment="Center"/> 
                                    </ControlTemplate> 
                                </Setter.Value> 
                            </Setter> 
                        </Style> 
                    </Telerik:GridViewDataColumn.CellStyle> 
                </Telerik:GridViewDataColumn> 
                <Telerik:GridViewDataColumn AutofitWidth="0" HeaderText="Description" UniqueName="Description" DataMemberPath="Name" /> 
                <Telerik:GridViewDataColumn AutofitWidth="0" HeaderText="Comment" UniqueName="Comment" DataMemberPath="InnerValue"  /> 
            </Telerik:RadGridView.Columns> 
        </Telerik:RadGridView> 

Thanks
Tal
Top achievements
Rank 1
 answered on 11 Feb 2009
1 answer
302 views
Hello guys,

I have two questions:
  1. How can I bind a gridview from an Anonymous Type returned LINQ query?
  2. How can I get the key value from a grid bound from an Anonymous Type? On ASP.Net Ajax we use GetDataKeyValue method. Do you have a similar on WPF?

Regards,

Henrique
Hristo Deshev
Telerik team
 answered on 11 Feb 2009
1 answer
84 views
Hi,

I have a very simple project that contains tabs.  And inside one of the tabs is a grid.  If I filter the grid then switch to another tab and then back to the tab with the grid is no longer filtered.  However the filter is still selected.

Thanks

Guido Tapia
Hristo Deshev
Telerik team
 answered on 11 Feb 2009
3 answers
143 views
Hello,
 I want to bind textboxes and comboboxes to the columns of the Grid, In the textbox i want to validate the ip addresses, 
Is it possible to achieve?
A sample code would be helpful.

Thanks in advance 
Hristo Deshev
Telerik team
 answered on 11 Feb 2009
3 answers
442 views
I am trying to implement a simple drag and drop procedure in a RadGridView.  Using the SelectedItem property, I am able to tell which item in the grid I am using when I start dragging, but I also need to know which item they are dropping the item on.  How can I find which item in the list is at a specific position  (e.GetPosition)?

Sterling
Vlad
Telerik team
 answered on 11 Feb 2009
1 answer
100 views

Hello

I want to make carousel items 100% width, but unable to achieve that. Any help would be appreciated.

Here's the code

  <Grid>
<Grid.Resources>
<DataTemplate DataType="{x:Type local:XTraItem}">
<Grid Grid.Column="0" Grid.Row="0" Width="1000">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="900"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>

<Image Source="{Binding Path=ImageURI}" Grid.Column="0" Grid.Row="0" />
<TextBlock Text="{Binding Path=Name}" Foreground="AliceBlue" Grid.Column="1" Grid.Row="0" />
</Grid>
</DataTemplate>
</Grid.Resources>
<telerik:RadCarousel x:Name="XTraCarousel" AutoGenerateDataPresenters="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>

Milan
Telerik team
 answered on 10 Feb 2009
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?