This is a migrated thread and some comments may be shown as answers.

GridViewToggleRowDetailsColumn doesn't work

4 Answers 163 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 06 Jan 2012, 11:21 PM
Hi,

I'm using VS2008 and Telerik 2011.3.1220.35 and with one of my RadGridView I have a problem :(

The second column of my grid view is a GridViewToggleRowDetailsColumn and when I click on the plus sign, my application fall in an infinite loop and I receive the following message:

Here is my XAML RadGridView definition:

<telerik:RadGridView Height="Auto" Width="Auto" x:Name="RadGridViewBilling" RowLoaded="RadGridView_RowLoaded" Margin="5 0 5 5" Visibility="Visible"  RowDetailsVisibilityMode="Collapsed"
        RowIndicatorVisibility="Collapsed" IsReadOnly="True" AutoGenerateColumns="False" CanUserFreezeColumns="False" Grid.Row="2"
        CanUserResizeColumns="False" SelectionMode="Extended" ShowColumnFooters="True" SelectionChanged="RadGridViewBilling_SelectionChanged">

            <telerik:RadGridView.RowStyle>
                <Style TargetType="telerik:GridViewRow">
                    <Setter Property="MinHeight" Value="40"/>
                </Style>
            </telerik:RadGridView.RowStyle>
            <telerik:RadGridView.Columns>
                <telerik:GridViewSelectColumn />
                <telerik:GridViewToggleRowDetailsColumn />
                <telerik:GridViewDataColumn Header="No" DataMemberBinding="{Binding Number}" IsGroupable="False" IsFilterable="False"/>
                <telerik:GridViewDataColumn Header="Role T" DataMemberBinding="{Binding RoleTech}" IsGroupable="False" IsFilterable="False" TextAlignment="Right" DataFormatString = "{}{0:c2}" />
                <telerik:GridViewDataColumn Header="Role P" DataMemberBinding="{Binding RoleProf}" IsGroupable="False" IsFilterable="False" TextAlignment="Right" DataFormatString = "{}{0:c2}" />
                <telerik:GridViewDataColumn Header="Montant soumis ($)" DataMemberBinding="{Binding AmountSubmitted}" >                   
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="Somme: " ResultFormatString="{}{0:c2}" SourceField="AmountSubmitted"/>
                    </telerik:GridViewDataColumn.AggregateFunctions>                   
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Patient" DataMemberBinding="{Binding PatientName}"/>
                <telerik:GridViewDataColumn Header="Erreur courante" DataMemberBinding="{Binding ErrorDescription}" Background="#A0FF0000"/>
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>
                    <telerik:RadTabControl  x:Name="RadTabControl1"  BackgroundVisibility="Collapsed" Margin="10" VerticalAlignment="Center" Background="Transparent">
                        <telerik:RadTabItem Header="Transactions" DataContext="{Binding}" Height="24" Foreground="Black">
                            <telerik:RadGridView Height="Auto" Width="Auto" x:Name="RadGridViewTransactions" ItemsSource="{Binding Transactions}" AutoGenerateColumns="False"
                       CanUserFreezeColumns="False" BorderThickness="0" CanUserResizeColumns="False"
                       ShowGroupPanel="False"
                       Margin="0">

                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn Header="No" DataMemberBinding="{Binding Sequence}" IsGroupable="False" IsFilterable="False" />
                                    <telerik:GridViewDataColumn Header="Date" DataMemberBinding="{Binding CreationTime, Converter={StaticResource DConverter}}" />
                                    <telerik:GridViewDataColumn Header="Heure" DataMemberBinding="{Binding CreationTime, Converter={StaticResource TConverter}}" IsFilterable="False" IsGroupable="False"/>
                                    <telerik:GridViewDataColumn Header="Type" DataMemberBinding="{Binding TransactionType}"  />
                                    <telerik:GridViewDataColumn Header="Montant" DataMemberBinding="{Binding Amount}" TextAlignment="Right" DataFormatString = "{}{0:c2}" IsReadOnly="True" />
                                    <telerik:GridViewDataColumn Header="Balance" DataMemberBinding="{Binding Balance}" TextAlignment="Right" DataFormatString = "{}{0:c2}" IsReadOnly="True" />
                                    <telerik:GridViewDataColumn Header="Commentaire" DataMemberBinding="{Binding Comment}" Width="250" />
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>
                        </telerik:RadTabItem>

                        <telerik:RadTabItem Header="Visite" DataContext="{Binding}" Margin="5 0 0 0" Height="24" Foreground="Black">
                            <Grid Width="Auto" HorizontalAlignment="Stretch">
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Patient PHN:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="0" Grid.Column="0" />
                                <telerik:RadMaskedTextBox x:Name="VisitPatientPHN" Value="{Binding PHN}" EmptyContent="Entrer patient PHN" MaskType="None" ValueChanged="RadMaskedTextBox_ValueChanged"  Margin="5" Grid.Row="0" Grid.Column="1"/>
                                <TextBlock Text="Nom:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="1" Grid.Column="0" />
                                <telerik:RadMaskedTextBox x:Name="VisitPatientName" Value="{Binding PatientName}" EmptyContent="Entrez nom patient" MaskType="None" ValueChanged="RadMaskedTextBox_ValueChanged"  Margin="5" Grid.Row="1" Grid.Column="1"/>
                                <TextBlock Text="Province:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="2" Grid.Column="0" />
                                <TextBox Text="{Binding PatientProvince}" Margin="5" Grid.Row="2" Grid.Column="1" />
                                <TextBlock Text="Date visite:" TextAlignment="Right" Margin="5" FontWeight="Bold"  Grid.Row="0" Grid.Column="3" />
                                <telerik:RadDatePicker x:Name="FromTimePicker" Margin="5" IsTooltipEnabled="False" SelectionChanged="FromTimePicker_SelectionChanged" DateTimeWatermarkContent="VisitDate" SelectedValue="{Binding VisitDate, Mode=TwoWay}" Grid.Row="0" Grid.Column="4" />
                                <TextBlock Text="Code diag:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="1" Grid.Column="3" />
                                <TextBox Text="{Binding DiagCode}" Margin="5" Grid.Row="1" Grid.Column="4" />
                                <TextBlock Text="Code exam:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="2" Grid.Column="3" />
                                <TextBox Text="{Binding ExamCode}" Margin="5" Grid.Row="2" Grid.Column="4" />
                                <TextBlock Text="Mnt soumis:" TextAlignment="Right" Margin="5" FontWeight="Bold" Grid.Row="3" Grid.Column="3" />
                                <telerik:RadMaskedTextBox x:Name="VisitAmountSubmitted" MaskType="Numeric" Mask="c" Value="{Binding AmountSubmitted}" EmptyContent="Entrer montant" Background="White" ValueChanged="RadMaskedTextBox_ValueChanged" Margin="5" Grid.Row="3" Grid.Column="4"/>
                                <TextBlock Text="Commentaire:" TextAlignment="Left" Margin="5" FontWeight="Bold" Grid.Row="4" Grid.Column="0" />
                                <TextBox Text="{Binding Comment}" Margin="5" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" />
                            </Grid>
                        </telerik:RadTabItem>

                        <telerik:RadTabItem Header="Rapport d'erreurs" DataContext="{Binding}" Height="24"
                                HorizontalContentAlignment="Stretch" HorizontalAlignment="Left">

                            <telerik:RadGridView Height="Auto" Width="Auto" x:Name="RadGridViewErrorReportElements" ItemsSource="{Binding ErrorReportElements}" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False"
               CanUserFreezeColumns="False" BorderThickness="0" CanUserResizeColumns="False"
               ShowGroupPanel="False"
               Margin="0">

                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn Header="Nom fichier" DataMemberBinding="{Binding ReceivedFileName}" />
                                    <telerik:GridViewDataColumn Header="Date" DataMemberBinding="{Binding CreationTime, Converter={StaticResource DConverter}}" />
                                    <telerik:GridViewDataColumn Header="Heure" DataMemberBinding="{Binding CreationTime, Converter={StaticResource TConverter}}" IsFilterable="False" IsGroupable="False"/>
                                    <telerik:GridViewDataColumn Header="Message d'erreur" DataMemberBinding="{Binding ErrorMessage}" Width="250" />
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>

                        </telerik:RadTabItem>

                        <telerik:RadTabItem Header="E.C." DataContext="{Binding}" Margin="5 0 0 0" Height="24" HorizontalContentAlignment="Stretch" HorizontalAlignment="Left">

                            <telerik:RadGridView Height="Auto" Width="Auto" x:Name="RadGridViewRemittanceAdvicetElements" ItemsSource="{Binding RemittanceAdvicetElements}" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False"
               CanUserFreezeColumns="False" BorderThickness="0" CanUserResizeColumns="False"
               ShowGroupPanel="False"
               Margin="0">

                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn Header="Nom fichier" DataMemberBinding="{Binding ReceivedFileName}" />
                                    <telerik:GridViewDataColumn Header="Date" DataMemberBinding="{Binding CreationTime, Converter={StaticResource DConverter}}" />
                                    <telerik:GridViewDataColumn Header="Heure" DataMemberBinding="{Binding CreationTime, Converter={StaticResource TConverter}}" IsFilterable="False" IsGroupable="False"/>
                                    <telerik:GridViewDataColumn Header="Montant soumis" DataMemberBinding="{Binding AmountSubmitted}" TextAlignment="Right" DataFormatString = "{}{0:c2}" IsReadOnly="True" />
                                    <telerik:GridViewDataColumn Header="Montant payé" DataMemberBinding="{Binding AmountPaid}" TextAlignment="Right" DataFormatString = "{}{0:c2}" IsReadOnly="True" />
                                    <telerik:GridViewDataColumn Header="Message d'erreur" DataMemberBinding="{Binding ErrorMessage}" Width="250" />
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>
                        </telerik:RadTabItem>

                        <telerik:RadTabItem Header="Factures reliées " DataContext="{Binding}" Margin="5 0 0 0" Height="24" HorizontalContentAlignment="Stretch" HorizontalAlignment="Left">
                            <telerik:RadGridView Height="Auto" Width="Auto" x:Name="RadGridViewR" ItemsSource="{Binding RelatedBills}" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False"
               CanUserFreezeColumns="False" BorderThickness="0" CanUserResizeColumns="False"
               ShowGroupPanel="False"
               Margin="0">
                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn Header="No" DataMemberBinding="{Binding Number}" IsGroupable="False" IsFilterable="False" />
                                    <telerik:GridViewDataColumn Header="Montant soumis ($)" TextAlignment="Right" DataMemberBinding="{Binding AmountSubmitted}" />
                                    <telerik:GridViewDataColumn Header="Patient" DataMemberBinding="{Binding PatientName}"/>
                                    <telerik:GridViewDataColumn Header="Erreur courante" DataMemberBinding="{Binding ErrorDescription}" Width="250"/>
                                </telerik:RadGridView.Columns>
                            </telerik:RadGridView>
                        </telerik:RadTabItem>

                    </telerik:RadTabControl>
                </DataTemplate>
            </telerik:RadGridView.RowDetailsTemplate>

        </telerik:RadGridView>


