Telerik Forums
UI for WPF Forum
1 answer
5 views

Hi,

in my project there is one RadGridView is present. Inside it there is GridViewComboBoxColumn but whenver I am selecting other item from that comboboxcell, binded property setter is not being called and as a result datacontext also remains same.

But whenever cell of that combobox column loses the focus property setter is called and as a result datacontext is fixed.

 

Please suggest fixes for this one.

 

Also is there any way to manually update datacontext ? If yes then how to retrieve changed places and how to update them in datacontext using selection change listener?

Dimitar
Telerik team
 answered on 16 May 2024
1 answer
8 views

Hi, I followed the steps on how to save / load filters on my c# WPF app from this link and it is working correctly

https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/how-to/howto-save-and-load-filter-settings

My grid is filtered and it works for all the columns (Just in case it wasn’t clear, the grid is indeed filtered by Source and Order Id). For all the fields that are strings, the filters look good when it shows:

But the fields that are enums, The header shows the icon as if a filter has been applied, but when it shows me the list, the values are not checked:


Code:

<telerik:RadGridView 
    x:Name="DesignQueueOrderGridView"
    ShowGroupPanel="False" 
    AutoGenerateColumns="False" 
    ItemsSource="{Binding FilteredDesignQueueOrderViewModels}"
    RowDetailsVisibilityMode="Visible"
    RowIndicatorVisibility="Collapsed"
    Grid.Row="1"
    VerticalAlignment="Top"
    RowStyle="{StaticResource RowStyleOdd}" 
    AlternationCount="2" 
    AlternateRowStyle="{StaticResource RowStyleEven}"
    CanUserSortColumns="False">

 

<telerik:GridViewDataColumn 
        UniqueName="ImageSource"
        Header="Source"
        HeaderTextAlignment="Center"
        DataMemberBinding="{Binding ImageSource}"
        IsReadOnly="True">

<telerik:GridViewDataColumn DataMemberBinding="{Binding UserId}" UniqueName="UserId"

                

                            HeaderTextAlignment="Center" 
                            Header="User Id" 
                            IsReadOnly="True"/>

              </telerik:GridViewDataColumn>

Enum:

[DataContract]
public enum ImageSource
{
    [EnumMember]
    Unknown = 0,

    [EnumMember]
    OnlineDesigner = 1

}

public void LoadColumnFilters(IList<FilterSetting> savedSettings)
{
    Application.Current.Dispatcher.Invoke(() =>
    {
        GridViewDataControl.FilterDescriptors.SuspendNotifications();

        foreach (FilterSetting setting in savedSettings)
        {
            Telerik.Windows.Controls.GridViewColumn column = GridViewDataControl.Columns[setting.ColumnUniqueName];

            if (column is null)
                continue;

            IColumnFilterDescriptor columnFilter = column.ColumnFilterDescriptor;

            if (setting.SelectedDistinctValues is not null)
            {
                foreach (string? distinctValue in setting.SelectedDistinctValues)
                {
                    columnFilter.DistinctFilter.AddDistinctValue(distinctValue);
                }
            }
        }

        GridViewDataControl.FilterDescriptors.ResumeNotifications();
    });
}

 

Thank you in advance! Juan

Martin Ivanov
Telerik team
 answered on 13 May 2024
1 answer
10 views

Hi

In the image attached there are two columns of a radgridview, defined as follow:

<t:GridViewDataColumn										
				Header="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.SelectedColumnHeader }}"
				DataMemberBinding="{Binding IsSelected, Mode=TwoWay
								, UpdateSourceTrigger=PropertyChanged}">
				<t:GridViewDataColumn.CellTemplate>
								<DataTemplate>
									<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay
										, UpdateSourceTrigger=PropertyChanged}" />
								</DataTemplate>
				</t:GridViewDataColumn.CellTemplate>
</t:GridViewDataColumn>
<t:GridViewCheckBoxColumn
				AutoSelectOnEdit="True"
				Header="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.SelectedColumnHeader }}"
				DataMemberBinding="{Binding IsSelected, Mode=TwoWay
				, UpdateSourceTrigger=PropertyChanged}"/>
As you can see the 2 checkbox have different style: is possible to get the first one with the style of second one?

I need to use the first way, because I need to reflect the checking immediately, while the GridViewCheckBoxColumn seems to works only on lost focus.

Thank you
Luigi
Stenly
Telerik team
 answered on 03 May 2024
1 answer
17 views

Dear Telerik Team,

Do we have any multiple selection (Check box) option in Grouped rows?

Reference screen shot attached here.

 

Thanks in Advance 

 

Martin Ivanov
Telerik team
 answered on 22 Apr 2024
2 answers
23 views

Hello,

I am new to Telerik, in my application we are using RadGridView and load the data dynamically.

