Telerik Forums
UI for WPF Forum
1 answer
233 views
I am using an MVVM pattern for binding my UI. I am using ICommand's to attach the handlers. I created a "Select All" checkbox in the Header of a GridViewDataColumn, but every time I pass the commandParameter of the SelectAll checkbox itself, it comes up null. 

However, it worked perfectly if I take the EXACT SAME checkbox and move it EITHER completely outside of the RadGridView, or even into a CellTemplate. It appears the binding is occurring before the Header has been created. Or am I just creating a "Select All" completely wrong?

XAML:
<UserControl>
    <UserControl.Resources>
        <c:InfoBaseViewModel x:Key="InfoBaseViewModel2"/>
    </UserControl.Resources>
    <DockPanel Name="InfoDockPanel" DataContext="{StaticResource InfoBaseViewModel2}">
        <telerik:RadGridView x:Name="grdInfo" AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding Path=InfoList}" ShowGroupPanel="False">
  
                <telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn.Header>
  
                        <CheckBox Name="chkAll" CommandParameter="{Binding ElementName=chkAll}" Command="{Binding AllCheckedCommand,Source={StaticResource InfoBaseViewModel2}}" ></CheckBox>
  
                    </telerik:GridViewDataColumn.Header>
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>                          
                            <CheckBox IsChecked="{Binding Path=IsItemSelected, Mode=TwoWay}"></CheckBox>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding FullName}" Header="{Binding Path=ApplicationStrings.FullNameLabel, Source={StaticResource ResourceWrapper}}"></telerik:GridViewDataColumn>
                </telerik:GridViewDataColumn>
  
        </telerik:RadGridView>
    </DockPanel>
</UserControl>

ViewModel command handler:
public ICommand AllCheckedCommand
{
    get { return _allItemsChecked ?? (_allItemsChecked = new RelayCommand(AllCheckedHandler, null)); }
}
 
public void AllCheckedHandler(object sender)
{
    // Always gets to here...
    var chkAll = sender as System.Windows.Controls.CheckBox;
     
    if (chkAll == null)
    {
        // ...but always fails
        Logger.Error("Error binding the 'Select All' checkbox.");
    }
    else
    {
        foreach (var item in InfoList)
        {
            item.IsItemSelected = (bool)chkAll.IsChecked;
        }
        base.OnPropertyChanged("InfoList");
    }
}

Yoan
Telerik team
 answered on 18 Feb 2014
3 answers
171 views
Hello.
How I can set my color for shape in RadDiagramToolbox? I want shapes to be drawn in white in RadDiagramToolbox.
Zarko
Telerik team
 answered on 17 Feb 2014
4 answers
201 views
Hi,

I'm trying to create a window layout with a RadTabControl where the user can dynamically add RadTabItems. This is done MVVM style with a data bound itemssource inside the RadTabControl. Inside the bound items collection are viewmodels which are resolved to views by datatemplates. The views only contain a RadDocking with RadSplitContainer and RadPaneGroup. Now, the user can dynamically add more views of different types which are initialized as ToolWindows. These ToolWindows are created by the RadDocking which is currently selected in the RadTabControl. This makes the ToolWindow somehow depending on the specific RadDocking.

Problem: If the user opens a ToolWindow, changes the selected tab and then wants to dock the ToolWindow into the now selected RadDocking (which is not the parent of the ToolWindow), the ToolWindow docks into the parent RadDocking in the hidden tab. This only works because the RadTabControl has set "IsContentPreserved" to "true". If set to "false", the ToolWindows hide if the parent RadDocking is in a non-selected tabitem.

Workaround attempt: everytime the selected tabitem changes, I can iterate through all ToolWindows, remove the nested panes from their parents and add them to the RadDocking in the now selected tabitem. But the current docking state of the pane is lost in this process. It is docked into the RadDocking and not inside a ToolWindow anymore. I can make the pane float again and even restore the position and size of the ToolWindow that was previously hosting the pane. But...

Two problems with the workaround:
1) The ToolWindows flicker when changing the selected tab. It looks like it is closing and immediately reopening. Is there a better way to move a ToolWindow from one RadDocking to another?
2) What if I have multiple RadPanes docked and tabbed into one ToolWindow in certain way? I would have to move the RadSplitContainer from one RadDocking to another to preserve the complete layout. But RadSplitContainer is not offering a method like "RemoveFromParent"... I'm a little bit stuck here.

The most comfortable solution would be to change the parent of the ToolWindow to another RadDocking, but it doesn't look like this is possible in the current Telerik WPF release...

Thanks for any help in advance!

Regards,
Marcel
Paul
Top achievements
Rank 1
 answered on 17 Feb 2014
3 answers
326 views
Hello,
I was wondering if it is possible to set the RowDetailsVisibilityMode to Collapsed, but then in code set certain rows to show the details. I don't want the user to be able to show the details, but I may at times choose, for instance, row 2 and row 4 to show the details. Is this possible?