Here is my error message:
2012-01-06 17:14:37,737;[5876];ERROR;MNGUI016;System.InvalidOperationException: Les vues inter-dépendantes ont provoqué une boucle infinie.
   à System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   à System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   à System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   à System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   à System.Windows.Threading.DispatcherOperation.InvokeImpl()
   à System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   à System.Threading.ExecutionContext.runTryCode(Object userData)
   à System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   à System.Windows.Threading.DispatcherOperation.Invoke()
   à System.Windows.Threading.Dispatcher.ProcessQueue()
   à System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   à System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   à System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   à System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   à System.Windows.Window.ShowHelper(Object booleanBox)
   à System.Windows.Window.Show()
   à System.Windows.Window.ShowDialog()
   à Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(Boolean isModal)
   à Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean isModal)
   à Telerik.Windows.Controls.RadWindow.ShowDialog()
   à com.christiegrp.Neuron.ClientApplication.BillingModule.StartFunction()
   à com.christiegrp.Neuron.ClientApplication.MainGui.listView_ItemActivate(Object sender, EventArgs e) dans D:\Developpement\GestX.Courant\RisGC\Client\Neuron\MainGui.cs:ligne 1031

Thank's

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 09 Jan 2012, 07:21 AM
Hello Oliver,

I have tried to get the same exception as the one you described, but without any success. Is there anything more specific that you do in your application ? How do you handle RowLoaded event ? Are there any relevant events that you subscribe to during which you execute a particular logic ? 
Generally, any relevant information and code-snippet would be helpful.

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Oliver
Top achievements
Rank 1
answered on 09 Jan 2012, 03:44 PM
Hi,

