ViewModel.cs:
public QueryableDataServiceCollectionView<MyTable> MyTableView { get; set; }
var dsq = context.MyTable.AddQueryOption("$orderby", "InsertDateTime");
MyTableView = new QueryableDataServiceCollectionView<MyTable>(dsq.Context, dsq)
{
PageSize = 25,
AutoLoad = true
};
View.xaml:
<telerik:RadGridView ItemsSource="{Binding ElementName=MyPager, Path=PagedSource}">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Insert Date Time"
DataMemberBinding="{Binding InsertDateTime}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<telerik:RadDataPager x:Name="MyPager"
PageSize="25"
Source="{Binding MyTableView}" />
When I click on the Insert Date Time column header, a Microsoft.OData.Client.DataServiceQueryException exception is thrown with the message "Duplicate property named 'insertDateTime' is not supported in '$orderby'."
The query that's spat out by the RadGridView/RadDataPager/QueryableDataServiceCollectionView is /odata/v1/MyTable?$orderby=insertDateTime,InsertDateTime&$top=25
How do I fix this?
For context, MyTable has 10 million records with server-side pagination enabled and the records must be sorted by InsertDateTime when first loaded.
Dear Telerik Team,
Do we have any multiple selection (Check box) option in Grouped rows?
Reference screen shot attached here.
Thanks in Advance
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.
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.
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.
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}" />
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.
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
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}`?