Thanks,
Scott
Hristo
Telerik team
 answered on 17 Feb 2014
1 answer
67 views
I have a grid with 2 subgrids. This hierachy is defined in the xaml with the ChildTableDefinitions property. The child grids have
grd.MaxHeight = double.PositiveInfinity;
in order to avoid a clutter of scrollbars. Also row virtualization has been turned off for as well the main grid as the child grids.

Now I'm implementing a refresh operation. During this, I want to reselect the item that was selected before the refresh was started (there is only one item selected in all these grids). I do this by expanding the appropriate rows until I reach the grid with the item to be selected. Then I set that grid's SelectedItem property.

So far so good. Well... For obvious reasons I want to scroll the selected item back into view. When the selected row was in the main grid, I can just perform a
grd.ScrollIntoView(objSel);
with objSel being a refreshed object. But when I do this for a childgrid, nothing happens. I presume because the child grid doesn't have a scrollbar and as far as this grid is concerned, the selected row is in view.

Also when I try
grdMain.ScrollIntoView(objSel);
nothing happens. I guess because objSel is not in the ItemsSource of the main grid (I didn't expect it to work, but I had to try). Also
grd.BringIntoView();
did not work out.

So I wonder what is a correct approach to scroll the selected item of a childgrid into view.

Thanks in advance,
   Herre
Yoan
Telerik team
 answered on 17 Feb 2014
1 answer
153 views
Hello, I'm working on a WPF application that contains several controls, including a RadDiagram. On some RadDiagramShape I applied a style which refer a DataTemplate, defined as follows:

<DataTemplate x:Key="AttributeContentTemplate">
            <Grid>
                <Canvas ClipToBounds="False">
                    <TextBlock  Text="{Binding Name}" 
                               FontWeight="{Binding IsBoldText,Converter={StaticResource FontWeightBooleanConverter}}"
                               FontStyle="{Binding IsItalicText,Converter={StaticResource FontStyleBooleanConverter}}">                       
                    </TextBlock>
                </Canvas>
            </Grid>
        </DataTemplate>

Every binding worked properly until I applied an ApplicationTheme after main form initialization using StyleManager: 

StyleManager.ApplicationTheme = new Windows8Theme();

after that FontWeight and FontStyle bindings won't work, even if I set those bindings in code.

how I can fix it?





Martin Ivanov
Telerik team
 answered on 17 Feb 2014
1 answer
461 views
When double touching on a row the mousedoubleclick event is not fired. Do I have to configure anything to support this scenario?

Also the following error is shown in the output window:

System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Remove'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='61706161'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='System.Windows.Media.Animation.Storyboard'; TargetElement.HashCode='61706161'; TargetElement.Type='System.Windows.Media.Animation.Storyboard'

Best regards,
Roland
Nick
Telerik team
 answered on 17 Feb 2014
1 answer
258 views
Hi,

I have a RadButton inside my Tile. The button fires as expected, however there is a small margin between the tile and the button that I can't seem to get rid of. As a result, clicking the corner of the tile will select it, placing a check mark in the upper right corner. Is there a way to disable this functionality?



Thanks,
Melissa
Melissa
Top achievements
Rank 2
 answered on 14 Feb 2014
1 answer
244 views
I have a gridview on a second tabitem within a tabcontrol, and the column header cannot be binded.

It gives error
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='RadGridTest1.MainWindow', AncestorLevel='1''. BindingExpression:Path=DataContext.Header2; DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')

--
MainWindowViewModel.cs

public class MainWindowViewModel
{
public string Header2
{
get { return "Header 2"; }
}
}

--
MainWindow.xaml

<Window x:Class="RadGridTest1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local="clr-namespace:RadGridTest1"
Title="MainWindow" Height="350" Width="525">
<Window.DataContext>
<local:MainWindowViewModel />
</Window.DataContext>

<Grid>
<TabControl>
<TabItem Header="Tab 1">
</TabItem>

<TabItem Header="Tab 2">
<telerik:RadGridView AutoGenerateColumns="False">

<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn>
<telerik:GridViewDataColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Header2, RelativeSource={RelativeSource AncestorType={x:Type local:MainWindow}}}"/>
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>

</telerik:RadGridView>
</TabItem>
</TabControl>

</Grid>
</Window>

--
MainWindow.xaml.cs

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
Yoan
Telerik team
 answered on 14 Feb 2014
3 answers
236 views
Hello,

I've just found an article explaining how to setup the RadRibbonWindow as main window
http://blogs.telerik.com/blogs/posts/10-05-03/using-radribbonwindow-with-radribbonbar-for-wpf.aspx, is it possible to do a similar thing with the RadWindow control?


Thanks.
Yana
Telerik team
 answered on 14 Feb 2014
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?