as far as I remembered, with an older version of Telerik, this issue was not present.

Here is all my UserControl, I putted all the logic in comment into the RowLoaded event:

 

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Globalization;
using Telerik.Windows;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.Charting;
using Telerik.Windows.Controls.GridView;

using com.christiegrp.Neuron.Client;
using com.ChristieGrp.Localisation;

namespace com.christiegrp.Neuron.ClientApplication
{
    /// <summary>
    /// Interaction logic for BillingGrid.xaml
    /// </summary>
    public partial class BillingGrid : UserControl
    {
        #region Contructors.
        static BillingGrid()
        {
            DatesSelectionTextProperty = DependencyProperty.Register("DatesSelectionText", typeof(string), typeof(BillingGrid));
        }

        public BillingGrid(NeuronDataSource pDataSource, string pTitle, bool pPrivateBilling)
        {
            InitializeComponent();
            mDataSource = pDataSource;           
            mDatesSelection = new DatesSelection();
            Title.Text = pTitle;

            if (pPrivateBilling)
            {
                textBlockRebill.Text = LocGeneral.GetControlText("StatementOfAccount");
            }

            radBusyIndicator.BusyContent = LocGeneral.GetControlText("InProgressMessage");
        }
        #endregion

        #region Private events.
        /// <summary>
        /// Change UI language.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReplaceLanguageResources(object sender, EventArgs e)
        {
            Localisation.SetUILanguage(this, "BillingGrid", mDataSource);
        }

