Telerik Forums
UI for WPF Forum
1 answer
294 views
Hi,

I have a categorical 2D bar chart where I would like the bars to be a specific width (about 20) or at least minwidth 20 for the bars. Then I want the chart so expand it's width in case there are a lot of bars or categories. Basically take the space it needs.

Right now it seems like even if I don't set a width or only a min width the chart tries to cramp everything together instead of just expanding its width.

So the question is, how do i do that?

This is my current template:
<ControlTemplate TargetType="telerik:Bar"
   <Canvas> 
      <Rectangle x:Name="PART_DefiningGeometry" 
                 Height="{TemplateBinding ItemActualHeight}" 
                 RadiusX="2" 
                 RadiusY="2" 
                 Stroke="Transparent" 
                 StrokeThickness="1" 
                 MinWidth="20" 
                 Style="{TemplateBinding ItemStyle}" /> 
   </Canvas> 
</ControlTemplate> 

I attached a image that shows how it looks at the moment.
Vladimir Milev
Telerik team
 answered on 07 Oct 2009
1 answer
112 views
Take the FirstLook example of the TileView.

Remove the height/width attributes and set Margin to 0, effectively making the height and width dynamic.
(To test you'll also need to set the LayoutRoot's margin to 0)

Run that, and the images are suddenly out of control, and the performance seems to plummet.
Tihomir Petkov
Telerik team
 answered on 07 Oct 2009
1 answer
139 views

HI,

Just wondering if there is a way to change the weekday view by letting a week starting from Wednesday and ending on Tuesday.

Thanks,

Kevin

Valeri Hristov
Telerik team
 answered on 06 Oct 2009
2 answers
249 views
hello, i am using  gridview with mvvm pattern and binding
i use columns like this to build my grid:

<telerik:GridViewColumn IsSortable="False" HeaderText="Amount"
                        <telerik:GridViewColumn.CellStyle> 
                            <Style TargetType="telerik:GridViewCell"
                                <Setter Property="Template"
                                    <Setter.Value> 
                                        <ControlTemplate TargetType="telerik:GridViewCell"
                                            <StackPanel> 
                                                <TextBox PreviewKeyDown="TextBox_PreviewKeyDown" HorizontalAlignment="Stretch" 
                                                         Margin="3" VerticalAlignment="Center" 
                                                         Text="{Binding Path=Amount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox> 
                                            </StackPanel> 
                                        </ControlTemplate> 
                                    </Setter.Value> 
                                </Setter> 
                            </Style> 
                        </telerik:GridViewColumn.CellStyle> 
                    </telerik:GridViewColumn> 


the problem is i can´t set tab index to my controls (textboxes), i want to press tab and move to my textbox, how can i do so?
when i press tab i get focus in the cell not in my textbox

matias
Top achievements
Rank 1
 answered on 06 Oct 2009
