Telerik Forums
UI for WPF Forum
4 answers
787 views
I have a RadGrid nested within another grid.  During the DataLoading event for the main outer grid, I have setup a RowLoaded event.  In this event, the click event for the checkboxes in the inner grid are wired to the appropriate method.  However, when I run the project the click event will not fire.  Any suggestions will be greatly appreciated.  Thank you.

<Window x:Class="FSPUpgradeServer.MainScreen"
        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:fsp="clr-namespace:HarlandFS.FSP.Controls;assembly=FSPControls"
        Title="MainScreen"
        Height="500"
        Width="615">
    <Window.Resources>
        <Style TargetType="{x:Type telerik:GridViewRow}">
            <EventSetter Event="GotFocus"
                         Handler="GridViewRow_GotFocus"/>
        </Style>

    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="80*" />
            <ColumnDefinition Width="80*" />
            <ColumnDefinition Width="80*" />
            <ColumnDefinition Width="254*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="268*" />
            <RowDefinition Height="27*" />
            <RowDefinition Height="167*" />
        </Grid.RowDefinitions>
        <telerik:RadGridView Name="grdSystems"
                             AutoGenerateColumns="False"
                             IsFilteringAllowed="False"
                             ShowGroupPanel="False"
                             Grid.ColumnSpan="4"
                             Loaded="grdSystems_Loaded"
                             DataLoading="grdSystems_DataLoading">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Width="Auto"
                                            Header="Upgrade"
                                            IsReorderable="False"
                                            UniqueName="Upgrade">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox Click="CheckBox_Click">
                            </CheckBox>
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Width="Auto"
                                            Header="System Name"
                                            IsReadOnly="True"
                                            IsReorderable="False"
                                            UniqueName="SystemName" />
                <telerik:GridViewDataColumn Width="Auto"
                                            Header="# of Accts"
                                            IsReadOnly="True"
                                            IsReorderable="False"
                                            UniqueName="NumberOfAccounts"
                                            TextAlignment="Right" />
                <telerik:GridViewDataColumn Width="Auto"
                                            Header="# of Terminals"
                                            IsReadOnly="True"
                                            IsReorderable="False"
                                            UniqueName="NumberOfTerminals"
                                            TextAlignment="Right" />
                <telerik:GridViewDataColumn Width="Auto"
                                            Header="# of msgs sent"
                                            IsReadOnly="True"
                                            IsReorderable="False"
                                            UniqueName="NumberOfMsgSent"
                                            TextAlignment="Right" />
                <telerik:GridViewDataColumn Width="Auto"
                                            Header="# msgs received"
                                            IsReadOnly="True"
                                            IsReorderable="False"
                                            TextAlignment="Right" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <Button Name="btnAdd"
                Grid.Row="1"
                Click="btnAdd_Click">_Add</Button>
        <Button Name="btnEdit"
                Grid.Row="1"
                Grid.Column="1"
                Click="btnEdit_Click">_Edit</Button>
        <Button Name="btnDelete"
                Grid.Row="1"
                Grid.Column="2"
                Click="btnDelete_Click">_Delete</Button>
        <GroupBox Grid.Row="2"
                  Grid.ColumnSpan="4">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="27*" />
                    <RowDefinition Height="27*" />
                    <RowDefinition Height="27*" />
                    <RowDefinition Height="27*" />
                    <RowDefinition Height="27*" />
                    <RowDefinition Height="27*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="133*" />
                    <ColumnDefinition Width="100*" />
                    <ColumnDefinition Width="133*" />
                    <ColumnDefinition Width="100*" />
                </Grid.ColumnDefinitions>
                <Label VerticalAlignment="Center">File Location</Label>
                <fsp:FSPTextBox Name="txtClientLocation"
                                Grid.Column="1"
                                Margin="2"
                                LostFocus="txtClientLocation_LostFocus"
                                IsRequired="True"
                                Text=".\FSP.msi"
                                Grid.ColumnSpan="2" />
                <Button Name="btnBrowse"
                        Grid.Column="3"
                        Click="btnBrowse_Click"
                        Margin="2">_Browse</Button>
                <Label Grid.Row="1"
                       VerticalAlignment="Center">Host Location</Label>
                <fsp:FSPTextBox Name="txtHostLocation"
                                Grid.Row="1"
                                Grid.Column="1"
                                Margin="2"
                                IsRequired="True"
                                Grid.ColumnSpan="2" />
                <Label Grid.Row="2"
                       VerticalAlignment="Center">Version Number</Label>
                <fsp:FSPTextBox Name="txtVersion"
                                Grid.Row="2"
                                Grid.Column="1"
                                Margin="2"
                                IsRequired="True" />
                <Label Grid.Row="2"
                       Grid.Column="2"
                       VerticalAlignment="Center">Messages to send</Label>
                <fsp:FSPTextBox Name="txtMessages"
                                Grid.Row="2"
                                Grid.Column="3"
                                Margin="2"
                                IsRequired="True"
                                DataType="Integer" />
                <Label Grid.Row="3"
                       VerticalAlignment="Center">Time Interval(Minutes)</Label>
                <fsp:FSPTextBox Name="txtTimeInterval"
                                Grid.Row="3"
                                Grid.Column="1"
                                Margin="2"
                                IsRequired="True"
                                DataType="Integer" />
                <Button Name="btnStart"
                        Grid.Row="3"
                        Grid.Column="3"
                        Click="btnStart_Click">_Start</Button>
                <Label Name="lblStatus"
                       Grid.Row="4"
                       Grid.ColumnSpan="4"
                       HorizontalAlignment="Center" VerticalAlignment="Center"/>
                <ProgressBar Name="prgStatus"
                             Grid.Row="5"
                             Grid.ColumnSpan="4"
                             Margin="2" />
            </Grid>
        </GroupBox>
    </Grid>
