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

[Solved] Hitting INSERT key twice in succession gives error in “RadGridView”

12 Answers 198 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Manas
Top achievements
Rank 1
Manas asked on 18 Jun 2009, 09:02 AM

Hi,

 Right now I am using Development version (RadControls_for_Silverlight_2009_1_612) of telerik RadControls for silverlight and working on RadGridView. I have noticed Inserting new row has a problem as given below

 

1.       Hitting the <Insert> key first time, Grid provides a New Row at the top of the grid.

2.       Again hitting the <insert> key, the new row gets deleted from the Grid.

3.       If I press the <insert> key again the systems pops up an error. I believe that it is easlily reproducible.

 

it is happening in the Telerik Example Application (Grid -> Columns -> Column setting) and also in my application.

 

If anyone has any solution regarding that, please guide.

It would be very helpful for me.

 

Regards,

Manas

12 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 23 Jun 2009, 06:21 AM
Hi Manas,

I've managed to reproduce the issue, so I've updated your Telerik points accordingly.
This bug is already fixed and will be available with the next official release.

Best wishes,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Michelle Bruce
Top achievements
Rank 1
answered on 31 Jul 2009, 02:44 PM
Hi,

Do you have this fix included in RadControls_for_Silverlight_2009_2_701_DEV version?

Thanks
Pankaj
0
Missing User
answered on 31 Jul 2009, 03:11 PM
Hello Michelle Bruce,

Yes , this fix is included in our 2009 Q2 release.

Sincerely yours,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Manas
Top achievements
Rank 1
answered on 22 Sep 2009, 07:59 AM

Hi,

I have found some serious problem when upgrading to Telerik RadControls_for_Silverlight_2009_2_701_DEV release from RadControls_for_Silverlight_2009_1_612 version. Some Classes or properties (we have used in our code) are obsolete in current release.

Here under I have listed some items.

 

1.            “Telerik.Windows.Data.DataRecord” class is obsolete in upgraded version.

2.            “this.gridview.SeletedRecord” is obsolete property. They recommend using SeletedItem.

3.            This.gridLesson.SortDescriptions is obsolete.

4.            Etc.

 

If we would upgrade then have to change into code as per latest release of telerik in so many places.

 

If anyone has any solution regarding that, please guide.

It would be very helpful for me.


Regards,
Manas

0
Milan
Telerik team
answered on 22 Sep 2009, 10:55 AM
Hi Manas,

Well, we could help you with the transition process. Here is how you can solve some of the problems that you have reported: Instead of SortDescriptions you should use SortDescriptors and instead of SelectedRecord, SelectedRecords, and CurrentRecords you should use SelectedItem, SelectedItems, and CurrentItem.

We have also added RadGridView.Items property that you can use to access all data items (similar to RadGridView.Records).

If you have any specific questions about the upgrade process you are more than welcome to post them here.

All the best,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michelle Bruce
Top achievements
Rank 1
answered on 22 Sep 2009, 11:18 AM
Milan,

Thanks for your suggestion. But it still means that we need to change our application code just to make it compatible with next version of Telerik RadGridView control. I don't think that is an acceptable solution and not a standard practice followed by product/component providers. Neither application developers (like us) be forced to make changes in their application source code nor we can afford such a change (where the application needs complete regression testing) while upgrading to next version of the control(s). You are absolutely welcome to introduce additional capabilities or improve on existing features but you cannot change your application interface from version to version and must provide backward compatibility.

Please let me know your thoughts as this is crucial for our upgrade.

Thanks
-Pankaj
0
Milan
Telerik team
answered on 23 Sep 2009, 10:59 AM

Hello Michelle Bruce,

You are absolutely correct but we do try to keep the breaking changes to a minimun in every release. Although we have marked many properties and methods as obsolete  most of those properties and method still work and can be used. For example, you can still use SortDescriptions instead of SortDescriptors.

You might be able to upgrade without doing any modifications to your existing code despite the fact that we have marked many items as obsolete. May I ask you to build your project with our latest assemblies and check if your tests pass? If the results are not satisfactory we will provide further assistance.

