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

Problem with CellEditTemplate

10 Answers 188 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rudis
Top achievements
Rank 1
Rudis asked on 20 Apr 2010, 09:29 AM
Hello!

Since I updated to 2010 Q1 my CellEditTemplate stopped working. I get an System.InvalidCastException when leaving the textbox.

 <telerikGrid:RadGridView  x:Name="ARVolymGridView" AutoGenerateColumns="False" ShowGroupPanel="False" ItemsSource="{Binding ARVolymer, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" > 
            <telerikGrid:RadGridView.Columns> 
                <telerikGrid:GridViewDataColumn DataMemberBinding="{Binding Sortiment, UpdateSourceTrigger=PropertyChanged}" Header="Sortiment"/> 
                <telerikGrid:GridViewDataColumn DataMemberBinding="{Binding Volym, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="M3f" > 
                    <telerikGrid:GridViewDataColumn.CellEditTemplate> 
                        <DataTemplate> 
                            <TextBox Text="{Binding Volym, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/> 
                        </DataTemplate> 
                    </telerikGrid:GridViewDataColumn.CellEditTemplate> 
                </telerikGrid:GridViewDataColumn> 
            </telerikGrid:RadGridView.Columns> 
        </telerikGrid:RadGridView> 

My binding properties:

 
        public string Sortiment 
        { 
            get { return _arVolym.Sortiment; } 
            set 
            { 
                if (_arVolym.Sortiment != value) 
                { 
                    _arVolym.Sortiment = value
                    OnPropertyChanged("Sortiment"); 
                } 
            } 
        } 
 
 
        public int Volym 
        { 
            get { return _arVolym.Volym; } 
            set 
            { 
                if (_arVolym.Volym != value) 
                { 
                    _arVolym.Volym = value
                    OnPropertyChanged("Volym"); 
                } 
            } 
        } 

In my application I have an custom designed TextBox to prevent the user to enter invalid values, but the same exception appears for a regular Textbox.

This is extremly annoying that something stopped working when updating to a new and improved (?!) version.

//Anna


10 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Apr 2010, 09:35 AM
Hi,

Can you post the exception stack trace? I cannot reproduce such problems on our demo.

All the best,
Vlad
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
Rudis
Top achievements
Rank 1
answered on 20 Apr 2010, 09:42 AM
The exception occures in xaml-code only and is shown in the output window. I have a TextBox connected to an int value. Could that be the problem?

/Anna
0
Vlad
Telerik team
answered on 20 Apr 2010, 09:48 AM
Hello,

You can check your scenario with normal TextBox instead your own custom TextBox to see what will be the result.

Sincerely yours,
Vlad
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
Rudis
Top achievements
Rank 1
answered on 20 Apr 2010, 09:52 AM
But I already did that. I´ve tested it with the exact code I sent previously. Should I will set up a small testapp and send to you?

/Anna
0
Vlad
Telerik team
answered on 20 Apr 2010, 09:54 AM
Hello,

Can you post the exception which is shown in the output window?

Best wishes,
Vlad
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
Rudis
Top achievements
Rank 1
answered on 20 Apr 2010, 09:56 AM
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
0
Vlad
Telerik team
answered on 20 Apr 2010, 09:59 AM
Hello,

Please send us small example project (via support ticket) where we can reproduce and debug this.

Sincerely yours,
Vlad
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
Rudis
Top achievements
Rank 1
answered on 20 Apr 2010, 10:29 AM
I did so.

/Anna
0
Chris
Top achievements
Rank 1
answered on 18 Jun 2013, 03:24 PM
I am having a very similar problem, was this issue ever resolved?
0
Maya
Telerik team
answered on 21 Jun 2013, 08:53 AM
Hi Chris,

Could provide a bit more information on your scenario and the result you get ? 

Regards,
Maya
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Rudis
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Rudis
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Maya
Telerik team
Share this question
or