Telerik Forums
UI for WPF Forum
1 answer
84 views

I want to set BackgroundColor of  all cells in the GridView dependent not on the propery of the RowItem but on the property bound to whole GridView.

The Bound Property is Called but nothing is changed. What is the easiest way to do it?

 

                <telerik:RadGridView.Style>
                  <Style TargetType="telerik:RadGridView">
                    <Style.Triggers>
                      <DataTrigger Binding="{Binding IsAuthenticated}" Value="True">
                        <Setter Property="Background" Value="{StaticResource W Grey}"/>
                      </DataTrigger>
                      <DataTrigger Binding="{Binding IsAuthenticated}" Value="False">
                        <Setter Property="Background" Value="{x:Null}"/>
                      </DataTrigger>
                    </Style.Triggers>
                  </Style>
                </telerik:RadGridView.Style>

 

Is it something bad here?

 

Dinko | Tech Support Engineer
Telerik team
 answered on 15 May 2019
2 answers
3.3K+ views

Hello,

The code in the attached image is used to display a table.

I want to add a new column in which each row has a button. 

Upon click, the handler will "know" the line and act accordingly.

Is it possible ?

Thank you,

Z.V

 

gaurav
Top achievements
Rank 1
 answered on 15 May 2019
5 answers
205 views
We are loading data dynamically from a System.DataTable with typed columns.  DateTime columns types do not have the common operators like:
Is less than, Is less than or equal to, ... and so on..., that are usually found on numeric style columns types.  Only operators available are: Is equal to and Is not equal to.

String data does contain what we expect: Is equal to, Is not equal to, Starts with. .. and so on...
and the numeric values have the other operators: Is less than,  Is less than or equal to, ... and so on...

The version of the Telerik.Windows.Controls dll is 2011.2.920.35.  Would the Q3 version have these operators?  Or can we use the new Q3 FilterOperatorsLoading event handler to add them?
Dilyan Traykov
Telerik team
 answered on 14 May 2019
0 answers
211 views
Here our radgridview we have added few validations to the properties of the view model.in one particular scenario even though the errors are cleared by the user theUI still displays the invalid edit template. Upon looking further we found that the GridViewRow.isValid  property is not being updated only in this scenario.Which was resulting in indicating the row still to be invalid.

Can you please help me with this. 
Harish
Top achievements
Rank 1
 asked on 13 May 2019
8 answers
225 views

Hello,

I am writing a desktop application using WPF and RadGridView. I need to be able to operate 100% of the application without a mouse (keyboard navigation to every aspect of the application).

 

Is it possible to access column headers via keyboard navigation? If so, how do you do it?

 

Thanks.

Vladimir Stoyanov
Telerik team
 answered on 13 May 2019
3 answers
839 views
I got the following simplified XAML-Snippet:

<telerik:RadToolBar Grid.Row="0">
  <telerik:RadButton>
    <telerik:RadButton.Style>
      <Style TargetType="telerik:RadButton">
        <Style.Triggers>
          <DataTrigger Binding="{Binding Type}"
                       Value="{x:Static data:ReceiverGroupType.Fix}">
            <Setter Property="Visibility"
                    Value="Collapsed"/>
          </DataTrigger>
        </Style.Triggers>
      </Style>
    </telerik:RadButton.Style>
    <telerik:RadButton.Content>
...
  </telerik:RadButton.Content> </telerik:RadButton>
</telerik:RadToolBar>
<
telerik:RadGridView Grid.Row="1"              ...> <telerik:RadGridView.Columns>   ...   </telerik:RadGridView.Columns>   <telerik:RadGridView.Style>   <Style TargetType="telerik:RadGridView">     <Style.Triggers>       <DataTrigger Binding="{Binding Type}"                      Value="{x:Static data:ReceiverGroupType.Fix}">         <Setter Property="Visibility"                   Value="Collapsed"/>         </DataTrigger>       </Style.Triggers>     </Style>   </telerik:RadGridView.Style> </telerik:RadGridView>
The DataTrigger for the GridView works, while the DataTrigger for the Button does not: No matter, what the bound Type property's value is, the button stays visible.
gaurav
Top achievements
Rank 1
 answered on 13 May 2019
2 answers
204 views

Hey,

I'm trying to change the RadSplitButton to have a background image similar to a ImageButton. Is this possible? If so, how?

Thanks

Martin Ivanov
Telerik team
 answered on 13 May 2019
9 answers
258 views
Hi,

