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

Unable to enter data when GridViewDataColumn is in edit mode

3 Answers 137 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Hasanain
Top achievements
Rank 1
Hasanain asked on 02 Aug 2012, 09:45 PM
Hello,

I have set up an editable column, with separate templates for view and edit defined.

<telerik:GridViewDataColumn Name="TargetPercentOfAccountMarketValue" Header="% Of Total"  
 Width="75" HeaderCellStyle="{StaticResource columnHeaderStyle}"                                            
CellStyle="{StaticResource whatIfCell}"
                                            
DisplayIndex="8" EditTriggers="CellClick,TextInput"
                                            
IsReadOnlyBinding="{Binding NodeType, Converter={StaticResource nodeTypeToIsReadOnlyConverter}}"
                                            
ColumnGroupName="WhatIfAllocation">
                    
<
telerik:GridViewDataColumn.CellTemplate>                        
<
DataTemplate>                            
<
TextBlock Text="{Binding Node.TargetPercentOfAccountMarketValue, StringFormat={}{0:P1}}"                                       
Foreground="{Binding Node.TargetPercentOfAccountMarketValue, Converter={StaticResource negativeColorFormatter}, UpdateSourceTrigger=PropertyChanged}">
                            
</
TextBlock>                       
</
DataTemplate>                    
</
telerik:GridViewDataColumn.CellTemplate>                    
<
telerik:GridViewDataColumn.CellEditTemplate>                        
<
DataTemplate>                            
<
TextBox BorderBrush="Transparent" BorderThickness="1"
Text="{Binding Node.TargetPercentOfAccountMarketValue, Converter={StaticResource StringToPercentageConverter}, StringFormat={}{0:N2}}"  Background="Transparent"                                     
Foreground="{Binding Node.TargetPercentOfAccountMarketValue, Converter={StaticResource negativeColorFormatter}}"/><
br>                       
</
DataTemplate>                  
</
telerik:GridViewDataColumn.CellEditTemplate>                
</
telerik:GridViewDataColumn>

The reason for the two separate templates is that I need the values formatted differently for viewing and editing.
I can enter into edit mode, i.e. I see the blinking cursor, but I cannot enter any values; backspace works strangely enough, so I can delete any existing value but when I try and enter it fails.

I'd like to know what is wrong with a column setup in this manner.

Thank You

Hasanain

3 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 03 Aug 2012, 06:34 AM
Hello Hasanain,

 
Unfortunately, I was not able to reproduce the problem. May I ask you to share more details about how you have defined your objects and the converters? A code-snippet or a sample project demonstrating the issue would be of much help.


Looking forward to hearing from you. 

Kind regards,
Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Hasanain
Top achievements
Rank 1
answered on 03 Aug 2012, 02:10 PM
The problem appears to be very flaky. I can enter some text/numbers into the box initially, when everything works perfectly. But after that initial burst of activity, if I stop and come back to that same screen, then it stops working; At that point it can take in only spaces, and I can delete any value present using backspace or delete keys.

I currently have a trial version, could that be the reason. 

I have a sample project, but it's strange that it works fine there. When I have it replicated in that project, I will send it across.

For GridViewDataColumn and GridViewMaskedTextBoxColumn: Is there an overlay on the cell that the column provides and the cell edit template(s) is "below" that? And is there any preview text event that is caught to do the validation when an input is made?

Thank You

Hasanain
0
Vlad
Telerik team
answered on 06 Aug 2012, 06:08 AM
Hi,

 Our trials are exactly the same as our dev versions. If you can send us an example application where we can reproduce the problem we will be able to provide more info what's going on.

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeListView
Asked by
Hasanain
Top achievements
Rank 1
Answers by
Vera
Telerik team
Hasanain
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or