        /// <summary>
        /// When the UserControl is unloaded we have to do some stuff.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UserControl_Unloaded(object sender, RoutedEventArgs e)
        {
        }

        /// <summary>
        /// Ask for a range of dates.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void radButtonDatesRange_Click(object sender, RoutedEventArgs e)
        {
            DatesSelectorForm datesRng = new DatesSelectorForm(mDataSource, null, null, DateTime.MinValue, DateTime.MaxValue, ref mDatesSelection);

            datesRng.ShowDialog();

            if (datesRng.DialogResult.HasValue && datesRng.DialogResult.Value)
            {
                DatesSelectionText = mDatesSelection.SelectionShortText;
                radBusyIndicator.IsBusy = true;
                try
                {
                }
                finally
                {
                    radBusyIndicator.IsBusy = false;
                }
            }
        }

        /// <summary>
        /// Trigger a data refresh to the server.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void radButtonRefresh_Click(object sender, RoutedEventArgs e)
        {
            radBusyIndicator.IsBusy = true;
            try
            {
            }
            finally
            {
                radBusyIndicator.IsBusy = false;
            }
        }

        /// <summary>
        /// Clear selection dates range.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void radButtonUndoDatesRange_Click(object sender, RoutedEventArgs e)
        {
            mDatesSelection.SelectedDates.Clear();
            DatesSelectionText = mDatesSelection.SelectionShortText;
        }
        #endregion

        #region Public properties.
        public string DatesSelectionText
        {
            get { return (string)GetValue(DatesSelectionTextProperty); }
            set { SetValue(DatesSelectionTextProperty, value); }
        }
        #endregion

        #region Dependency properties.
        static public readonly DependencyProperty DatesSelectionTextProperty;
        #endregion

        #region Private declarations.
        private NeuronDataSource mDataSource;
        private bool mFirstItemExpanded = false;
        private DateTime? mMinSelectedDate = null;
        private DateTime? mMaxSelectedDate = null;
        private IList<DateTime> mSelectedDates = null;       
        private DatesSelection mDatesSelection;
        #endregion

        private void RadGridView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            //if (!mFirstItemExpanded && e.Row is GridViewRow)
            //{
            //    GridViewRow row = e.Row as GridViewRow;
            //    UIBill bill = e.Row.DataContext as UIBill;

            //    if (row != null && bill != null && RadGridViewBilling.Items.IndexOf(bill) == 0)
            //    {
            //        row.DetailsVisibility = Visibility.Visible;
            //        mFirstItemExpanded = true;
            //    }
            //}
        }

        private void RadMaskedTextBox_ValueChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            RadMaskedTextBox maskedTextBox = sender as RadMaskedTextBox;

