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

Tab problem- 2009q2

11 Answers 95 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Erez
Top achievements
Rank 1
Erez asked on 21 Jul 2009, 02:12 PM
Hello,

I have a grid connected to a DataView. The DataView has a rowfilter.

I add lines to the DataView by code.

The problem is that if I enter into a cell, change its value and press on Tab, the cell somehow keeps focus (the cell's text is aligned to

the center and pressing on Tab keeps the align to the right of the cell).

This also has a weird effect on that specific row- it disregards the DataView filter.

This does not happen if I input a value to the cell and then move the focus to another cell by

clicking on it and not by the Tab key.


Thanks,

Erez



11 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 23 Jul 2009, 10:37 AM
Hello Erez,

I tried to reproduce your problem locally, but the described behavior did not show up. Are you using our latest binaries from 2009 Q2? If you could sent me a simple example project that illustrates this problem I would be able to debug it locally on my machine.
I'm also sending you the example which I have created to try to reproduce your case? Is it working fine on your end?

Regards,
Stefan Dobrev
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
Erez
Top achievements
Rank 1
answered on 23 Jul 2009, 01:13 PM
Hello Stefan,

Just add the following event handler:

private void GridView_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
        {
            DataRowView oDRV = null;
            DataRow oDR = null;
            string sCol = "";

            oDRV = e.Cell.ParentRow.DataContext as DataRowView;
            oDR = oDRV.Row;
            sCol = e.Cell.DataColumn.DataMemberBinding.Path.Path;

            if (sCol == "StringColumn")
            {
                oDR[sCol] = "   " + e.Cell.Value + "   " + " Hello " ;
            }
        }

 

Connect it to the grid, run the project, go to one of the cells under the 'StringColumn' column, change its value
and press on Tab.

Now go to a different row, do the same thing only this time click on another cell instead of pressing on Tab.
You will see that the value does not change on the grid when using Tab.

It seems that this does not  occur if one does:
e.Cell.Value  = e.Cell.Value  + " hello ";

Thanks,

Erez




0
Nedyalko Nikolov
Telerik team
answered on 29 Jul 2009, 07:03 AM
Hello Erez,

I'll try to clarify what happens with this particular scenario.

There is one important difference between press TAB and click on another cell.
When you press TAB and next editable cell belongs to same row RadGridView fires CellEditEnded event but not actually commit data to the underlying data source. Actual commit of the data happens when TAB navigation leaves edited row, or Enter key is pressed (which calls RadGridView.CommitEdit()).

As you probably guess this is not the case when user clicks on another cell, in this case all data from edited row is committed to the data source.

As you already noticed changing Cell.Value in CellEditEnded event handler is better than changing business object directly. This is recommended way to meet your goals.

Don't hesitate to contact us if you have other questions.


Greetings,
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
Erez
Top achievements
Rank 1
answered on 05 Aug 2009, 04:18 PM
Hi Nedyalko,

I understand what you wrote, however I have a hard time accepting it as I do not see

any logical reason for this behavior.
Furthermore, from an end-user standpoint\human engineering,

there is no difference between tabbing to another cell and clicking on another cell.

As far as I see it, this is a logical bug of the worst kind.

Please reconsider fixing it.


Best regards,

Erez
0
Nedyalko Nikolov
Telerik team
answered on 07 Aug 2009, 12:54 PM
Hi Erez,

The difference is that editing with a TAB key commits data to the underlying data source only when whole row is edited (when focus leaves edited GridViewRow). While with the current version of the RadGridView when you click on a GridViewCell it becomes current, so here RadGridView commits all pending edit to the data source.

Of course we have planned to improve editing mechanism to become more friendly and usable from "User Experience" point of view. This issue is one of the first which will be fixed.

Sincerely yours,
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
Erez
Top achievements
Rank 1
answered on 18 Aug 2009, 12:53 PM
Hello,

Good to hear.

This problem is very serious for us.

Do you have an expected date on which you are planning to release a fix for this matter ?

Thanks,

Erez

0
Nedyalko Nikolov
Telerik team
answered on 20 Aug 2009, 02:19 PM
Hi Erez,

