Telerik Forums
UI for WPF Forum
1 answer
220 views

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.


<Grid x:Uid="Grid_1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<t:RadDocking x:Name="radDocking1"
                            RetainPaneSizeMode="DockingAndFloating"
                            CanAutoHideAreaExceedScreen="True"
                            Grid.Row="1" Margin="0 0 0 10"                            
                            BorderThickness="0"
CloseButtonPosition="InPane"
                            Padding="0"
  Close="radDocking1_Close"
  PaneStateChange="radDocking1_PaneStateChange">
<t:RadSplitContainer 
MinWidth="310"
MaxWidth="600" t:DockingPanel.InitialSize="260,150"
                    Name="RightContainer" InitialPosition="DockedRight">
<t:RadPaneGroup >
<t:RadPane>
<t:RadPanelBar 
HorizontalContentAlignment="Stretch"
ExpandMode="Multiple" Name="PanelBarCursor"
t:StyleManager.Theme="Office_Blue"
ScrollViewer.VerticalScrollBarVisibility="Visible">
<t:RadPanelBarItem 
VerticalAlignment="Top"
HorizontalContentAlignment="Left"
Header="{DynamicResource CursoriAssociati}">
<StackPanel>
<t:RadListBox ItemsSource="{Binding TabCursori.Cursori}" 
  SelectionMode="Single"
  Loaded="RadListBox_Loaded"
  SelectedItem="{Binding TabCursori.SelectedCursor}">
<t:RadExpander t:AnimationManager.IsAnimationEnabled="false" IsExpanded="{Binding IsExpanded, Mode=TwoWay}">
<t:RadExpander.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<t:RadGridView 
MaxHeight="250"
ItemsSource="{Binding PositionsY}"
CanUserDeleteRows="False"
CanUserInsertRows="False"
RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
ShowColumnHeaders="False"
ShowColumnFooters="False"
ShowGroupPanel="False"
ShowScrollPositionIndicator="False"
ShowSearchPanel="False"
SelectedItem="{Binding 
RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=t:RadDocking},
Path=DataContext.TabCursori.PositionHilight}"
   IsReadOnly="True">
<t:RadGridView.Resources>
<Style TargetType="t:GridViewRow">
<Setter Property="SelectedBackground" Value="Bisque"/>
</Style>
</t:RadGridView.Resources>
<t:RadGridView.Columns>
<t:GridViewDataColumn DataMemberBinding="{Binding ParameterName}" Width="100"/>
<t:GridViewDataColumn DataMemberBinding="{Binding ParameterValue, StringFormat=N1}" Width="80"/>
</t:RadGridView.Columns>
</t:RadGridView>
<!--<TextBlock Text="{Binding Internal.PositionY, StringFormat={}{0:F4}}"
   Visibility="{Binding PositionYVisibility, Converter={StaticResource BoolToVis}}"/>-->
</Grid>
</t:RadExpander.Content>
</t:RadExpander>
</t:RadPanelBarItem >
</t:RadPanelBar>
</t:RadPane>
</t:RadSplitContainer >
</t:RadDocking>
</grid>
Martin Ivanov
Telerik team
 answered on 10 Feb 2022
0 answers
110 views
I've been struck with a dilemma. A certain RadWindow contains a RadTabControl, that has a Tab with RadCartesianCharts and a WebBrowser on it. I discovered that the web browser wasn't able to show when we changed all Windows into RadWindows, and the solution would be to use the RadWindowInteropHelper to set the transparency to false. This solved the WebBrowser's issue and now it displays, but suddenly the colored bars on the charts don't appear, so it seems the transparency was necessary for them. I'm not sure if there's a way for me to have both appear or if I'll need to make changes to how the application should work. 
Evan
Top achievements
Rank 1
 asked on 09 Feb 2022
1 answer
128 views

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>


Dilyan Traykov
Telerik team
 answered on 09 Feb 2022
2 answers
220 views

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.

minh
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 09 Feb 2022
0 answers
144 views

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

Chris
Top achievements
Rank 1
 asked on 08 Feb 2022
1 answer
193 views

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?

Martin Ivanov
Telerik team
 answered on 08 Feb 2022
0 answers
172 views

Currently i am using RadGridView control in one of my project. I need some clarification for below items,

  • How to filter column values based on background color as well as actual value?
  • If not possible means, then how to create custom filter for color filter with existing filter option.

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,

  • Used "FilterMemberPath" to map another property .
  • Created custom control for color filter. But not able to use exisitng functionality.

Thanks in advance.

Ranjith Kumar
Top achievements
Rank 1
 updated question on 08 Feb 2022
1 answer
492 views

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.

Martin Ivanov
Telerik team
 answered on 07 Feb 2022
1 answer
143 views

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

  
Dilyan Traykov
Telerik team
 answered on 07 Feb 2022
2 answers
283 views

Hello.

In radgridview i change the colors of the cells in the cellloaded event, which wotks fine, but

is there any way to use doubleanimate the backgroudn color of a cell?

 

This is how i color now:

 

Private Sub dgw_PL_CellLoaded(sender As Object, e As CellEventArgs) Handles dgw_PL.CellLoaded
        If TypeOf e.Cell Is GridViewHeaderCell Or TypeOf e.Cell Is GridViewFooterCell Then
            Exit Sub
        End If
        If e.Cell.Column.DisplayIndex < 7 Then
            e.Cell.Background = Brushes.LightSteelBlue
        End If
        Dim G As Telerik.Windows.Controls.GridView.GridViewCell = e.Cell
        If e.Cell.Column.UniqueName.ToString.ToUpper.Contains("DEM") Then
            If e.Cell.Column.DisplayIndex > 6 AndAlso (G.Content.text = "0" Or G.Value > 0) Then
                G.Background = New SolidColorBrush(Color.FromRgb(200, 255, 215))
            End If
        End If
End Sub

 

How could i make it for example blink between two colors, with doubleanimation?

 

Thanks

Peter

Peter
Top achievements
Rank 1
Iron
Iron
 answered on 06 Feb 2022
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?