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

Display edit control on row mouseover

3 Answers 92 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric Belanger
Top achievements
Rank 1
Eric Belanger asked on 10 Dec 2009, 08:05 PM
Hi,

I wanted to know if it is possible to display edit controls only when the mouse is over the row.

I mean by that that if there is a combobox in a cell, the combobox is not visible as long as i am not overing the mouse on a row.  Instead of the combobox, we should see the text only.  This allow to have a clean datagrid not clustered with tons of controls and, be able to edit easily with the mouse.

Thank you!

3 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 11 Dec 2009, 04:46 PM
Hi Eric Belanger,

You can control when a cell is entering edit mode calling the BeginEdit() method and committing the value using CommitEdit(). Attached you can find an example project that enables editing cell values on hovering.

If you have any more questions do not hesitate to contact us.


Best wishes,
Tsvyatko
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
Eric Belanger
Top achievements
Rank 1
answered on 14 Dec 2009, 06:34 PM
I don't really like all that code behind.  It sounds like a WinForm way of working.  So  I made myself a more XAML oriented way of doing it, and i ended up with:

            <Style TargetType="{x:Type telerik:GridViewCell}">
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="true">
                        <Setter Property="IsInEditMode" Value="True"/>
                        <Setter Property="IsCurrent" Value="True"/>
                    </Trigger>
                </Style.Triggers>
            </Style>

It is working.  I would like to know if you have any warning about that or if it is safe.

Thank you.
0
Tsvyatko
Telerik team
answered on 15 Dec 2009, 09:10 AM
Hi Eric Belanger,

 I am happy that you prefer using Xaml approach and came with this alternative solution. I believe that in your case editing cell style will work fine.


Kind regards,
Tsvyatko
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
Eric Belanger
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Eric Belanger
Top achievements
Rank 1
Share this question
or