</Window>

        public MainScreen()
        {
            InitializeComponent();

            messageTimer.Tick += new EventHandler(messageTimer_Tick);

            try
            {
                using (FileStream fs = new FileStream("FSPUpgradeAccounts.xml", FileMode.Open))
                {
                    SoapFormatter bf = new SoapFormatter();
                    ArrayList serializableList = bf.Deserialize(fs) as ArrayList;
                    //_AccountList = new ObservableCollection<FSPAccount>();

                    foreach (object item in serializableList)
                    {
                        FSPAccount addAccount = item as FSPAccount;
                        addAccount.GetTerminalList();
                        AccountList.Add(addAccount);
                    }
                }
            }
            catch
            {
            }
            //var detailDefinition = new Telerik.Windows.Controls.GridViewTableDefinition();
            //detailDefinition.Relation = new Telerik.Windows.Data.PropertyRelation("Terminals");
            //grdAccounts.TableDefinition.ChildTableDefinitions.Add(detailDefinition);
            //grdAccounts.ItemsSource = AccountList;
            var detailDefinition = new Telerik.Windows.Controls.GridViewTableDefinition();
            detailDefinition.Relation = new Telerik.Windows.Data.PropertyRelation("Accounts");
            grdSystems.TableDefinition.ChildTableDefinitions.Add(detailDefinition);
            grdSystems.ItemsSource = SystemList;
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
        }

        private void grdSystems_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            var dataControl = (GridViewDataControl)sender;
            if (dataControl.ParentRow != null && dataControl.ChildTableDefinitions.Count == 0)
            {
                ObservableCollection<FSPAccount> account;
                try
                {
                    account = (ObservableCollection<FSPAccount>)e.ItemsSource;
                }
                catch
                {
                    //TODO:  Look for a better way to do this?
                    account = null;
                }
                if (account != null)
                {
                    //Setup relation to the Terminals sub grid
                    var detailDefinition = new Telerik.Windows.Controls.GridViewTableDefinition();
                    detailDefinition.Relation = new Telerik.Windows.Data.PropertyRelation("Terminals");

                    //Create the columns for the Accounts "sub grid"
                    GridViewDataColumn column = new GridViewDataColumn();
                    column.UniqueName = "Upgrade";
                    GridViewCell cell = new GridViewCell();
                    
                    dataControl.Columns.Add(column);
                    column = new GridViewDataColumn();
                    column.UniqueName = "Name";
                    column.IsReadOnly = true;
                    dataControl.Columns.Add(column);
                    column = new GridViewDataColumn();
                    column.UniqueName = "TotalTerminals";
                    column.Header = "Number of Terminals";
                    column.IsReadOnly = true;
                    dataControl.Columns.Add(column);
                    column = new GridViewDataColumn();
                    column.UniqueName = "SentTerminals";
                    column.Header = "#Sent";
                    column.IsReadOnly = true;
                    dataControl.Columns.Add(column);
                    column = new GridViewDataColumn();
                    column.UniqueName = "ReceivedTerminals";
                    column.Header = "#Received";
                    column.IsReadOnly = true;
                    dataControl.Columns.Add(column);
                    
                    //Set some properties on the Accounts sub grid
                    dataControl.ChildTableDefinitions.Add(detailDefinition);
                    dataControl.AutoGenerateColumns = false;
                    dataControl.ShowGroupPanel = false;
                    dataControl.IsFilteringAllowed = false;
                    dataControl.RowLoaded += new EventHandler<RowLoadedEventArgs>(dataControl_RowLoaded);
                    accountGridList.Add(dataControl);
                }
                else
                {
                    //Create columns for the Terminals sub grid
                    GridViewDataColumn column = new GridViewDataColumn();
                    column.UniqueName = "Name";
                    column.IsReadOnly = true;
                    dataControl.Columns.Add(column);
                    column = new GridViewDataColumn();
                    column.UniqueName = "IsMessageSent";
                    column.Header = "Message Sent";
                    column.IsReadOnly = true;
                    dataControl.Columns.Add(column);
                    //dataControl.ChildTableDefinitions.Add(detailDefinition);

                    //Set some properties on the Terminals sub grid
                    dataControl.AutoGenerateColumns = false;
                    dataControl.ShowGroupPanel = false;
                    dataControl.IsFilteringAllowed = false;
                }
                //grdSystems.Rebind();
            }
        }

        void dataControl_RowLoaded(object sender, RowLoadedEventArgs e)
        {
            if (e.Row is GridViewRow)
            {
                GridViewDataControl grid = (GridViewDataControl)sender;
                CheckBox chk = (CheckBox)e.Row.Cells[0].Content;
                chk.Click += new RoutedEventHandler(UpgradeAccount_Click);
            }
        }

        void UpgradeAccount_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("in Click");
        }
