Telerik Forums
UI for WPF Forum
0 answers
75 views
Hi,

is it possible to bind raddataform to two or more itemsources?
I have hierarhical treeview with two different object collections, is it posible for dataform to switch between these collections(Itemsources) and use different templates for fields on selecteditem in treeview?

Thanks!
Dmitrijs
Top achievements
Rank 1
 asked on 04 Sep 2012
0 answers
80 views
Hi,
I have an issue with the RADWINDOW when i want to maximise it with the button Maximize, the window doesn't take the full screen mode and the borders disappears(image in attachement) but when i double click on the task bar, it works correctly

below the code i use :
public static void NavigateToModal<T>(OpraViewName name, ParameterizedMessage message = null) where T : UIElement, new()
        {
            _message = message;
  
            object view = null;
            int Width =0, Height =0 ;
  
  
            switch (name)
            {
                case OpraViewName.AboutView:
                    view = new AboutView();
                    Width = 1000;
                    Height = 600;
                    break;
                case OpraViewName.ArticlePickerView:
                    view = new ArticlePickerView();
                    Width = 1000;
                    Height = 600;
                    break;
                case OpraViewName.ArticleLoaderView:
                    view = new ArticleLoaderView();
                    Width =  700;
                    Height = 600;
                    break;
                default:
                    break;
            }
  
             
  
            RadWindow modalWindows = new RadWindow();
            modalWindows.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            modalWindows.MinHeight = Height;
            modalWindows.MinWidth = Width;
            modalWindows.Header = name.GetStringValue();
            modalWindows.Content = view;//The view is the user control i use
            modalWindows.ShowDialog();
             
        }

thanks.
Hicham
Top achievements
Rank 1
 asked on 04 Sep 2012
1 answer
84 views
Hi,
Sometime when i start my project hang with this error. It is possible for you to give me a direction where can be the mistake or how to find it? I use chart control and bind it from the xaml and i am not exactly sure how to find the error.

Please advise.

Regards,
Saykor

