Telerik Forums
UI for WPF Forum
3 answers
129 views
Can I hide Saturday's and Sunday's and only show M-F? In all views (Maybe not month view)?
Rod
Yana
Telerik team
 answered on 12 Aug 2011
5 answers
484 views
Hi,

i am having a (maybe?) simple question. In our framework, we have a custom control derivation for each telerik control we use. This works pretty good, but sometimes i have problems to set the theme of the nested controls within such a derivation. One of these problematic cases is the ComboBox. The Vista theme is assigned via Generic.xaml:

<Style TargetType="{x:Type data:ComboBox}" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:VistaTheme, ElementType=telerik:RadComboBox}}">
        <Setter Property="Height" Value="23"></Setter>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{x:Type telerik:RadComboBoxItem}" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:VistaTheme, ElementType=telerik:RadComboBoxItem}}">
                </Style>
            </Setter.Value>
        </Setter>
    </Style>

In the code file, we force the usage of the new theme:

Shared Sub New()
 
    ' Connect new template
    DefaultStyleKeyProperty.OverrideMetadata(GetType(ComboBox), New FrameworkPropertyMetadata(GetType(ComboBox)))
 
End Sub
Protected Overrides Sub OnInitialized(ByVal e As System.EventArgs)
 
    ' Call base class method
    MyBase.OnInitialized(e)
 
    ' Ensure template
    Me.DefaultStyleKey = GetType(ComboBox)
 
End Sub

This works good. The ComboBox and the items are using the Vista theme. But now, i want the Box to be editable. The TextBox, the Button and the ScrollViewer are still using the default theme. How can i archive, that the named controls use the Vista theme? I want to define that in the Generic.xaml.

I hope you can help me. Styling and templating are not my favourite tasks ;-)

Greeting from germany, Carsten
Konstantina
Telerik team
 answered on 12 Aug 2011
1 answer
123 views
When going into design mode of my ApplicationResource.xaml file, I see the following error come up. Everything seems to compile fine but my outlinging expansion and intellisense no longer works in the xaml file. Wondering if this has to do with the load error. Here is the stack trace...

System.IO.FileLoadException

Could not load file or assembly 'Telerik.Windows.Controls, Version=2011.2.808.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.VsReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.CachingReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.Microsoft.Windows.Design.Metadata.IReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at MS.Internal.Metadata.ClrAssembly.GetRuntimeMetadata(Object reflectionMetadata) at Microsoft.Windows.Design.Metadata.AttributeTableContainer.<MergeAttributesIterator>d__c.MoveNext() at Microsoft.Windows.Design.Metadata.AttributeTableContainer.GetAttributes(Assembly assembly, Type attributeType, Func`2 reflectionMapper) at MS.Internal.Metadata.ClrAssembly.GetAttributes(ITypeMetadata attributeType) at MS.Internal.Design.Metadata.Xaml.XamlAssembly.get_XmlNamespaceCompatibilityMappings() at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata sourceAssembly) at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensions.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata source) at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption() at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier) at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context) at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean visitCodeModel) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem() at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem() at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState() at MS.Internal.Host.PersistenceSubsystem.Load() at MS.Internal.Host.Designer.Load() at MS.Internal.Designer.VSDesigner.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView(Boolean isReload)

System.NotSupportedException

An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.


Vanya Pavlova
Telerik team
 answered on 12 Aug 2011
2 answers
150 views
I am binding the grid view to a data table via ItemsSource. Everything is OK, however, the changes to the data source don't go only through the grid user interface, but may happen also by making programatic changes directly to the data source. For example a menu option may go trough some data table fields and change their values, or may add new rows to the data table. In that case I want the grid to be notified about the changes in those affected areas and redraw itself to show the changes. However, I cannot find any method that would sound like "Redraw" or "Invalidate". There is a method Rebind which actually does the job and which I am using, however, why do I want to rebind the entire grid if I am changing only one field? I want to redraw its corresponding cell only rather than rebinding the entire grid.
Is there any method, or a subscription to an event, where I can have the grid redraw specified areas.
Any code samples?
Thank you,
Cezar Mart

P.S. I investigated it in the meantime, and I learned I need to implement INotifyCollectionChanged in my DataTable.
Great, I did this way:
public class MyDataTable : DataTable, INotifyCollectionChanged
{

  protected override void OnRowChanged ( DataRowChangeEventArgs e )
  {
   base.OnRowChanged(e);
   if ( e.Action == DataRowAction.Add )
   {
    if ( CollectionChanged != null )
    {
     CollectionChanged ( this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add) );
    }
   }
  }

  public event NotifyCollectionChangedEventHandler CollectionChanged;


}

and later in the code:
MyDataTable tb = new MyDataTable();
grid.ItemSource = tb; // grid is of type RadGridView

Then I programatically add a new row to my data table and the OnRowChanged is invoked. Great, however, the CollectionChanged handler is always null, so it looks the grid is not listening to this event. How do I make listen?

Thanks
ESA
Top achievements
Rank 1
 answered on 11 Aug 2011
1 answer
101 views

Hello

 

Is there, somewhere in the doc or on Internet, examples of projects with the OutlookBar?

 

