Hello,
I need a way to Drag & Drop an Item from the Context Menu and then GridView Columns to reordered based on the Context Menu Items ordering. This is for a WPF application.
As I understood this is not supported, I am writing here in any case I just didn't find the solution.
Thank you !!
Hi,
I have a list of RadExpander, inside every Radexpander there is a Radgridview. When I expand, expander height grow over the size of window and a scroll bar appears in expander control itself.
I would like that expander doesn't grow over the window and the scroll bar appears in the gridview. I could achieve this behaviour setting maxheight in gridview, but I don't want to limit the height of grid.In first attachment the situation when maxheight is not set, in the second with maxheight set, I would achieve the second situation but without setting maxheight.
Thank you
Luigi
Below it is the xaml as appears in LiveVisualTree: I think that the real one it is too much complex to understand the situation quickly.
I have this working for properties of the GroupHeaderRow. How do I change the text of the header row?
Property="Header" Value = "{}{0} test" and Property="Content" Value = "{}{0} test" dont seems to do anything.
public class GroupRowStyleSelector : StyleSelector
{
public override Style SelectStyle(object item, DependencyObject container)
{
var group = item as QueryableCollectionViewGroup;
if (group.count > 1)
{
return BigGroupStyle;
}
else
{
return SmallGroupStyle;
}
}
public Style BigGroupStyle { get; set; }
public Style SmallGroupStyle { get; set; }
}<Window.Resources>
<local:GroupRowStyleSelector x:Key="GroupRowStyleSelector">
<local:GroupRowStyleSelector.BigGroupStyle>
<Style TargetType="telerik:GroupHeaderRow">
<Setter Property="Background" Value="Red" />
</Style>
</local:GroupRowStyleSelector.BigGroupStyle>
<local:GroupRowStyleSelector.SmallGroupStyle>
<Style TargetType="telerik:GroupHeaderRow">
<Setter Property="Background" Value="Yellow" />
</Style>
</local:GroupRowStyleSelector.SmallGroupStyle>
</local:GroupRowStyleSelector>
</Window.Resources>Hi Telerik team,
I would like to have the foreground of the series labels same as the series color.
Below picture is the expected result:
Would you please help me how to obtain this?
Many thanks,
Minh Tuan.
I followed the instructions in this post to group based on data.
I modified the Github example AlternationRowStyleSelector I changed the Club.cs code slightly to create a more manageable dataset for this example.
I used reflection to inspect the data in a property on the model. For this example I looked at the data in the "Est." column. I want to change the style when the value changes.
Here is the modified code from AlternationRowStyle.cs
public Style RowStyle { get; set; }
public Style AltRowStyle { get; set; }
public string PropertyName { get; set; }
public override Style SelectStyle(object item, DependencyObject container)
{
var items = ((GridViewRow)container).GridViewDataControl.Items;
Type t = item.GetType();
PropertyInfo[] props = t.GetProperties();
var currentItemValue = props.First(n => n.Name == PropertyName)?.GetValue(item, null);
int currentItemIndex = items.IndexOf(item);
if (currentItemIndex > 0)
{
var previousItem = items[currentItemIndex - 1];
var previousItemValue = props.First(n => n.Name == PropertyName)?.GetValue(previousItem, null);
if (currentItemValue.Equals(previousItemValue))
{
return RowStyle;
}
else
{
return AltRowStyle;
}
}
return RowStyle;Modified section of MainWindow.xaml
<my:AlternationRowStyle x:Key="myRowStyle" PropertyName="Established" >
<my:AlternationRowStyle.AltRowStyle>
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="Gray"/>
</Style>
</my:AlternationRowStyle.AltRowStyle>
</my:AlternationRowStyle>
As you can see the AltRowStyle is being activated when the value of a row is different from the one above it. This isn't quite what I want. I want to change styles when the value changes. Specifically the seventh line above should be white not gray. I tried a different approach where I used a boolean in the style selector and toggled it. This works as desired.
Modified StyleSelector SelectStyle method.
public override Style SelectStyle(object item, DependencyObject container)
{
var items = ((GridViewRow)container).GridViewDataControl.Items;
Type t = item.GetType();
PropertyInfo[] props = t.GetProperties();
var currentItemValue = props.First(n => n.Name == PropertyName)?.GetValue(item, null);
int currentItemIndex = items.IndexOf(item);
if (currentItemIndex > 0)
{
var previousItem = items[currentItemIndex - 1];
var previousItemValue = props.First(n => n.Name == PropertyName)?.GetValue(previousItem, null);
if (!currentItemValue.Equals(previousItemValue))
{
altRowToggle = !altRowToggle;
}
}
return altRowToggle ? this.AltRowStyle : this.RowStyle;
}If you make the window smaller so that you have to scroll, then scroll up and down a couple times to force it to redraw the items and run the style selector, it can get off track.
I realize the scrolling behavior is caused by my using a boolean in an attempt to keep track of the style to use. When shrinking the grid, it re-evaluates the style selector based on the visible rows and determines which style to use but the toggle is in a state from the previous evaluation.
Is there a better way to achieve the desired result?
Thanks,
Chris
Hello,
In the ListBoxDragDropBehavior documentation, it is said:
The ListBoxDragDropBehavior supports copying the dragged items if the Control key is pressed. For that purpose the CopyDraggedItems method should be overridden
But the behavior supports copying the dragged items without changing anything!
This is a problem because, in my case, I need to avoid the copying of the dragged items in all cases.
How can I do it?

Currently i am using RadGridView control in one of my project. I need some clarification for below items,
I have already spent lot of time on it. But i didnt find an exact solution. Could you please help me on this?
Note :
I have tried below options,
Thanks in advance.
How I can do server-side paging/sorting/filtering in a RadDataGrid. I retrieve the data from an azure function and I don't want to retrieve all data from the database. I pass as a parameter to the azure function, the page index, and the page size. the response returns the result of the LINQ query with Skip(page index) and Take(page Size), and total row count.
Thank you for your help.
Hey, I'm building an app using Telerik for WPF, I want to minimize a tab when a variable change(using data binding) and I cannot find any answers across the web.
When I set the isHidden property to true, I can't set it back to false(because when isHidden set to true, the pane is removed from the visual tree), so I tried many other things to conditional minimizing the pane but didn't figure it out.
Sincerely, Omer