Please try it with the next latest internal build (this Friday).
There is a small improvement of the editing mechanism using mouse. Now when you click on a cell from the currently edited row this cell will automatically enter into edit mode (no double click needed). Actual commit of the data to the underlying data source will happen when cell from another row is clicked or RadGridView lose focus and RowEditEnded event will be raised (no matter of the RadGridView.ValidationMode property value).

All the best,
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
Erez
Top achievements
Rank 1
answered on 19 Oct 2009, 03:09 PM

Hello,

I am using Telerik.Windows.Controls.GridView.dll version

2009.2.911.35
and, indeed, clicking on another cell does cause the cell I left to commit its edit, however tabbing still does not
work properly.


Is this still a know bug\issue ?

Thanks,

Erez

0
Nedyalko Nikolov
Telerik team
answered on 22 Oct 2009, 11:14 AM
Hello Erez,

With the specified version TAB navigation works similar to click on a cell from the same row. I've checked this behavior and everything works fine on my end.
Can you provide me with more information about what is not correct with tab navigation?

Kind regards,
Nedyalko Nikolov
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
Erez
Top achievements
Rank 1
answered on 03 Nov 2009, 02:13 PM
Hello,

I narrowed it down- the problem occurs when I am using a
GridViewDataColumn.CellTemplate

Please see the example below.
Putting a value in the 'one' column does not show in the Templates TextBlock, unless I
move to another row.

What are my options of solving it so that Tabbing will behave the same the pressing on Enter ?

Thanks.


<Window x:Class="RejectionReason.Window2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    Height="auto" Width="auto" Background="Bisque"
    Title="Test">
   
    <Grid>
        <telerik:RadGridView
                Height="auto" Width="auto"
                Name="radGridView1"
                AutoGenerateColumns="False"
                Loaded="radGridView1_Loaded">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn UniqueName="col_ActName1"
                                                    DataMemberBinding="{Binding one}"
                                                    IsVisible="True" Header="one"
                                                    HeaderTextAlignment="Center" Width="90"
                                                    TextAlignment="Left" >
                    <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                        <TextBlock
                                            Text="{Binding one}" />
                                </DataTemplate>
                        </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>

                <telerik:GridViewDataColumn UniqueName="col_ActName2"
                                                    DataMemberBinding="{Binding two}"
                                                    IsVisible="True" Header="two"
                                                    HeaderTextAlignment="Center" Width="90"
                                                    TextAlignment="Left" >
                </telerik:GridViewDataColumn>

                <telerik:GridViewDataColumn UniqueName="col_ActName3"
                                                    DataMemberBinding="{Binding three}"
                                                    IsVisible="True" Header="three"
                                                    HeaderTextAlignment="Center" Width="90"
                                                    TextAlignment="Left" >
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

private void radGridView1_Loaded(object sender, RoutedEventArgs e)
        {
            var dt = new DataTable();

            var dc = new DataColumn("one", typeof(string));
            dc.DefaultValue = dc.ColumnName;

            var dc2 = new DataColumn("two", typeof(string));
            dc2.DefaultValue = dc2.ColumnName;

            var dc3 = new DataColumn("three", typeof(string));
            dc3.DefaultValue = dc3.ColumnName;

            dt.Columns.Add(dc);
            dt.Columns.Add(dc2);
            dt.Columns.Add(dc3);
            dt.Rows.Add("aaa", "bbb", "ccc");
            dt.Rows.Add("aaa", "bbb", "ccc");
            dt.Rows.Add("aaa", "bbb", "ccc");

            radGridView1.ItemsSource = dt.DefaultView;

            radGridView1.ValidationMode = Telerik.Windows.Data.ValidationMode.Row;
        }

0
Nedyalko Nikolov
Telerik team
answered on 06 Nov 2009, 03:46 PM
Hi Erez,

You have to bind TextBlock.TextProperty to the GridViewCell.Value, because underlying data object is not changing when TABing in the same row.

<TextBlock Text="{Binding Value, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewCell}}}" />
 
instead of
 
<TextBlock Text="{Binding one}" />


In order to have similar to Enter key behavior of the TAB key you have to set ValidationMode to cell. By the way this property is marked with obsolete with the 2009.Q3 release. Hope this helps.

Regards,
Nedyalko Nikolov
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.
Tags
GridView
Asked by
Erez
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Erez
Top achievements
Rank 1
Nedyalko Nikolov
Telerik team
Share this question
or