when data is large, and I copy pasted from excel then my cells are not highlighted. data is pasted correctly but highlighted cell is not working.

If I edit it manually then it's working fine and I handled this highlighted cell in "CellEditEnd" event.

I walk through multiple forums but none of them are working for me.

I tried to raise ClipboardPaste event but that is not available my RadGridView control.

Also I manually created below function but "MyRadGrid.ChildrenOfType<GridViewRow>()" is not giving me all the index of my radgridview it gives 10 or 15 according to the screen size because of virtualization

private void HighlightUpdateCell(int rowIndex, int columnIndex)
        {           
            int rowNumber = 0;
            foreach (GridViewRow gr in MyRadGrid.ChildrenOfType<GridViewRow>())
            {
                if (rowNumber == rowIndex)
                {
                    gr.Cells[columnIndex].Background = Brushes.Yellow;
                    break;
                }
                rowNumber++;
            }
        }

Another approach was to create a property and set it in style but that is also not working. as cells are not showing in edited mode after pasting data.

I also tried using CellStyleSelector but the is applying changes only on load after that this method is not call itself.

 

I tried for ClipboardPaste event but unable to find that in my application.

I am using latest Telerik libraries from 2024

 

Can you please help to highlight the cells of RadGridView after paste is completed.

 

 

Meera
Top achievements
Rank 1
Iron
 answered on 12 Apr 2024
1 answer
19 views
Is there a way to delete all rows inside a RadGridView after a button event has been pressed?
The documentation shows how to delete the row/rows via keyboard(from a user) or manually but didn't found via code

Example: The user presses a button that deletes all text inside textboxes including the rows data inside the RadGridView
Martin Ivanov
Telerik team
 answered on 04 Apr 2024
1 answer
42 views
I am using telerik's RadGridView as my datagrid and I want to make the search disabled when a toggle button is switched, the things I want are like so:
- When the user unchecks the toggle the search should clear and the user will still be able to type the searchbar but it will not execute any search 
- when the user checks the toggle if there is a text in the searchbar, the search will be executed based on that text and the user will be able to seach from now on

I tried this:
 private string searchText { get; set; }
 private void MainDatagrid_Searching(object sender, GridViewSearchingEventArgs e)
 {
     if (!(bool)showFilteredToggleButton.IsChecked)
     {
         e.Cancel = true;
         searchText = e.SearchText;
     }
     else
     {
         e.Cancel = false;
         searchText = e.SearchText;
     }
 }

 private void showFilteredToggleButton_Checked(object sender, RoutedEventArgs e)
 {
     if (!(bool)showFilteredToggleButton.IsChecked)
     {
         var clearSearchValue = GridViewSearchPanelCommands.ClearSearchValue as RoutedUICommand;
         clearSearchValue.Execute(null, MainDatagrid.ChildrenOfType<GridViewSearchPanel>().FirstOrDefault());
     }
     else
     {
         var searchBytextCommand = RadGridViewCommands.SearchByText as RoutedUICommand;
         searchBytextCommand.Execute(searchText, MainDatagrid);
     }
 }

But there are some features missing such as when user checks the toggle the search isn't initiated and when the user unchecks the toggle the searchbar clears itself but the search isn't cleared, old search remains. How can achieve the functionality I described? Can you help me?
Dimitar
Telerik team
 answered on 27 Mar 2024
1 answer
26 views

Hi,

I have a RadGridView in WPF where I use CustomGrouping for displaying it as a hierarchical structure. I set on it AutoExpandGroups="True" in order to be expanded by default. My problem is, if I manually collapse something in the RadGridView and I make an update to the list bounded to ItemsSource, the RadGridView automatically expands and does not stay as it was.

Thanks

Martin Ivanov
Telerik team
 answered on 14 Mar 2024
1 answer
22 views

I've read this thread but it is a bit confusing and old: Live sorting/grouping in UI for WPF | Telerik Forums

What is the current situation?

I am having problems with Devexpress GridControl as they dont support what they call "Live Data Shaping" eg sorting with real-time updates IF you use WPF binding.

Question - can Telerik data grid and/or virtual grid do live data shaping where columns use custom templates with WPF binding to a dictionary. For example: `{Binding Fields[abc].Value}`?

Martin Ivanov
Telerik team
 answered on 11 Mar 2024
1 answer
22 views

There's probably just a property for this that I am missing.
I have a RadGridView with SelectionUnit="FullRow" but it still draws a box around whatever cell I click on.

I can confirm that it doing the full row selection because it will copy the row text if I press ctrl-C.
The row indicator on the left is also showing correctly.

So how do I tell it to not draw the box around the cell?

(it's not a big issue but some user will probably complain about it)

 

Martin Ivanov
Telerik team
 answered on 05 Mar 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?