WPF RadGridView exploring functionality

1 Answer 47 Views
GridView
Shukurdin
Top achievements
Rank 1
Shukurdin asked on 03 Jun 2024, 06:18 AM

Hey guys! We are considering using RadGridView in our apps, but we have figure out next things: 

1. Is it possible to always keep a row in Non edit mode? In other words a user should double click on cells every time when he wants to edit a cell despite the selected row.
2. Is it possible to keep RadCheckBoxColumn is the edit mode? In this case a user should check or uncheck a checkbox by single click. 
3. Is it possible to go next row by Enter key and if it's the last row a new row should be added?
4. Does RadGridView have a functionality to select a column by clicking on the column header?

 

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 05 Jun 2024, 03:36 PM

Hello Shukurdin,

1. Is it possible to always keep a row in Non edit mode? In other words a user should double click on cells every time when he wants to edit a cell despite the selected row.

I am not sure that I fully understand this requirement as each cell by default will need two left-button clicks to go into edit mode. The first click will select the cell/row and the second one will put the cell into edit mode. When a cell/row is already selected, a single click will be required. If this is the desired behavior, one approach would be to prevent the user from performing selection in the control by setting the CanUserSelect property of RadGridView to False. This way, there will always be two clicks before a cell gets into an edit mode.

2. Is it possible to keep RadCheckBoxColumn is the edit mode? In this case a user should check or uncheck a checkbox by single click. 

For this question, a GridViewDataColumn can be used. Then, create a custom DataTemplate with a CheckBox element inside and bind the IsChecked property to the same property set to the column's DataMemberBinding property. Finally, set the DataTemplate to the CellTemplate property of the column and set the IsReadOnly property to True.

The following code snippet shows this suggestion's implementation:

<telerik:GridViewDataColumn DataMemberBinding="{Binding MyBooleanProperty}" IsReadOnly="True">
    <telerik:GridViewDataColumn.CellTemplate>
        <DataTemplate>
            <CheckBox IsChecked="{Binding MyBooleanProperty}"/>
        </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>

3. Is it possible to go next row by Enter key and if it's the last row a new row should be added?

To customize, which commands are executed when pressing a key from your keyboard in the scope of RadGridView, a custom keyboard command provider can be created.

The following article provides more information about the keyboard command provider functionality of RadGridView:

WPF DataGrid - Keyboard Command Provider - Telerik UI for WPF

4. Does RadGridView have a functionality to select a column by clicking on the column header?

We have an example in our SDK Samples Browser for this requirement and it is named "Column Selection". Its code can also be retrieved from our GitHub repository:

 xaml-sdk/GridView/ColumnSelection at master ยท telerik/xaml-sdk (github.com)

With this being said, I hope the provided information will be of help to you.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Shukurdin
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or