I have a RadGridView with many column and in all of them I can filter data using the popup window (see attached gridview.png). In one of the columns, which has integers as data source, when I tick one of the available options it works fine, but when I use the filter "equals to" and I set a number my program crashes (see error.png). It's curious because I noticed that if I first select one of the others filters first ('is greater tham', 'is not equal to', ...) and them select the 'is equals to' it works!

Do you know what can be the problem?
Franciele
Top achievements
Rank 1
 answered on 09 May 2019
1 answer
179 views

Hello, Is there a way to bind the sort index to a property?
For example, we have the following class

public class Foo
{
    public string Name { get; set; }
    public int SortIndex { get; set; }
}

If the user clicks a column header and turns it to ascending order then the the SortIndex of the items should be updated with respect to how it was sorted in the UI.

Thanks!

Jan

Dinko | Tech Support Engineer
Telerik team
 answered on 09 May 2019
1 answer
264 views

UI for WPF 2019.1.220.45, Windows 10 Pro 64, Visual Studio Community 2019 v16.0.3

I'm trying to attach a context menu to a draggable listbox item, and after a great deal of effort, I've finally gotten it to the point where I can right click anywhere on the item (except for when the cursor is over a control with its own context menu, which is desired behavior).  So, this is functioning exactly as I want it to from a UI standpoint.  The problem is that the moment I add a Click property to the menu item in the xaml, the app throws an exception during the construction of the listbox.

Here's the xaml

<UserControl x:Class="MIDIMan.ZWMIDIInPortList"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:MIDIMan"
             xmlns:viewmodel="clr-namespace:MIDIManViewModel;assembly=MIDIManViewModel"
             xmlns:telerikDragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"
             mc:Ignorable="d"
             d:DesignHeight="450" d:DesignWidth="800" BorderBrush="Black" BorderThickness="1">
    <UserControl.Resources>
        <viewmodel:InPortsViewModel x:Key="InPortsViewModel"/>
        <DataTemplate x:Key="InPortListTemplate">
            <Grid HorizontalAlignment="Left">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <CheckBox IsChecked="{Binding IsActive}" />
                <TextBox Grid.Column="1" Text="{Binding PortName}" Width="Auto" BorderBrush="White" />
            </Grid>
        </DataTemplate>
        <Style x:Key="DraggableListBoxItem" TargetType="telerik:RadListBoxItem">
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
            <Setter Property="ContextMenu">
                <Setter.Value>
                    <ContextMenu>
                        <MenuItem Header="Restore port name" Click="MenuItem_Click"/>
                    </ContextMenu>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="30"/>
            <ColumnDefinition Width="65"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Text="Input Ports" HorizontalAlignment="Center"/>
        <TextBlock Grid.Row="1" Grid.Column="0" Text="Active" HorizontalAlignment="Center"/>
        <TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Text="Name" HorizontalAlignment="Center"/>
        <telerik:RadListBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"
                            ItemsSource="{Binding MIDIInPorts, Source={StaticResource InPortsViewModel}}"
                            ItemTemplate="{StaticResource InPortListTemplate}"
                            ItemContainerStyle="{StaticResource DraggableListBoxItem}"
                            HorizontalAlignment="Stretch"
                            Height="Auto">
        <telerik:RadListBox.DragDropBehavior>
                <telerik:ListBoxDragDropBehavior AllowReorder="True" />
            </telerik:RadListBox.DragDropBehavior>
            <telerik:RadListBox.DragVisualProvider>
                <!--<telerik:ScreenshotDragVisualProvider />-->
                <telerik:ListBoxDragVisualProvider/>
            </telerik:RadListBox.DragVisualProvider>
        </telerik:RadListBox>
        <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Center">
            <TextBlock Text="{Binding MIDIInPortCount, Source={StaticResource InPortsViewModel}}" Margin="0,0,5,0"/>
            <TextBlock Text="Ports" />
        </StackPanel>
    </Grid>
</UserControl>

 

I had been trying to put the ContextMenu in the ListBoxItem template, but was having no luck, when I ran across a forum post somewere that suggested putting it in its style instead, and that's what we have here.  You'll find it right about in the middle of the code - just a single MenuItem, "Restore port name".  If I remove the MenuItem altogether, the app runs fine and when I right click on the ListBoxItem, an empty context menu pops up.  If I add the MenuItem with no Click property, the context menu pops up and shows the menu item.  Add the Click property definition and, boom!  Exception thrown.

I'm attaching some pictures that include what the list box looks like and the exception warning and details.

I wanted to use the RadContextMenu, but the app wouldn't build because it only allows ContexMenu at that point.  (Different exception)

Any suggestions as to what I might do to get it working?

Thanks,

Ken

Dilyan Traykov
Telerik team
 answered on 08 May 2019
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?