System.NullReferenceException was unhandled
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.Chart
  StackTrace:
       at Telerik.Windows.Controls.ChartView.OhlcSeriesBase.OnCategoryBindingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\Series\Categorical\OhlcSeriesBase.cs:line 251
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
       at System.Windows.StyleHelper.ClearTemplateChain(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, List`1 templateChain, FrameworkTemplate oldFrameworkTemplate)
       at System.Windows.StyleHelper.ClearGeneratedSubTree(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, FrameworkTemplate oldFrameworkTemplate)
       at System.Windows.StyleHelper.DoTemplateInvalidations(FrameworkElement feContainer, FrameworkTemplate oldFrameworkTemplate)
       at System.Windows.StyleHelper.UpdateTemplateCache(FrameworkElement fe, FrameworkTemplate oldTemplate, FrameworkTemplate newTemplate, DependencyProperty templateProperty)
       at System.Windows.Controls.ContentPresenter.OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at System.Windows.Controls.ContentPresenter.set_Template(DataTemplate value)
       at System.Windows.Controls.ContentPresenter.OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate newContentTemplate)
       at System.Windows.Controls.ContentPresenter.OnContentTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
       at System.Windows.StyleHelper.InvalidateDependents(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, FrugalStructList`1& dependents, Boolean invalidateOnlyContainer)
       at System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, DependencyPropertyChangedEventArgs changedArgs, Boolean invalidateOnlyContainer, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalMap& propertyTriggersWithActions, Int32 sourceChildIndex)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.TabControl.RadTabControlBase.set_SelectedContentTemplate(DataTemplate value) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.Properties.cs:line 644
       at Telerik.Windows.Controls.RadTabControl.UpdateSelectedContentProperties() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControl.cs:line 365
       at Telerik.Windows.Controls.TabControl.RadTabControlBase.NotifyChildContentChanged() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 102
       at Telerik.Windows.Controls.RadTabItem.OnLoaded(Object sender, RoutedEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabItem.cs:line 423
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.FrameworkElement.OnLoaded(RoutedEventArgs args)
       at MS.Internal.FrameworkObject.OnLoaded(RoutedEventArgs args)
       at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
       at System.Windows.BroadcastEventHelper.BroadcastLoadedSynchronously(DependencyObject rootDO, Boolean isLoaded)
       at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
       at MS.Internal.LoadedOrUnloadedOperation.DoWork()
       at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
       at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at Puma.App.Main() in D:\Projects\VisualStudio2010\Puma\obj\x86\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

Nikolay
Telerik team
 answered on 04 Sep 2012
1 answer
323 views
I have a column that is stored in SQL as a bigint and represents a Timespan duration (ticks). How do I format it to show hours, minutes and seconds.

Thanks
Dimitrina
Telerik team
 answered on 04 Sep 2012
8 answers
254 views
Hi,

I have window with a RadGrid, bound to a collection of products. The Product domain object implements INotifyPropertyChanged and IDataErrorInfo(all my validation rules resides within my domain objects).

Problem : When I change a field and tab out, the validation rule fails. This works fine, but my radgridcell renders multiple red borders(adorners) within the cell.

I looked at the online sample code. When I remove the IDataErrorInfo from my domain object, and implement the CellValiding event on my window code behind, this issue seems to be resolved. I dont like this option, because I want my validation logic in my domain.

How do I solve the above mentioned issues. Is it possible to style my gridrow, gridcells to hide some of the inner borders?

Regards
Kumar
Top achievements
Rank 1
 answered on 04 Sep 2012
1 answer
708 views
Hello!
How to set RadGridView RowStyle property programmatically, from code behind?

My case is to change style of all grid rows, even after conect new data source, to new style, dynamicly while using my application.
Kind regards,
Nick
Telerik team
 answered on 04 Sep 2012
1 answer
153 views
Hi,

i would like to realize a scenario with multiple levels of hierarchy as shown in the little sketch in the attachment.
Some facts:
 - multiple levels of hierarchy possible (but not the same depth for all categories)
 - ColumnHeaders (of item) only once at the top of the grid
 - Category-Rows should show some aggregated values
 
I tried the nested grid feature but it has some major drawbacks:
 - ColumnHeader of categories
 - New ColumnHeader for every child grid

Furthermore i tried the grouping feature, but this didn't work as well, AFAIK because:
 - Grouping has to be explicit for all items and not "recursive" as needed in my scenario

Is there any possiblity I could achieve the structure in the attachment with the GridView or any other control (maybe TreeListView!?)

Many thanks in advance,

René 
Nick
Telerik team
 answered on 04 Sep 2012
2 answers
117 views
Hi,

I've created a new object that derives from Appointment (named RequestAppointment) and overrides the "End" property (I've made sure to include OnPropertyChange("End") in it's set accessor). When I change this value I would expect the appointment on my ScheduleView to update, and when I breakpoint the code it steps through the set accessor then the get accessor is called and the "End" property value being returned is what I expect, yet it does not reflect in my ScheduleView.

I am bound to a collection of RequestAppointment objects in a viewmodel (xaml: AppointmentsSource="{Binding Appointments}"). Can I check with you that the end date of an appointment in ScheduleView is indeed bound to the "End" property of the appointment object and if I change "End" and raise property-changed on it I should expect the ScheduleView to update?

Thanks
Peter
Top achievements
Rank 1
 answered on 04 Sep 2012
3 answers
63 views
I have been given a task to make a control for project that needs to function like a movie editor control. I need to be able to do the following:
  1. Add events to the timeline via drag and drop. Events being added will be of a specified type.
  2. Adjust the time that the event is ongoing for
  3. Detect when an event overlaps and move it to the next line where applicable
  4. Click on an event and open a editor
  5. Shade portions of the timeline to correspond to portions of a scenario. I would like for the user to be able to adjust the durations of the phase via click and drag.

My first thought was to use the gnatt control and adjust the axis and have each task be the type of event that the user can do.Unfortunately the gnatt chart does not support multiple items for a single task so that will not work. Are there any controls in the suite that could support most of this functionality?

Thanks!
Ivo
Telerik team
 answered on 03 Sep 2012
5 answers
116 views
I'm building a timesheet application.  The timesheet periods are variable in length.  If the timesheet is for the first half of the month (1st through the 15th), then there are 15 date columns.  If it's for the second half of the month, then there could be 13 - 16 date columns, depending on what month it is and if it is a leap year.

Because the column header's are kind of complex, I'm choosing to pre-populate the GridView's columns with 16 date columns in xaml, then depending on what month it is etc., I delete n columns.  

The problem is that when I delete a column, it messes up my footer for the last column which is a total column.

It's probably easiest to understand if you see it in action.  To that end, I've created a very simplified version, with the code pasted below.  Just load it up, then press the Delete Column button.  You'll see what I mean.

xaml:
<Window x:Class="NMTimesheetUI.GridTest"
        Title="GridTest" Height="300" Width="600">
    <StackPanel Margin="10">
        <Button HorizontalAlignment="Right" Content="Delete Column" x:Name="btnDeleteColumn" Margin="0,0,0,10" Click="btnDeleteColumn_Click" />
        <telerik:RadGridView x:Name="gvTest" CanUserSortColumns="False" ShowColumnFooters="True" RowIndicatorVisibility="Visible" IsFilteringAllowed="False"
                             CanUserFreezeColumns="False" ShowInsertRow="False" AllowDrop="False" AutoGenerateColumns="False" CanUserDeleteRows="True" CanUserInsertRows="False"
                             CanUserResizeColumns="True" CanUserReorderColumns="False" GridLinesVisibility="Both" ShowGroupPanel="False" ShowColumnHeaders="True">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding jobName}" Width="110*" HeaderTextAlignment="Center" />
 
                <telerik:GridViewDataColumn Header="Mon" DataMemberBinding="{Binding hours1, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Width="40" HeaderTextAlignment="Center">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
 
                <telerik:GridViewDataColumn Header="Tue" DataMemberBinding="{Binding hours2, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Width="40" HeaderTextAlignment="Center">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
 
                <telerik:GridViewDataColumn Header="Wed" DataMemberBinding="{Binding hours3, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Width="40" HeaderTextAlignment="Center">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
 
                <telerik:GridViewDataColumn Header="Thu" DataMemberBinding="{Binding hours4, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Width="40" HeaderTextAlignment="Center">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
 
                <telerik:GridViewDataColumn Header="Fri" DataMemberBinding="{Binding hours5, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Width="40" HeaderTextAlignment="Center">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
 
                <telerik:GridViewDataColumn Header="Sat" DataMemberBinding="{Binding hours6, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Width="40" HeaderTextAlignment="Center">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
 
                <telerik:GridViewDataColumn Header="Sun" DataMemberBinding="{Binding hours7, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Width="40" HeaderTextAlignment="Center">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
 
                <telerik:GridViewDataColumn Header="Total" DataMemberBinding="{Binding totalHours, Mode=OneWay}">
                 
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction Caption="" SourceField="totalHours" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
 
 
                </telerik:GridViewDataColumn>
                 
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </StackPanel>
</Window>