Ryan Bandouveres
Top achievements
Rank 1
 answered on 05 Apr 2011
1 answer
191 views
Hi,

I want to set a transition effect ( for example SlideAndZoomTransition or MotionBlurredZoomTransition) and the SlideDirection Attribute in my RadTransitionControl dinamically using the C# in the code behind.
this is what i have actually in the xaml:

 

 

 

<telerik:RadTransitionControl x:Name="transitionRight" Grid.RowSpan="3" Grid.Column ="1" >

 

<telerik:RadTransitionControl.Transition >

 

<effects:SlideAndZoomTransition SlideDirection ="RightToLeft"/>

 

</telerik:RadTransitionControl.Transition >

 

 

</telerik:RadTransitionControl >

 

 

 

 



i want to change the effect and slide direction attr. when a click a button.
its Posible to do this?

Gretings
Yana
Telerik team
 answered on 05 Apr 2011
3 answers
144 views
I get the following error at runtime
Cannot find type 'Telerik.Windows.Controls.RadTreeView'. The assembly used when compiling might be different than that used when loading and the type is missing.  Error at object 'System.Windows.Controls.Grid' in markup file

I am using the following Telerik dlls which I have added to my project references
Telerik.Windows.Controls - 2010.3.1110.35
Telerik.Windows.Controls.Data - 2010.3.1110.35
Telerik.Windows.Controls.Navigation - 2010.3.1110.35

Format Code Block(

 

 

<

 

UserControl x:Class="AOS.UI.Windows.Controls.Widget.acWidgets"

 

 

 

 

 

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

 

 

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

xmlns:VMCommanding="clr-namespace:VMCommanding"

 

 

 

 

 

 

 

 

xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

 

 

 

xmlns:vm="clr-namespace:AOS.UI.Windows.Controls.Widget.ViewModel"

 

 

 

 

 

 

 

 

Height="300" Width="300"

 

 

 

xmlns:Core="clr-namespace:AOS.UI.Windows.Controls.Core;assembly=AOS.UI.Windows.Controls.Core"

 

 

 

 

 

 

 

 

VMCommanding:CommandSinkBinding.CommandSink="{Binding}">

 

 

 

 

 

 

<UserControl.CommandBindings>

 

 

 

 

 

 

 

 

 

<VMCommanding:CommandSinkBinding Command="vm:WidgetViewModel.NavigateItemCommand" />

 

 

 

 

 

 

 

 

 

</UserControl.CommandBindings>

 

 

 

 

 

 

 

 

 

 

 

<UserControl.Resources>

 

 

 

 

 

 

 

 

 

<HierarchicalDataTemplate x:Key="NavigationTemplate"

 

 

 

ItemsSource="{Binding Path=WidgetList}">

 

 

 

 

 

 

 

 

 

<Grid Margin="1">

 

 

 

 

 

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

 

 

 

 

 

<ColumnDefinition Width="16" />

 

 

 

 

 

 

 

 

 

<ColumnDefinition Width="*" />

 

 

 

 

 

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

 

 

 

 

 

<Image Grid.Column="0" Source="{Binding Path=Icon_Name}"></Image>

 

 

 

 

 

 

 

 

 

<Core:CommandTextBlock Grid.Column="1" Margin="1"

 

 

 

Text="{Binding Path=Description}"

 

 

 

 

 

 

 

 

Command="vm:WidgetViewModel.NavigateItemCommand"

 

 

 

CommandParameter="{Binding}"/>

 

 

 

 

 

 

 

 

 

 

 

</Grid>

 

 

 

 

 

 

 

 

 

</HierarchicalDataTemplate>

 

 

 

 

 

 

 

 

 

</UserControl.Resources>

 

 

 

 

 

 

 

 

 

<Grid>

 

 

 

 

 

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

 

 

 

 

 

<RowDefinition Height="55" />

 

 

 

 

 

 

 

 

 

<RowDefinition Height="*" />

 

 

 

 

 

 

 

 

 

<RowDefinition Height="30" />

 

 

 

 

 

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

 

 

 

 

 

 

 

<telerik:RadTreeView Grid.Row="2" ItemsSource="{Binding WidgetList}" ItemTemplate="{StaticResource NavigationTemplate}" />

 

 

 

 

 

 

 

 

 

 

 

</Grid>

 

 

 

 

 

 

 

</

 

UserControl>

 

)
Petar Mladenov
Telerik team
 answered on 05 Apr 2011