Thanks for your patience and valuable feedback.

Kind regards,

Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Manas
Top achievements
Rank 1
answered on 24 Sep 2009, 12:45 PM

Hi Milan,

 

Thanks for your support, so I can go with my obsolete one or update as you said. Now I am facing a different problem after changed new release of silver light 2 (RadControls_for_Silverlight_2009_2_701_DEV) RAD dlls on my existing running code.  

 

I have hierarchical RadGrid, when Expand Grid Expandable Row by click on + sign then getting error as bellow.

An unhandled exception (‘Sys.InvailOperationException: ManageRuntimeError error #4004 in control ‘Xaml1’” System.TypeLoadException: Could not load type ‘System.Linq.OrderedEnumerable ‘2’ from assembly ‘system.core, Version=2.0.5.0, Culture=neutral, PublicKey Token=7cec85d7bea7798e’.


For hierarchical grid I have used in Xaml code.

 

<grid:RadGridView x:Name="gridLesson" ScrollMode="RealTime" AutoGenerateColumns="False"   
                          IsFilteringAllowed="False" ShowColumnHeaders="False" ShowGroupPanel="False"   
                          ItemsSource="{Binding Unit,Mode=TwoWay}"   
                          IsReadOnly="True" Width="875">  
                <grid:RadGridView.Columns> 
                    <!--<grid:GridViewDataColumn HeaderText="UnitId" UniqueName="UnitId"  />--> 
                    <!--DataMemberBinding="{Binding UnitId}"--> 
                    <grid:GridViewDataColumn HeaderText="UnitName #"  DataMemberBinding="{Binding Unit, Mode=TwoWay}" Width="410" Background="#1F497D" > 
                        <grid:GridViewDataColumn.CellStyle> 
                            <Style TargetType="telerikGridView:GridViewCell">  
                                <Setter Property="Template">  
                                    <Setter.Value> 
                                        <ControlTemplate TargetType="telerikGridView:GridViewCell">  
                                            <Border Height="70" VerticalAlignment="Top" Background="#1F497D" > 
                                                <Grid> 
                                                    <Grid.ColumnDefinitions> 
                                                        <ColumnDefinition Width="Auto" /> 
                                                        <ColumnDefinition Width="Auto" /> 
                                                        <ColumnDefinition Width="Auto" /> 
                                                    </Grid.ColumnDefinitions> 
                                                    <TextBlock Text="{Binding UnitOrder}" Foreground="White" FontSize="16" Grid.Column="0" Padding="2" Visibility="Collapsed" /> 
                                                    <TextBlock Text="{Binding UnitName}" Foreground="White" FontSize="16" Grid.Column="1" Padding="2" Width="250" TextWrapping="Wrap" /> 
                                                    <TextBlock Text="{Binding LessonCountShow}" Foreground="White" FontSize="10" Grid.Column="2" TextAlignment="Center" Padding="10" /> 
                                                <Button x:Name="btn" /> 
                                            </Grid> 
                                            </Border> 
                                        </ControlTemplate> 
                                    </Setter.Value> 
                                </Setter> 
                            </Style> 
                        </grid:GridViewDataColumn.CellStyle> 
                    </grid:GridViewDataColumn> 
                    <grid:GridViewDataColumn HeaderText="Files" Width="350" DataMemberPath="UnitFiles">  
                        <grid:GridViewDataColumn.CellStyle> 
                            <Style TargetType="telerikGridView:GridViewCell">  
                                <!--<Setter Property="dragDrop:RadDragAndDropManager.AllowDrop" Value="True"/>--> 
                                <Setter Property="Template">  
                                    <Setter.Value> 
                                        <ControlTemplate TargetType="telerikGridView:GridViewCell">  
                                            <StackPanel> 
                                                <Border Height="15" VerticalAlignment="Top" Background="#1F497D" > 
                                                    <TextBlock Text="Files for the whole Unit" Foreground="White" /> 
                                                </Border> 
                                                <ListBox ItemsSource="{Binding UnitFiles}" Height="55" Background="White">  
                                                    <ListBox.ItemTemplate> 
                                                        <DataTemplate> 
                                                            <core:RadDockPanel HorizontalAlignment="Stretch">  
                                                                <Image Source="{Binding IconPath}" Width="10" Height="10" /> 
                                                                <HyperlinkButton Content="{Binding docname}" TargetName="_blank"   
                                                                NavigateUri="{Binding docurl}" /> 
                                                            </core:RadDockPanel> 
                                                        </DataTemplate> 
                                                    </ListBox.ItemTemplate> 
                                                </ListBox> 
 
                                            </StackPanel> 
                                        </ControlTemplate> 
                                    </Setter.Value> 
                                </Setter> 
                            </Style> 
                        </grid:GridViewDataColumn.CellStyle> 
                    </grid:GridViewDataColumn> 
                </grid:RadGridView.Columns> 
                <grid:RadGridView.HierarchyChildTemplate> 
                    <DataTemplate> 
                        <StackPanel DataContext="{x:Null}">  
                            <!--RowStyle="{StaticResource CustomRowStyle}"--> 
                            <grid:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding Lessions,Mode=TwoWay}" 
                                          IsFilteringAllowed="False" ShowGroupPanel="False"   
                                          MultipleSelect="True" Loaded="RadGridView_Loaded" IsReadOnly="True" Width="795"   
                                              CanUserResizeColumns="False" CanUserReorderColumns="False">  
                                <grid:RadGridView.Columns> 
                                    <grid:GridViewDataColumn HeaderText="LessonOrder" UniqueName="LessonOrder" IsVisible="False" /> 
                                    <grid:GridViewDataColumn HeaderText="Date" UniqueName="LessonDate" DataFormatString="{}{0:ddd MM-dd}"  /> 
                                    <grid:GridViewDataColumn HeaderText="Lesson #" UniqueName="Lesson" /> 
                                    <grid:GridViewDataColumn HeaderText="Aims" Width="150" UniqueName="AIM" TextWrapping="Wrap" > 
                                        <!--<grid:GridViewDataColumn.CellStyle> 
                                        <Style TargetType="telerikGridView:GridViewCell">  
                                            <Setter Property="Template">  
                                                <Setter.Value> 
                                                    <ControlTemplate TargetType="telerikGridView:GridViewCell">  
                                                        <StackPanel> 
                                                            <TextBox Text="{Binding AIM}" TextWrapping="Wrap" Height="80" /> 
                                                        </StackPanel> 
                                                    </ControlTemplate> 
                                                </Setter.Value> 
                                            </Setter> 
                                        </Style> 
                                    </grid:GridViewDataColumn.CellStyle>--> 
                                    </grid:GridViewDataColumn> 
                                    <grid:GridViewDataColumn HeaderText="More Info" UniqueName="AdditionalInformation" Width="175" TextWrapping="Wrap" /> 
                                    <grid:GridViewDataColumn HeaderText="Files" DataMemberPath="Files" Width="240">  
                                        <grid:GridViewDataColumn.CellStyle> 
                                            <Style TargetType="telerikGridView:GridViewCell">  
                                                <Setter Property="Template">  
                                                    <Setter.Value> 
                                                        <ControlTemplate TargetType="telerikGridView:GridViewCell">  
                                                            <StackPanel> 
                                                                <ListBox ItemsSource="{Binding Files}" dragDrop:RadDragAndDropManager.AllowDrop="True" Height="80">  
                                                                    <ListBox.ItemTemplate> 
                                                                        <DataTemplate> 
                                                                            <core:RadDockPanel HorizontalAlignment="Stretch">  
                                                                                <Image Source="{Binding IconPath}" Width="10" Height="10" /> 
                                                                                <HyperlinkButton Content="{Binding docname}" TargetName="_blank"   
                                                                               NavigateUri="{Binding docurl}" /> 
                                                                            </core:RadDockPanel> 
                                                                        </DataTemplate> 
                                                                    </ListBox.ItemTemplate> 
                                                                </ListBox> 
                                                            </StackPanel> 
                                                        </ControlTemplate> 
                                                    </Setter.Value> 
                                                </Setter> 
                                            </Style> 
                                        </grid:GridViewDataColumn.CellStyle> 
                                    </grid:GridViewDataColumn> 
                                </grid:RadGridView.Columns> 
                            </grid:RadGridView> 
                        </StackPanel> 
                    </DataTemplate> 
                </grid:RadGridView.HierarchyChildTemplate> 
            </grid:RadGridView> 
 