            if (maskedTextBox != null)
            {
                if (maskedTextBox.Tag == null)
                {
                    maskedTextBox.Tag = "InitDone";
                }
                else
                {
                    maskedTextBox.Tag = "Changed";
                    SolidColorBrush myBrush = new SolidColorBrush(Colors.LightBlue);
                    maskedTextBox.Background = myBrush;
                }
            }
        }

        private void FromTimePicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RadDateTimePicker dateTimePicker = sender as RadDateTimePicker;

            if (dateTimePicker != null)
            {
                if (dateTimePicker.Tag == null)
                {
                    dateTimePicker.Tag = "InitDone";
                }
                else
                {
                    dateTimePicker.Tag = "Changed";
                    SolidColorBrush myBrush = new SolidColorBrush(Colors.LightBlue);
                    dateTimePicker.Background = myBrush;
                }
            }
        }

        /// <summary>
        /// Patient file access.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void radButtonPatientFile_Click(object sender, RoutedEventArgs e)
        {
            PatientFileForm patientFile = new PatientFileForm(mDataSource, Guid.Empty, true);
            patientFile.ShowDialog();
        }

        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            string action = string.Empty;

            RadButton button = sender as RadButton;
            if (button != null)
            {
                action = button.Content.ToString();
            }

            ObservableCollection<Object> selectedItems = RadGridViewBilling.SelectedItems;
            List<string> billNumbers = new List<string>();

            foreach (var item in selectedItems)
            {
                UIBill bill = item as UIBill;
                if (bill != null)
                {
                    billNumbers.Add(bill.Number);
                }
            }
            string list = string.Join(", ", billNumbers.ToArray());

            ClientUtilities.ConfirmDialog(this, string.Empty, string.Format("XXXDésirez-vous {0} les numéros de factures: {1}?", action, list));
        }

        private void OnDialogClosed(object sender, WindowClosedEventArgs e)
        {
            if (e.DialogResult == true)
            {
                ClientUtilities.AlertDialog(this, string.Empty, "XXXOpération completée!");               
            }
        }

        private void RadGridViewBilling_SelectionChanged(object sender, SelectionChangeEventArgs e)
        {           
            if (GridSelectionChanged != null)
            {
                GridSelectionChanged(sender, e);
            }
        }

        #region Public declarations.             
        public event EventHandler<Telerik.Windows.Controls.SelectionChangeEventArgs> GridSelectionChanged;
        #endregion
    }
}

And here is the code I implement in my main application to use my UserControl:

                BillingGrid billingGrid = new BillingGrid(mDataSource, btn.Text, btn.Text == dict["BillIssuedToReBillAndConc"].ToString());
                billingGrid.GridSelectionChanged += new EventHandler<Telerik.Windows.Controls.SelectionChangeEventArgs>(BillingGridSelectionChanged);
                billingGrid.RadGridViewBilling.ItemsSource = Bills;
                (radTabControlDepartments.Items[radTabControlDepartments.SelectedIndex] as RadTabItem).Content = billingGrid;

        private void BillingGridSelectionChanged(object sender, SelectionChangeEventArgs e)
        {
            displayMessageInPanel(MessagePanel.Second, "Items sélectionnés: " + (sender as RadGridView).SelectedItems.Count.ToString());
        }

        private void displayMessageInPanel(MessagePanel pPanel, string pMessage)
        {
            switch (pPanel)
            {
                case MessagePanel.First:
                                          statusBarItem1.Content = pMessage;
                                          break;
                case MessagePanel.Second:
                                          statusBarItem2.Content = pMessage;
                                          break;
                case MessagePanel.Third:
                                          statusBarItem3.Content = pMessage;
                                          break;
            }

            radRibbonBar.Title = pMessage;
        }

0
Maya
Telerik team
answered on 12 Jan 2012, 04:14 PM
Hello Oliver,

Could you take a look at the sample attached and let me know whether you can get the same behavior and exception on it ? Am I missing something ? Are there any additional steps that I need to follow in order to get the expection ?  


Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Oliver
Top achievements
Rank 1
answered on 17 Jan 2012, 02:54 PM
Hi Maya,

your sample work, I have to investigate more :(

Thank's
Tags
GridView
Asked by
Oliver
Top achievements
Rank 1
Answers by
Maya
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or