1 answer
102 views
I would like to create a parent grid that will contain all of the columns for a multi-use table but where I can derive/inherit from it depending on the circumstance (I did not create this table so please don't suggest that it should be normalized).  For example, My table contains fields labeled "Field1" to "Fieldx". Field1 for one record may mean something completely different for Field1 of a different record and this is usually designated by a particular company. So, I would like to create one parent grid with the ability to perform CRUD operations on this table but "inherit" the xaml so I can change the columnar header names and eventually lookup lists based on the company being used.

I have been researching this topic for most of the day but have yet to find the "right" solution. There are many possibilities but I would like advice in advance on the best path to take so I don't go down any rabbit trails.

1. One possibility that I found was to put the grid in a user control and then inherit the user control. However, this was criticized because either it doesn't allow the user to edit the columns of the child user control at design time or it created reference issues within the encapsulated user control.

2. Another possibility was to subclass Telerik's gridview but that seems like overkill and I believe there has to be something easier.

3. Another idea is to create a content template. I don't know much about content templates and don't know if learning and implimenting this idea would be a waste of time.

Thank You in advance.
Stefan Dobrev
Telerik team
 answered on 06 Oct 2009
13 answers
237 views
Hi,
  Are there any plans to do a Ribbon as found in MS Office 2007?
Cheers,

Michael
andrea bellagamba
Top achievements
Rank 1
 answered on 06 Oct 2009
5 answers
119 views
Hello,

We've been seeing a couple of errors popping up with the Grid. One of them says something like "Count must be positive and count must refer to a location within the string/array/collection.  Parameter name : count." And another is about the "Index must be within range"...

I don't have steps to reproduce the issue; it seems to happen randomly, but when we do get the error, it's usually on load of the grid. Then we can reload and everything is fine until it happens again. It has happened during sort operations also.

Laura
Vlad
Telerik team
 answered on 06 Oct 2009
1 answer
99 views
Hi,

I have a grid bound to a DataTable (cannot use Observable collection of custom objects), when I add or delete a row from the dataTable instance the grid is not refreshed, which is kind of expected.  But the problem is when I force a grid refresh, the only way I found to accomplish that was doing something like this:

myGrid.ItemsSource = null
myGrid.ItemsSource = samplesDataTable

This is extremely expensive.  Is there a more convinient and less expensive way to refresh the grid rows?

Thanks,
Marco


Milan
Telerik team
 answered on 06 Oct 2009
7 answers
285 views
I'm getting the following exception when I try to set the ShowButtons property of the RadNumericUpDown to false

Cannot animate the 'Visibility' property on a 'System.Windows.Controls.Grid' using a 'System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames'. For details see the inner exception.

Here's the full exception
System.Windows.Media.Animation.AnimationException was unhandled
  Message="Cannot animate the 'Visibility' property on a 'System.Windows.Controls.Grid' using a 'System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames'. For details see the inner exception."
  Source="PresentationCore"
  StackTrace:
       at System.Windows.Media.Animation.AnimationStorage.OnCurrentTimeInvalidated(Object sender, EventArgs args)
       at System.Windows.Media.Animation.Clock.FireEvent(EventPrivateKey key)
       at System.Windows.Media.Animation.Clock.RaiseAccumulatedEvents()
       at System.Windows.Media.Animation.TimeManager.RaiseEnqueuedEvents()
       at System.Windows.Media.Animation.TimeManager.Tick()
       at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       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.Application.RunInternal(Window window)
       at Shell.App.Main() in D:\V\Code\Production\Sizing\Shell\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.InvalidOperationException
       Message="The animation(s) applied to the 'Visibility' property calculate a current value of 'Collapsed', which is not a valid value for the property."
       Source="PresentationCore"
       StackTrace:
            at System.Windows.Media.Animation.AnimationStorage.GetCurrentPropertyValue(AnimationStorage storage, DependencyObject d, DependencyProperty dp, PropertyMetadata metadata, Object baseValue)
            at System.Windows.Media.Animation.AnimationStorage.OnCurrentTimeInvalidated(Object sender, EventArgs args)
       InnerException: 

and here's the XAML that I'm using for the control

        <telerik:RadNumericUpDown Grid.Column="1" 
                                  x:Name="inpPMax" Style="{StaticResource InputNumbers}" 
                                  ValueFormat="Numeric" NumberFormatInfo="{Binding Path=DisplayFormat}" 
                                  ShowButtons="False" 
                                  IsEnabled="{Binding Path=UserEntered}" 
                                  Minimum="{Binding Path=Minimum}" Maximum="{Binding Path=Maximum}" 
                                  SmallChange="1" LargeChange="10" GotFocus="inpPMax_GotFocus"
            <telerik:RadNumericUpDown.Value> 
                <Binding Path="DisplayValue"  Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True"/> 
            </telerik:RadNumericUpDown.Value> 
        </telerik:RadNumericUpDown> 
 
 
            <Style x:Key="InputNumbers" TargetType="{x:Type telerik:RadNumericUpDown}"
                <Setter Property="Height" Value="25"/> 
                <Setter Property="FontSize" Value="12"/> 
                <Setter Property="Margin" Value="2"/> 
                <Setter Property="HorizontalContentAlignment" Value="Right"/> 
            </Style> 

this exception only occurs when the view becomes active.  Meaning I only see the exception when the tab that holds these RadNumericUpDown controls has been activated.


thanks

Josh
Hristo Borisov
Telerik team
 answered on 05 Oct 2009
2 answers
143 views
I would like to change the style of the toolbar, however when editing the style or controltemplate in Blend it forces me to "Create New".  I would prefer to "Edit Existing" so that I can start with the existing template to ensure I am providing all the necessary control parts.  Do you have any suggestions, or can you send me a default style for the toolBar to work with?

Thank you!
Ivan
Telerik team
 answered on 05 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?