Telerik Forums
UI for WPF Forum
0 answers
1 view

Hi Telerik Team,
I'm using the below telerik version 2023.2.718.45

The default style is extracted through Office2016 theme.

For the RadGridView footers, the below are the styles used.

<Style x:Key="DefaultGridViewFooterRowStyle" TargetType="telerik:GridViewFooterRow">
                <Setter Property="Height" Value="35" />
                <Setter Property="BorderThickness" Value="0" />
            </Style>

            <Style x:Key="DefaultGridViewFooterCellStyle" TargetType="telerik:GridViewFooterCell">
                <Setter Property="Background" Value="#F1F1F1F1" />
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="HorizontalAlignment" Value="Stretch" />
                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="FontSize" Value="10" />
                <Setter Property="Padding" Value="0" />
            </Style>


But, from where the vertical lines are coming in the footer (Please refer the attachment).
Also, if I perform Column resizing, then the vertical line is not showing for some time and showing for some other time (Please refer 2nd attachment).
Also, sometimes the border which I used to display the sum in the footer having display issue, means the right border is hiding sometimes when I perform column resizing and sometimes without column resizing the same issue occurs.
It looks like resolution issue.
Please let us know any solution to avoid this line and right border hiding issue. It looks weird.

Premkumar
Top achievements
Rank 1
Iron
Iron
 asked on 16 Apr 2024
2 answers
18 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
0 answers
11 views

I have been trying to use a VirtualQueryableCollectionView with a RadGridView but no matter what I do, the grid view is always empty.

// Person is an entity.
public class Person
{
    public string Name { get; set; }
    public string Dept { get; set; }
    public double Salary { get; set; }
}

public VirtualQueryableCollectionView PeopleView { get; set; }

// dbContext is an OData DataServiceContext. peopleQuery has a Count() of 1000 items.
IQueryable<Person> peopleQuery = dbContext.Person.OrderBy(x => x.Name);
PeopleView = new VirtualQueryableCollectionView(peopleQuery) { LoadSize = 50 };    
OnPropertyChanged(nameof(PeopleView));
<telerik:RadGridView AutoGenerateColumns="True"
                     ItemsSource="{Binding PeopleView}" />
But the grid view is empty. Just wondering what I'm doing wrong. Thank you.
Wizard6650
Top achievements
Rank 1
Iron
 updated question on 06 Apr 2024
1 answer
11 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
13 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
0 answers
23 views

Hi
Please find my below code showing the celledittemplate

<telerik:GridViewDataColumn.CellEditTemplate>
    <DataTemplate>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <tbcontrols:SmartSearchRadAutoCompleteBox x:Name="JournalSuggestions" AutomationProperties.AutomationId="JournalSuggestions" 
                                        Style="{StaticResource SmartControlStyle}"  
                                        SelectionMode="Single" 
                                        KeyDown="JournalSuggestions_KeyDown"                                                                        
                                        PreviewGotKeyboardFocus="JournalSuggestions_PreviewGotKeyboardFocus"
                                        Populating="JournalSuggestions_Populating"
                                        Width="{Binding RelativeSource={RelativeSource AncestorType=telerik:GridViewDataColumn}, Path=ActualWidth}"
                                        BorderThickness="0" 
                                        BorderBrush="Transparent" 
                                        ClipToBounds="True" 
                                        AutoCompleteMode="Suggest"
                                        ItemsSource="{Binding Source={StaticResource SmartJournalAccounts}}"
                                        DisplayMemberPath="Code" 
                                        FilteringBehavior="{StaticResource LocalJournalFilter}"
                                        HorizontalAlignment="Stretch" 
                                        VerticalAlignment="Stretch"
                                        VerticalContentAlignment="Center"
                                        DropDownItemTemplate="{Binding Source={StaticResource CustomDropDownTemplate}}" 
                                        NoResultsContentTemplate="{StaticResource NoResultsContentTemplate}"
                                        DropDownWidth="Auto"  
                                        BoxesItemStyle="{StaticResource CustomRadAutoCompleteBoxesItemStyle}" 
                                        IsEnabled="True" 
                                        Margin="-17 0 0 0"                                                                        
                                        SearchText="{Binding DataContext.SmartControlSearchText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}"
                                        SelectedItem="{Binding Path=SmartJournalAccountItem, Mode=TwoWay}"
                                        TextSearchMode="Contains" TextBoxStyle="{StaticResource TrailBalanceAccountTextBoxStyle}" FontSize="12" >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="SelectionChanged">
                        <cal:ActionMessage MethodName="AutoCompleteBoxSelectionChanged">
                            <cal:Parameter Value="{Binding SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadAutoCompleteBox}}}"></cal:Parameter>
                        </cal:ActionMessage>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <i:Interaction.Behaviors>
                    <behaviours:RadAutoCompleteBoxBehavior/>
                </i:Interaction.Behaviors>
            </tbcontrols:SmartSearchRadAutoCompleteBox>
            <Button x:Name="SearchButton" Grid.Column="1"
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=controls:APTPanel}}"
                    Click="SearchButton_Click">                
                <Button.Visibility>
                        <con:ConverterBindableBinding Binding="{Binding IsSearchAccountVisible,UpdateSourceTrigger=PropertyChanged}" 
                                                      Converter="{StaticResource BooleanToVisibilityConverter}"
                                                      ConverterParameterBinding="{Binding IsSearchAccountVisible, RelativeSource={RelativeSource AncestorType={x:Type controls:APTPanel}}, UpdateSourceTrigger=PropertyChanged}">
                        </con:ConverterBindableBinding>
                    </Button.Visibility>
            </Button>
        </Grid>
    </DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>

If I click the "SearchButton" on first click the event does not fire, the click event fires if I click it second time.
If I remove the SmartSearchRadAutoCompleteBox  control & only keep the SearchButton then it works ok.

Can someone give me code snippet having multiple controls (one radautosearchbox & one button) in datatemplate of celledittemplate or help me understand what is causing issue in my  Click event

Regards,
Swapnil. 

swapnil
Top achievements
Rank 1
 updated question on 19 Mar 2024
1 answer
20 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
20 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
18 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
1 answer
53 views

I have a RadGridView where i've replaced the "Full Text Search" with a custom control (TextBox + Label) 

I'm using a Debouncer to collect text changes from the Textbox and then after 300msec - do the search:


if (e.PropertyName == "Query")
{
	debounce.Debounce(() =>
	{
		Dispatcher.Invoke(() =>
		{
			FilterByQuery();
		});
	});
}
FilterByQuery() : 
var searchBytextCommand = RadGridViewCommands.SearchByText as RoutedUICommand;
searchBytextCommand.Execute(Query, radgrid);

Query = String property

radgrid = x:name of the RadGridView.

at some random point in time of the lifetime of the WPF program, this function stops working !

- I dont have any other case of the Debouncer stops working so i trust that it's not the issue. 

- WPF Databinding and PropertyChanged events are also working 1000 other places in the program without failing, so i trust that they work too.

- This leads me to believe that the RadGridViewCommands might have an issue.. 

 

Martin
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 26 Feb 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?