And, by the way, examples of the other rad tools?

 

Thanks

 

Richard

 

Richard
Top achievements
Rank 1
 answered on 11 Aug 2011
9 answers
702 views
Hello,

I have added a GridViewComboBoxColumn to my RadGridView but it takes three clicks to expose the actual dropdown to make a selection. I've looked at this thread but my bindings are not showing any data. Is there anything new or updated that allows a combo box to be embedded in a RadGridView column, the thread was from 2009. The other problem I had was that there was no SelectionChanged event on the GridViewComboBoxColumn. I found a work around for that issue but the selection changed would fire before the combo box had even dropped down it's selections and the user made a physical change. With this approach is it possible to use the RadComboBox SelectionChanged event?

What I'm looking for is a combo box inside the grid that is immediately available for change and that raises an event if it is changed. I don't like having to click three times to expose and change a combo box value.

Binding is as follows:
ctrlStatus.ItemsSource = _statusList;  Where _statusList is a List<string>

<telerik:GridViewComboBoxColumn Header="Status" x:Name="ctrlStatus" ItemsSource="{Binding Port}"   DataMemberBinding="{Binding Status,Mode=TwoWay}" DisplayMemberPath="Status" Width="auto" IsFilterable="False" SelectedValueMemberPath="Status">
  <telerik:GridViewComboBoxColumn.CellTemplate>
    <DataTemplate>
      <StackPanel>
        <telerik:RadComboBox x:Name="ctrlStatus" ItemsSource="{Binding Port}" DisplayMemberPath="Status" Width="auto" IsFilteringEnabled="False" SelectedValuePath="Status" SelectedValue="{Binding Status}"/>
      </StackPanel>
    </DataTemplate>
  </telerik:GridViewComboBoxColumn.CellTemplate>
</telerik:GridViewComboBoxColumn>


G
Pavel Pavlov
Telerik team
 answered on 11 Aug 2011
2 answers
147 views
My date picker is bound to a DateTime field, but on the UI, the control allows the user to "delete" the value. This causes the validation to throw an error "Value '' cannot be converted". Is there any way to set the control to the current datetime when the user "deletes" the date in the box?

I'm also having this trouble with a bound combobox that doesn't allow null values. I want the user to be able to type in to select a value, but that means they can also remove the value (which causes the same error).
Boyan
Telerik team
 answered on 11 Aug 2011
10 answers
325 views
Hello,

I'm doing a small project and just upgraded to the latest version of WPF telerik control. In my project I had some drag and drop between grid and listbox. Pretty much the same as the one in the demo (http://demos.telerik.com/silverlight/#DragAndDrop/TreeToGrid) this one but the wpf version. I used to be able to drag my item from the list without any problem but now it just doesn't work. The new WPF demo does not seem to work too.

Any ideas to what is wrong?

thank you very much
Ronald
Top achievements
Rank 1
 answered on 11 Aug 2011
7 answers
349 views
Hi,

I want some columns show hyperlink, and I found GridViewHyperlinkColumn and GridViewDataColumn in RadGridView.

My question is how to include them into RadGridView dynamically base on custom logic?

for example, when the grid load first time only col1, col3 and col 5 need to display as hyperlink, but when same grid load second time, maybe col2, col5 and col8 need to display hyperlink, not col1 and col3.

Thanks.


Gaurang
Top achievements
Rank 1
 answered on 11 Aug 2011
1 answer
150 views

Dear support team,

we're using your Chart control to display several charts in our WPF application and have massive problems with its performance. I'd like to describe the application design and hope you have an idea how we can improve the applications performance.

There is a TabControl with two tab items and in each of those are two charts. Only one chart is visible at any time, each chart contains two line series. The charts show measurement values which are reported every 100 milliseconds. These values are buffered and added to a ObservableCollection every second (actually just an implementation of IList and the notify interfaces to get the collection thread-safe). This collection is binded to the chart (MVVM). A measurement will take between one or two minutes, so there will be something around 1000 values for each chart.

You can find a screen shot of the application at http://dl.dropbox.com/u/36135015/telerik%20forum/chart%20performance/GuiScreen.png

At the beginning of a measurement switching tabs or the visibility in each tab is possible without any delays but the more values we're adding to the charts, the longer the delay is getting. After some time the application gets unusable as the UI thread is busy wile drawing(?) the chart. Important to mention: the target system is an embedded Windows 7 system with an Intel Atom CPU N270 (1,6GHz) and 1GB of RAM. Nevertheless, the delays can be noticed at our development system, too (Intel i5 2,67GHz, 8GB RAM).

We took some advices of the support center or common wpf advices like buffering values, changing the control template, using VirtualizingStackPanel but there's no remarkable difference.

Why is the chart getting so slow (in my opinion the drawing can't be that expensive) and are there other possibilities to fasten it up?

I made a small demo project that uses a tab control to show four charts and fill them with data each 100 milliseconds. You'll notice that after something around 20-30 seconds the tab item changes will get remarkable slower. You can find it here: http://dl.dropbox.com/u/36135015/telerik%20forum/chart%20performance/ChartPerformance.Demo.zip

Sincerly yours,
Matthias

Yavor
Telerik team
 answered on 11 Aug 2011
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
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
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?