code:
using System;
using System.Collections.Generic;
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.Shapes;
 
namespace NMTimesheetUI
{
    /// <summary>
    /// Interaction logic for GridTest.xaml
    /// </summary>
    public partial class GridTest : Window
    {
        public GridTest()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(GridTest_Loaded);
        }
 
        void GridTest_Loaded(object sender, RoutedEventArgs e)
        {
            List<GridEntry> entries = GridEntry.getEntries();
            gvTest.ItemsSource = entries;
        }
 
        private void btnDeleteColumn_Click(object sender, RoutedEventArgs e)
        {
            int lastColumnIndex = gvTest.Columns.Count - 2;
            gvTest.Columns.RemoveAt(lastColumnIndex);
        }
    }
 
    public class GridEntry
    {
        #region Members
 
        public string jobName { get; set; }
        public decimal hours1 { get; set; }
        public decimal hours2 { get; set; }
        public decimal hours3 { get; set; }
        public decimal hours4 { get; set; }
        public decimal hours5 { get; set; }
        public decimal hours6 { get; set; }
        public decimal hours7 { get; set; }
 
        public decimal totalHours
        {
            get
            {
                return hours1 + hours2 + hours3 + hours4 + hours5 + hours6 + hours7;
            }
        }
 
        #endregion
 
        #region static Members
 
        public static List<GridEntry> getEntries()
        {
            List<GridEntry> entries = new List<GridEntry>();
            GridEntry john = new GridEntry {
                jobName = "John Lennon",
                hours1 = 1, hours2 = 2, hours3 = 3, hours4 = 4, hours5 = 5, hours6 = 0, hours7 = 0
            };
            entries.Add(john);
 
            GridEntry george = new GridEntry
            {
                jobName = "George Harrison",
                hours1 = 1,
                hours2 = 2,
                hours3 = 3,
                hours4 = 4,
                hours5 = 5,
                hours6 = 0,
                hours7 = 0
            };
            entries.Add(george);
 
 
            GridEntry paul = new GridEntry
            {
                jobName = "Paul McCartney",
                hours1 = 1,
                hours2 = 2,
                hours3 = 3,
                hours4 = 4,
                hours5 = 5,
                hours6 = 0,
                hours7 = 0
            };
            entries.Add(paul);
 
            GridEntry ringo = new GridEntry
            {
                jobName = "Ringo Starr",
                hours1 = 1,
                hours2 = 2,
                hours3 = 3,
                hours4 = 4,
                hours5 = 5,
                hours6 = 0,
                hours7 = 0
            };
            entries.Add(ringo);
 
 
            return entries;
        }
 
        #endregion
 
 
    }
}

Thanks!

Aaron
Yoan
Telerik team
 answered on 03 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?