And attached “Table Definition PreviewDataReceordCretae event handler” in code behind (Xaml.cs) Page Load.

this.gridLesson.TableDefinition.PreviewDataRecordCreate += new EventHandler < Telerik.Windows.Data.DataRecordCreateEventArgs >(MasterTableDefinition_PreviewDataRowCreate); 
private void MasterTableDefinition_PreviewDataRowCreate(object sender, DataRecordCreateEventArgs e)  
        {  
            Unit u = (Unit)e.Data;  
            e.IsExpandableRecord = true;  
            GridViewTableDefinition detailDefinition = new GridViewTableDefinition();  
            detailDefinition.DataSource = ((Unit)e.Data).Lessions.OrderBy(x => x.LessonOrder);  
            e.ChildTableDefinitions.Add(detailDefinition);  
        } 

Child grid have Page Load event

private void RadGridView_Loaded(object sender, RoutedEventArgs e)  
        {  
            Unit currentUnit = ((RadGridView)sender).ParentRow.DataContext as Unit;  
            ObservableCollection<Lesssion> vLessons = new ObservableCollection<Lesssion>();  
            var modLessons = currentUnit.Lessions.OrderBy(x => x.LessonOrder);  
            foreach (Lesssion l in modLessons)  
            {  
                vLessons.Add(l);  
            }  
            currentUnit.Lessions = vLessons;  
            ((RadGridView)sender).DataContext = currentUnit;  
 
            //Carriage Return into Grid Cell  
            GridViewDataColumn column_aim = ((RadGridView)sender).Columns["AIM"] as GridViewDataColumn;  
            GridViewDataColumn column_addinf = ((RadGridView)sender).Columns["AdditionalInformation"] as GridViewDataColumn;  
            var settings = new TextBoxEditorSettings();  
            settings.DataType = typeof(string);  
            settings.CellEditStyle = (Style)this.Resources["styleMultiLineText"];  
 
            column_aim.EditorSettings = settings;  
            column_addinf.EditorSettings = settings;  
        } 

 

