This is a migrated thread and some comments may be shown as answers.

On Mouse double click on GridViewDataColumn in RadGridView throws exception

5 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nikhil
Top achievements
Rank 1
Nikhil asked on 10 May 2011, 01:34 PM
Hi,
I am using RADGRIDVIEW to display a data. i havent register any event handler for gridview but still on double click of any row( or GridViewDataColumn) it throws an silverlight error
"Unhandled error in silverlight application code:4004
Category: ManagedRunTimeError
message: invalidecast exception: unable to cast object of type telerik.windows.controls.gridviewdatacolumn"

I also tried to set the IsReadOnly propety to true but stil it is not working.
Colud you please help me


Thanks,
Nikhil Kolte

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 10 May 2011, 01:36 PM
Hello Nikhil,

 

May you please share with us the source code you are currently using? 


Best wishes,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nikhil
Top achievements
Rank 1
answered on 10 May 2011, 01:40 PM

Hi,
Following is the xaml code


 

<telerik:RadGridView   IsReadOnly="True" VerticalAlignment="Top" Height="262"  x:Name="GenericGridView" ItemsSource="{Binding PagedSource, ElementName=ItemsPager, Mode=TwoWay}" Margin="6,0,0,10" AutoGenerateColumns="False">
                                        <telerik:RadGridView.Columns>
                                          
                                            <telerik:GridViewDataColumn  IsReadOnly="True"   Width="239" Header="Title" DataMemberBinding="{Binding Name}" ToolTipService.ToolTip="{Binding Name}">
                                                <telerik:GridViewDataColumn.ToolTipTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding Name}"/>
                                                    </DataTemplate>
                                                </telerik:GridViewDataColumn.ToolTipTemplate>
                                            </telerik:GridViewDataColumn>
                                            <telerik:GridViewDataColumn IsReadOnly="True"  DataFormatString="dd-MM-yyyy"  Width="70" Header="Joining Date" DataMemberBinding="{Binding JoinDate}" >
                                            </telerik:GridViewDataColumn>

                                        </telerik:RadGridView.Columns>
                                    </telerik:RadGridView>
                                    <telerik:RadDataPager x:Name="ItemsPager" PageSize="8" DisplayMode="FirstLastPreviousNextNumeric" IsTotalItemCountFixed="False" VerticalAlignment="Top" Margin="2,268,-6,0" Background="Transparent" BorderThickness="0" Canvas.ZIndex="100" Source="{Binding EmployeeDetails,Mode=TwoWay}" />

0
Vanya Pavlova
Telerik team
answered on 10 May 2011, 01:51 PM
Hello Nikhil,

 

Thank you for sharing this snippet with us! I tried to replicate such a behavior, but I was not able to get such an exception using this snippet. May you please check the attached project and let me know how it differs from yours? Any additional information about the grid version you used would be highly appreciated as well.
Also you may send to us a runnable project in a new support ticket where we can see what is going on.



Best wishes,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nikhil
Top achievements
Rank 1
answered on 10 May 2011, 02:16 PM
Hi,

The issue was,In GridViewDataColumn i am setting tool tip for that grid column as shown below 
<telerik:GridViewDataColumn  IsReadOnly="True"   Width="239" Header="Title" DataMemberBinding="{Binding Name}" ToolTipService.ToolTip="{Binding Name}">

but when i removed this is started working. dont know how it works at your code snipet.
i am pasting exact exception thrown by it just for your reference :)

Microsoft JScript runtime error: Unhandled Error in Silverlight Application Unable to cast object of type 'Telerik.Windows.Controls.GridViewDataColumn' to type 'System.Windows.UIElement'.   at System.Windows.Controls.ToolTipService.OnToolTipPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
   at System.Windows.Data.BindingExpression.SendDataToTarget()
   at System.Windows.Data.BindingExpression.SourceAcquired()
   at System.Windows.Data.BindingExpression.InheritanceContextChanged(Object sender, EventArgs e)
   at System.Windows.DependencyObject.OnInheritanceContextChanged(Object sender, EventArgs e)
   at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCurrentCellInfoChanged(GridViewCellInfo currentCell)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.set_CurrentCellInfo(GridViewCellInfo value)
   at Telerik.Windows.Controls.GridView.GridViewCell.UpdateOnIsCurrentChanged(Boolean newValue)
   at Telerik.Windows.Controls.GridView.GridViewCell.IsCurrentChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
   at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCellMouseDown(GridViewCell cell, MouseButtonEventArgs args)
   at Telerik.Windows.Controls.GridView.GridViewCell.OnMouseLeftButtonDown(MouseButtonEventArgs e)
   at System.Windows.Controls.Control.OnMouseLeftButtonDown(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)


and the GridView version is : 2010.3.1314.1040


Thank you for your quick response. i really appreciate your customer orientation
Thanks
0
Vanya Pavlova
Telerik team
answered on 10 May 2011, 02:40 PM
Hi Nikhil,

 

This could be an issue related to the grid version you used. May you please try our latest official binaries and let me know whether the issue still persists? If so, I believe that the best option would be to open a separate support ticket where you can attach sample application. This would help us better understand what the problem is and help us better assist to you in fixing it.


Kind regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Nikhil
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Nikhil
Top achievements
Rank 1
Share this question
or