Telerik Forums
UI for WPF Forum
5 answers
69 views
Hi,

When using a chain in the DataMemberBinding, like:
DataMemberBinding="{Binding Path=AAA.BBB.CCC}" 

The particular column becomes no longer groupable or sortable.

Please help to resolve this issue.

Thanks,
Ruben.

USING WPF RadGridView (v. 2009.1.312.35).
Hristo
Telerik team
 answered on 04 Sep 2009
5 answers
147 views
I'm trying to update my project to use the latest release (2009.2 813), but when I sort on any column, I get this exception:

{"Invalid property or field - 'colDescription' for type: Object"}

   at Telerik.Windows.Data.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance)
   at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName)
   at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName, Boolean liftMemberAccessToNull)
   at Telerik.Windows.Data.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpression()
   at Telerik.Windows.Data.Expressions.MemberAccessExpressionBuilderBase.CreateLambdaExpression()
   at Telerik.Windows.Data.SortDescriptorCollectionExpressionBuilder.Sort()
   at Telerik.Windows.Data.SortDescriptorCollection.Sort(IQueryable queryable)
   at Telerik.Windows.Data.QueryableExtensions.Sort(IQueryable source, SortDescriptorCollection sortDescriptors)
   at Telerik.Windows.Data.QueryableCollectionView.CreateView()
   at Telerik.Windows.Data.QueryableCollectionView.get_QueryableView()
   at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
   at Telerik.Windows.Data.QueryableCollectionView.GetEnumerator()
   at Telerik.Windows.Data.RecordFactory.<CreateRecordsForGroupRecord>d__0.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PopulateRecords()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.LoadData()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.RefreshAndRaiseCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.Refresh()
   at Telerik.Windows.Data.QueryableCollectionView.EndDefer()
   at Telerik.Windows.Data.QueryableCollectionView.DeferHelper.Dispose()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.SyncSortDescriptors(IEnumerable`1 removedDescriptors, IEnumerable`1 addedDescriptors)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformSorting(String propertyName, Boolean addSortDescription)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass2d.<Sort>b__2c()
   at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.Sort(GridViewDataColumn column, Boolean appendToExisting)
   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.RequestSort(Boolean appendToExisting)
   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   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 args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(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 WpfApplicationTemplate.App.Main() in C:\Temp\User_InteractionDesktopApplication\obj\Debug\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()
Hristo
Telerik team
 answered on 04 Sep 2009
1 answer
170 views

I want to do the following which I can do with most of the itemcollections in the ms toolbox.

I want to be able to bind a custom property on an object to the SelectedProperty of a row in a gridview. The result would be that you could select multiple rows in a gridview and then each of the objects in the list that the Grid was bound to would have their IsSelectedProperty set to true.

Example of TreeView:
So each TreeViewItem IsSelected property is bound to the bound objects IsSelectedProperty.

 

<

 

Style x:Key="{x:Type TreeViewItem}" TargetType="{x:Type TreeViewItem}">

 

 

 

    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
    ....
    ....
</Style>

Is this possible with the GridView?

Thanks,

 

Milan
Telerik team
 answered on 04 Sep 2009
3 answers
103 views
After installation, under RadControls for WPF Q2 2009 SP1 in the Toolbox the same set of controls is shown multiple times.

Missing User
 answered on 04 Sep 2009
9 answers
366 views
I am trying to change the background colour of certain cells based on the value of the data.

Here are the converter and style resources i use. This is all based on the example given in the documentation and on some other forum posts.
    <UserControl.Resources> 
        <cur:AssumedLevelToColour x:Key="convAssumedLevel"/> 
        <Style x:Key="assumedLevelStyle" TargetType="{x:Type telerik:GridViewCell}"
            <Setter Property="Background"
                <Setter.Value> 
                    <SolidColorBrush Color="{Binding Path=AssumedLevel, Converter={StaticResource convAssumedLevel}}" /> 
                </Setter.Value> 
            </Setter> 
        </Style> 
    </UserControl.Resources> 
AssumedLevelToColour is a simple float to colour converter that returns red, orange or green depending on the level.

And here is the grid view code including the relevant column.
       <telerik:RadGridView Margin="6,6,6,6" MaxHeight="1000" Name="lstDefenders" Grid.ColumnSpan="3" SelectionChanged="lstDefenders_SelectionChanged"  telerik:StyleManager.Theme="Vista" IsReadOnly="True" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" ColumnsWidthMode="Auto" MultipleSelect="True" > 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn HeaderText="Manufacturer" DataMemberBinding="{Binding Manufacturer, Mode=OneWay}" /> 
                <telerik:GridViewDataColumn HeaderText="Product" DataMemberBinding="{Binding Name, Mode=OneWay}" /> 
                <telerik:GridViewDataColumn CellStyle="{StaticResource assumedLevelStyle}" HeaderText="Assumed Level" DataMemberBinding="{Binding AssumedLevel, Mode=OneWay}" /> 
                <telerik:GridViewDataColumn HeaderText="Type" DataMemberBinding="{Binding Type, Mode=OneWay}" /> 
                <telerik:GridViewDataColumn HeaderText="Approval" DataMemberBinding="{Binding Approval, Mode=OneWay}" /> 
                <telerik:GridViewDataColumn HeaderText="Notes" DataMemberBinding="{Binding Notes, Mode=OneWay}" /> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
The list is populated using the ItemsSource property.

The converter is being called correctly but the background colour doesnt change.
I have only noticed this in Q2 SP1, was working in Q1, not sure about Q2.

Thanks,
Martin
Kalin Milanov
Telerik team
 answered on 04 Sep 2009
5 answers
305 views
hi

is there any easy to implement a mouse over hint on a combo box that will display what the full text of the combo box is. The actual dropdown hint can be much wider than the combo box to deal with extra long strings and need to be able to show on mouse over what is in the combo box.

any ideas or pointers gratefully accepted. Don't want to have implement a bespoke javascript/dhtml solution if I can help it
Valeri Hristov
Telerik team
 answered on 03 Sep 2009
1 answer
136 views

Hello,
I am developing a WPF application that uses Microsoft.SqlServerCe.Client.3.5. and LINQ

I use a grid view to show data and its XAML code looks like the following


<telerik:RadGridView x:Name="unsavedFormsGridView"

 Height="300"

 AutoGenerateColumns="False"

 ShowGroupPanel="False"

 MultipleSelect="False"

 ColumnsWidthMode="Fill">

<telerik:RadGridView.Columns>

<telerik:GridViewDataColumn Header="Targa"

HeaderTextAlignment="Center"

Width="70"

IsReadOnly="True"
IsFilterable="False"

IsSortable="False"

DataMemberBinding="{Binding LandfillVehiclePlate}"/>

<telerik:GridViewDataColumn Header="N° formulario"
HeaderTextAlignment="Center"

Width="110"

IsReadOnly="True"

IsFilterable="False"

IsSortable="False"

DataMemberBinding="{Binding PrintedFormCode}"/>

<telerik:GridViewDataColumn x:Name="columnSave"
IsFilterable
="False"

IsSortable="False">

<telerik:GridViewColumn.CellTemplate>

<DataTemplate>

<Button x:Name="buttonSave" Click="buttonSave_Click">

<Image Source="/Images/CheckMark.png" Height="20" Width="20" />

<Button.ToolTip>

<StackPanel Orientation="Horizontal">

<Image Source="/Images/CheckMark.png" Height="20" Width="20" />

<Label Content="Salva in modo definitivo il formulario"/>

</StackPanel>

</Button.ToolTip>

</Button>

</DataTemplate>

</telerik:GridViewColumn.CellTemplate>

</telerik:GridViewDataColumn>

<telerik:GridViewDataColumn x:Name="columnDelete" IsFilterable="False" IsSortable="False" >

<telerik:GridViewColumn.CellTemplate>

<DataTemplate>

<Button x:Name="buttonCancel" Click="buttonCancel_Click">

<Image Source="/Images/Cancel.png" Height="20" Width="20" />

<Button.ToolTip>

<StackPanel Orientation="Horizontal">

<Image Source="/Images/Cancel.png" Height="20" Width="20" />

<Label Content="Elimina in modo definitivo il formulario"/>

</StackPanel>

</Button.ToolTip>

</Button>

</DataTemplate>

</telerik:GridViewColumn.CellTemplate>

</telerik:GridViewDataColumn>

</telerik:RadGridView.Columns>

</telerik:RadGridView>

 

To bind data to the GridView I use an observable collection of a  LINQ  table get from the data context created on my SDF file.


ObservableCollection<MyTable> tempOperations = new ObservableCollection<MyTable>();


To initialize the GridView at program start I use this code


unsavedFormsGridView.ItemsSource = null;

tempOperations.Clear();

var temporaryOperations = from lto in dc.MyTable select lto;

foreach (MyTable item in temporaryOperations)

{

    tempOperations.Add(item);

}

unsavedFormsGridView.ItemsSource = tempOperations;

 

Everything works fine and I can appreciate all data from the file into the GridView.

Very strange is the thing that happens lately, during a save process in which I write a new record that user input.
This process is started by a Button, different from those included in the gridview.

I create a new record and add it into the observable collection tempOperations in a code like this


private void buttonSaveTemporarly_Click(object sender, RoutedEventArgs e)

{

 

  //Create the new record into currentOperation

  BuildCurrentOperation();

 

  dc.LandfillTempOperations.InsertOnSubmit(currentOperation);

  dc.SubmitChanges();

 

  unsavedFormsGridView.ItemsSource = null;

  tempOperations.Add(currentOperation);

  unsavedFormsGridView.ItemsSource = tempOperations;

 

  //Set all the input controls to blank for the next new record

  TempInitForm();

}

 

When the function terminates his job, the application does not respond to any input and more or less after 60 seconds appears the message


ContextSwitchDeadlock was detected
The CLR has been unable to transition from COM context 0x1fe3b0 to COM context 0x1fe520 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations


I must say that trying to understand more about this I have executed the application step by step.
At the end of the function VisualStudio 2008 asks to show a disassembly and in the address combobox of the disassembly window appears the following address

Telerik.Windows.Controls.GridView.BaseVirtualizingPanel.MeasureOverride(System.Windows.Size).

At this point my suspect is that there is something illegal I do in using GridView.

May anyone help me?

Thank you in advance

Nick


Rossen Hristov
Telerik team
 answered on 03 Sep 2009
12 answers
86 views
Hi Folks,

When I assigned values to AxisX.Title and AxisY.Title, these values do not get displayed when I run the program.   Here is a sample of my XAML code, GDF and OPTIME does not get displayed:

<

 

telerik:RadChart Width="299" Height="299" ItemsSource="{Binding Path=ConditionIndicatorDataPoints}">

 

 

 

 

    <telerik:RadChart.DefaultView>

 

 

 

 

            <telerik:ChartDefaultView>

 

 

 

 

                    <telerik:ChartDefaultView.ChartTitle>

 

 

 

 

                            <telerik:ChartTitle Content="{Binding Path=ChartName}" />

 

 

 

 

                    </telerik:ChartDefaultView.ChartTitle>

 

 

 

 

                    <telerik:ChartDefaultView.ChartLegend>

 

 

 

 

                            <telerik:ChartLegend Header="GDF"/>

 

 

 

 

                    </telerik:ChartDefaultView.ChartLegend>

 

 

 

 

                    <telerik:ChartDefaultView.ChartArea>

 

 

 

 

                            <telerik:ChartArea PlotAreaStyle="{StaticResource customStyle}">

 

 

 

 

                                    <telerik:ChartArea.AxisY>

 

 

 

 

                                            <telerik:AxisY Title="GDF" Visibility="Visible" AxisStyles="{DynamicResource customAxisTitleStyle}" />

 

 

 

 

                                    </telerik:ChartArea.AxisY>

 

 

 

 

                                    <telerik:ChartArea.AxisX>

 

 

 

 

                                            <telerik:AxisX Title="OPTIME"  Visibility="Visible" AxisStyles="{DynamicResource customAxisTitleStyle}" />

 

 

 

 

                                    </telerik:ChartArea.AxisX>

 

 

 

 

                          </telerik:ChartArea>

 

 

 

 

                    </telerik:ChartDefaultView.ChartArea>

 

 

 

 

            </telerik:ChartDefaultView>

 

 

 

 

       </telerik:RadChart.DefaultView>

 

 

 

 

        <telerik:RadChart.SeriesMappings>

 

 

 

 

                <telerik:SeriesMapping>

 

 

 

 

                        <telerik:SeriesMapping.SeriesDefinition>

 

 

 

 

                                <telerik:LineSeriesDefinition />

 

 

 

 

                         </telerik:SeriesMapping.SeriesDefinition>

 

 

 

 

                         <telerik:SeriesMapping.ItemMappings>

 

 

 

 

                                 <telerik:ItemMapping DataPointMember="YValue" FieldName="YPlotPoint" />

 

 

 

 

                         </telerik:SeriesMapping.ItemMappings>

 

 

 

 

               </telerik:SeriesMapping>

 

 

 

 

        </telerik:RadChart.SeriesMappings>

 

 

 

 

</telerik:RadChart>

 

 



 
Ves
Telerik team
 answered on 03 Sep 2009
1 answer
156 views
Hi everyone,

I know that is possible to have a pivot table with Telerick ASP.NET Gridview but is this option available with WPF gridview?

I tried to look into the documentation but don't find anything regarding binding to pivot (except in ASP.NET documentation).

thank you

regis
Vlad
Telerik team
 answered on 03 Sep 2009
0 answers
94 views
1.How to config application file in xaml ????????????
2.I need connection Strings in xaml??

anyone can help me !!!!


regards ,
Vignesh
kottu
Top achievements
Rank 1
 asked on 03 Sep 2009
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?