1 answer
274 views
Hi,

My data hierarchy has a single root node. It is always single and always the same.
Is it possible just to hide it and show only items starting from the second level?

Testrash.
Petar Mladenov
Telerik team
 answered on 05 Apr 2011
2 answers
126 views
As mentioned in a previous post I have a hierarchical gridview. On the child gridview I'm using the following binding to propogate selecteditem back up to the parent:
SelectedItem="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=telerik:RadGridView, AncestorLevel=1}, Path=SelectedItem, Mode=TwoWay}"

This seems to work in almost every case, except when I click on the first row in one of the child gridviews. For some reason this doesn't seem to change the SelectedItem as I would expect.
Andrew
Top achievements
Rank 1
 answered on 05 Apr 2011
5 answers
306 views
Using a hierarchy view similar to the Custom Hierarchy demo, I want to allow the user to select only a single row of data (regardless of what tier that data is at). Further, I want to be able to bind to the currently selected row. I saw the demo on how to do this with a single-tier gridview which seems to get me halfway there - I just need to further extend that to the children as well.
Andrew
Top achievements
Rank 1
 answered on 05 Apr 2011
1 answer
632 views
Hi at all .
 
I am working with Wpf RadGridWiew and would like to save data to database with a MVVM command where i receive my modified item placed in my VIEWMODEL automatically every time that i change one row of data.

How can i do so ?

Best regards

Maya
Telerik team
 answered on 05 Apr 2011
3 answers
307 views
Hi,

In your WPF GridView demo, First Look, if you expand a few rows, then choose a tab other than the first, when you scroll the GridView so that the row goes out of view and then you scroll it to reappear, the tab changes to the first one and there is a noticeable delay and jump of the scroll thumb.

I was creating a very similar arrangement and I'd like to know if there's a way to stop this behavior so that the selected tab remains constant while scrolling.

Thanks,

SP
Petar Mladenov
Telerik team
 answered on 05 Apr 2011
1 answer
122 views
Hi, I am using the tileview control that will bound to items at runtime.
When the tileview contains explicit tileitems like  shown below I am able to maximize / minimize the tiles and also have a scrool bar as expected.

<telerik:RadTileView Name="radTileView1" MinimizedRowHeight="200" MinimizedColumnWidth ="200" >

 

 

<telerik:RadTileViewItem></telerik:RadTileViewItem>

 

 

 

<telerik:RadTileViewItem></telerik:RadTileViewItem>

 

 

 

<telerik:RadTileViewItem></telerik:RadTileViewItem>

 

 

 

<telerik:RadTileViewItem></telerik:RadTileViewItem>

 

 

 

<telerik:RadTileViewItem></telerik:RadTileViewItem>

 

 

 

<telerik:RadTileViewItem></telerik:RadTileViewItem>

 

 

 

</telerik:RadTileView>

However , when I bind the tileview to using itemsource to a List of items like shown below, I am unable to maximize, minimize the tiles. What am I doing wrong ?

 

 

 

 

<telerik:RadTileView Name="radTileView1" ItemsSource="{Binding}"

 

 

 

 

MinimizedRowHeight="200" MinimizedColumnWidth ="200" >

 

 

 

 

 

</telerik:RadTileView>

Note: The user control that houses the tileview control has it's data context set to the list .The tileview does show the correct number of tiles corresponding to the number of items in the list, but does not let me maximize or minimize.

 

Zarko
Telerik team
 answered on 05 Apr 2011
2 answers
114 views
I develop some application and use RadRibbonbar with RadRibbonWindow.

I add RadDocking Window to the application.
It is okay in Windows 7's Aero Theme,
but if I change the theme to Windows classic theme, the application is just crushed..

it doesn't have any problem when I use RadDocking window and Default WPF Window together,
but with RadRibbonWindow, it happens.

I guess it cause using RadDocking and RadRibbonWindow together in Windows7's Classic Theme..
Is there any solution to resovle that?? Please help.
sangyun
Top achievements
Rank 1
 answered on 05 Apr 2011
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
InlineAIAssistant
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?