If you have any solution regarding that, please let me know.

 

 

Regards,

Manas

 

 

 

 

0
Vlad
Telerik team
answered on 25 Sep 2009, 06:15 AM
Hi Manas,

We believe that this error was fixed previously - please try our latest service pack (2009_2_0812)!

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michelle Bruce
Top achievements
Rank 1
answered on 01 Oct 2009, 10:17 AM

Hi,

 

I have tried your latest Service pack (RadControls_for_Silverlight2_2009_2_812_DEV_hotfix) but till getting same error in expand hierarchical grid as described above.

 

It is working fine with RadControls_for_Silverlight_2009_1_612 version.
Right now it is very critical for us.
Please do needful.

 

 

Thanks,

 

Regards,

Manas

0
Vlad
Telerik team
answered on 01 Oct 2009, 03:14 PM
Hi Manas,

Please open a formal support ticket and send us small example where we can debug and reproduce this exception. If there is a problem with the grid you will receive fix immediately!

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Michelle Bruce
Top achievements
Rank 1
answered on 05 Oct 2009, 08:09 AM

Hi Vlad,
As discussion, I have opened a formal support ticket and upload a small example project (ticket id is: 247929). I hope now you can reproduce this exception.

I shall be awaiting for your response.

Thanks.

 

Regards,

Manas

Tags
GridView
Asked by
Manas
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Michelle Bruce
Top achievements
Rank 1
Missing User
Manas
Top achievements
Rank 1
Milan
Telerik team
Vlad
Telerik team
Share this question
or