.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

WPF ComboBox Style/Template example from MSDN doesnt work if "IsEnabled"=false?

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :WPF
 

Hello!

I am using a customized look of the WPF combobox control with the help of the msdn Style and Combox Template example taken from here: http://msdn.microsoft.com/en-us/library/ms752094.aspx

I copied that code and I can use the control just fine, but as soon as you set the combobox attribute "IsEnabled" to false, you always get an error warning in Visual Studio 2010 Designer view with the following message:

'System.Windows.Media.Animation.ColorAnimationUsingKeyFrames' animation object cannot be used to animate property 'Foreground' because it is of incompatible type 'System.Windows.Media.Brush'.

Actually I have no idea on how to fix this error. Does anyone have an idea what is causing this error? Since its an msdn example everyone should encounter this error when disabling the control with this template example?

Thanks in advance for your help, kind regards,
Oliver




View Complete Post


More Related Resource Links

WPF ComboBox Style/Template example from MSDN "IsEnabled"=false gives designer warning/error in VS20

  

Hello!

I am using a customized look of the WPF combobox control with the help of the msdn Style and Combox Template example taken from here: http://msdn.microsoft.com/en-us/library/ms752094.aspx

I copied that code and I can use the control just fine, but as soon as you set the combobox attribute "IsEnabled" (within the xaml) to false, you always get an error/warning in Visual Studio 2010 Designer view with the following message:

'System.Windows.Media.Animation.ColorAnimationUsingKeyFrames' animation object cannot be used to animate property 'Foreground' because it is of incompatible type 'System.Windows.Media.Brush'.

Actually I have no idea on how to fix this error - though I can run and compile the code fine. Does anyone have an idea what is causing this error? Since its an msdn example everyone should encounter this error when disabling the control with this template example?

Thanks in advance for your help, kind regards,
Oliver


C++ at Work: Addin a Combobox Cancel Feature

  

This month Paul DiLascia codes some Microsoft Office-style dialog box features.

Paul DiLascia

MSDN Magazine August 2006


Is it possible to change the title bar background and the font style on default template?

  

Hello,

Is there any way to change the default top link /title bar picture and the fonts of the title without breaking anything in the layout/structure?

I have changed the theme to Obsedian and I would also like to change the picture of the title bar of this theme and also the font/style of the title, top link bar, menus..etc. Is there a way to do this?

Please note: I am using WSS 3.0 and I am not the Administrator of the sharepoint. I am only the site admin of some sites on this sharepoint. I can do some basic customization using SPD.

Basically, what I am trying to do is that I want to set up a sharepoint site, however I want to make it NOT look like a sharepoint site.Well I know this is possible, but for my case it might be just partially possible due to the limitation that I am not the Site collection admin and hence I do not have direct access to the server itself.

What I want is to hide most of the sharepoint links/menus/bars, etc and use my own buttons/hyperlinks etc .. for user to navigate on the sites.

Thanks in advance for your help/advices.

Regards

Rooven


In a style template, express a property in terms of the controls properties it is applied to.

  
Hello,   In the style template below, which works fine, I'd like to express the "Points" property in terms of the applied to controls "Width" and "Height" properties.  As you see, the "Fill" property is expressed in terms of the "Background" property the template is applied to by means of Fill="{TemplateBinding Background}".  The following does not work:   Points="0,({TemplateBinding Height} / 4)  ({TemplateBinding Width} / 12.5),({TemplateBinding Height} / 4) . . ."   Is what I'm looking for possible, all in XAML, no code/converters? <Style x:Key="FolderButton" TargetType="Button"> <Setter Property="Margin" Value="2.5" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Polygon Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" Points="0,5 4,5 6,0 23,0 25,5 50,5 50,20 0,20"/> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> </Grid> </ControlTemplate>

Accessing Combobox inside WPF Datagrid Template Column

  
Hi, I am creating a WPF datagrid template column with combobox. The problem that I face now is, I am not able to bind a table to the combobox inside the WPF datagrid template column. Here is the code snippet. <dg:DataGrid x:Name="Students" AutoGenerateColumns="False" Loaded="OnLoad"> <dg:DataGrid.Columns> <dg:DataGridTextColumn Binding="{Binding Path=Name}" Header="Name" Width="75"/> <dg:DataGridTemplateColumn x:Name="Dept"> <dg:DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox x:Name="DeptId" ItemsSource="{Binding}" SelectionChanged="Dept_SelectionChanged" DisplayMemberPath="{Binding Path=DeptName}" SelectedValuePath="{Binding Path=DeptId}" SelectedItem="{Binding Path=Belongs}"/> </DataTemplate> </dg:DataGridTemplateColumn.CellTemplate> </dg:DataGridTemplateColumn> </dg:DataGrid.Columns> </dg:DataGrid> Please help me to find out the way to assign a dynamic source to the combobox through code behind file. Thanks in Advance!!! Best Regards, Subalakshmi Vijayarajan.

SharePoint workflow Enable WorkflowModification doesnt work

  
Hi   I'm trying to enable WorkflowModification in a sequential workflow in VS Studio 2008 according to the *** of examples of microsoft but When I run my workflow I get this error: 09/14/2010 10:24:35.78  w3wp.exe (0x11FC)                        0x13A8 Windows SharePoint Services    Workflow Infrastructure        88xr Unexpected WinWF Internal Error, terminating workflow Id# 74f4bd77-7aaa-407e-90ac-f56a6184bc21  09/14/2010 10:24:35.78  w3wp.exe (0x11FC)                        0x13A8 Windows SharePoint Services    Workflow Infrastructure        98d4 Unexpected System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SharePoint.SPException: Error in the application.     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.EnableWorkflowModification(Guid modificationId, String contextData)     --- End of inner exception stack trace ---     at System.RuntimeMethodHandle._InvokeMe

Gridview Template...not overriding CSS style?

  
I have a web application that has a CSS file for all the style in the web application.  I just added a gridview to the page, and I chose one of the predefined templates.  But the template specifications don't show up, instead my CSS styles do (for example, table background).  How can I override the CSS styles and show the actual template styles for the gridview?Thanks in advance. :)

DataGridView ComboBox visual style differs for same app on different systems

  

Issue:

In a windows forms application developed with VB2008 Express the DataGridView ComboBox is rendered differently on different systems. 

Details:

On Windows XP Pro SP3, where the app was developed, the combo box appears as follows:

Well, apparently images can't be pasted to these threads so I'll have to try to describe the appearance.

Appearance in Windows XP:

Rectangular box with the same shape, color and appearance as a DataGridView TextBox except that it has a square drop-down button at it's right edge the same color as a ToolStrip or ScrollBar buttons/elevator.

Appearance in Windows 7:

Rounded rectangular gray box, lighter on the top half to make it appear bowed out along it's horizontal axis with a rectangular drop-down button, also gray.  This appearance is displeasing alongside the flat, rectangular, white background text and image boxes in the same DataGridView.

Additional information:

Salient DataGridView properties:
AutoSizeColumnsMode: None
AutoSizeRowsMode: None
BorderStyle: FixedSingle
CellBorderStyle: Single

WPF ComboBox Key Index not working when using data template selector

  

Hi all,

I have a problem regarding WPF combobox when using data template selector.

Basically, WPF combobox has a standard behaviour which will take you directly to the item that starts from a character if you type that character using keyboard. I don't know the official name for this functionality and will temporarily call it "Key Indexing".

I now want to create a ComboBox which displays its item differently. I achieved this using DataTemplateSelector;

        <ComboBox SelectedItem="{Binding Selection}" x:Name="Input" ItemsSource="{Binding Parties}">
            <ComboBox.ItemTemplateSelector>
                <Editor:PartyTemplateSelector DefaultTemplate="{StaticResource Default}" NewTemplate="{StaticResource New}" OldTemplate="{StaticResource Old}"/>
            </ComboBox.ItemTemplateSelector>
        </ComboBox>

 

And the PartyTemplateSelector is:

    public class PartyTemplateSelector : DataTemplateSelector
  &nb

The Group Work Site template has the "What's New" web part on it's home page and I have the follow

  

I can't find that web part as something I can use elsewhere? As in, I can't add that web part on other pages made even on the same site. What would be ideal is to have that web part available to add as needed to other sites/pages of course. As it stands, for me it seems the only place I can use that web part is on the home page of a new "Group Work Site", i hope that I'm wrong. I've tried exporting the web part, but the importing does nothing when trying to import it to other sites, of course other 2010 sites. Please let me know how I may add that web part to my available to use web parts please.

 

:)


Style Trigger or or Control Template to swap GradientStops

  

I have an Ellipse that is part of a UserControl.

<UserControl
 <Grid
  <Ellipse
   <Ellipse.Fill>
    <RadialGradientBrush>
     <GradientStop Color="{Binding Path=CommandBg, FallbackValue=DarkBlue}" Offset="{Binding Path=CommandGradient,FallbackValue=2}" />
     <GradientStop Color="White" Offset="0" />
    </RadialGradientBrush>
   </Ellipse.Fill>
...

The Grid Has two events:

    MouseLeftButtonDown="Grid_MouseLeftButtonDown"
    MouseLeftButtonUp="Grid_MouseLeftButtonUp"

And on the mouse down event I want to swap the GradientStop properties, and then on MouseUp, swap them back.

How can this be accomplised in XAML?

Thanks,

Bill 


WPF: how to make the listview work (apply basic listviewitem style and also apply special data

  

 We have defined the basic ListViewIItemStyle as following:

<!--ItemContainerStyle with the Trigger for selection x:Key="ListViewItemStyle"-->
 <Style x:Key="ListViewItemStyle"
  TargetType="{x:Type ListViewItem}">
 <Setter Property="Background"
 Value="Transparent" />
 <Setter Property="HorizontalContentAlignment"
 Value="Center" />
 <Setter Property="VerticalContentAlignment"
 Value="Center" />
 <Setter Property="Foreground"
 Value="Black" />
 <Setter Property="Margin"
 Value="5,0,5,0" />
 <Setter Property="MinHeight"
 Value="40" />
 <Setter Property="Template">
 <Setter.Value>
 <ControlTemplate TargetType="{x:Type ListViewItem}">
 <Border x:Name="Bd"
  Background="Transparent"
  CornerRadius="3"
  SnapsToDevicePixels="true"
  BorderBrush="{x:Null}">
 <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
 <!--<ContentPresenter HorizontalAlignment="Left"
  VerticalAlignment="Center"
  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />-->
 </Border>
 <C

"PivotTable.DisplayEmptyRows = false " in Excel pulling from Analysis Server 2008, doesn't work.

  

We display financial information, using Excel pulling from Analysis Server 2008.

 

In vba,  "ptTemp.DisplayEmptyRow = false" works fine for hiding empty rows of data on most pivot tables, but if the "account numbers" parent/child dimension is in the row fields, it doesn't.

 

The row Dimension look like this:

 

Balance Sheet

Assets

Current Assets

Cash

Total Balance Sheet

 

Income Statement

Gross Profit

Revenue

Item A

….

Total Income Statement

WPF Custom Control template doesn't work

  

Hi,

I've created a WPF custom control that goes in a DLL and I'm trying to use the control in another project.  Everything works fine except for the part of getting the control template to work. I should get an Orange background as defined below but the control just shows empty in the XAML editor and in runtime.

The code is as follows:

Class1.cs
=========

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;


namespace MyCustomControl
{
    public class CustomCtrl : System.Windows.Controls.Control
    {
        public static readonly System.Windows.DependencyProperty ValueProperty;
       
        public string Value
        {
            get { return (string)GetValue(CustomCtrl.ValueProperty); }
            set { SetValue(CustomCtrl.ValueProperty, value); }
        }

        static CustomCtrl()
        {

Reusable Template/style for RDLC files

  

Hi folks, 

I want to create a template for RDLC files which contains the UI descriptions for tables and charts which acts as a base style/template for other rdlc files.. when I create new RDLC files i do not want to apply UI settings every time i create the RDLC file.. i jst want to do it in the template and use it for newly created RDLC files.. 

As the RDLC files are XML files, i thought of CSS or xsl but that is not the solution bcoz CSS and XSL work only with browser... I want to use the simillar concepts.. so if you geeks have any idea... please share it with me...

Thanks in Anticipation

Tanveer


Workflow Doesnt Come with Site Template

  

Hi,

I am facing problem, while saving the site as Template, along with the site template i should be able to get the Workflow as well,

But while creating the new site from the Tempalte, New site doesnt have the Workflow in it,However i am able to see the Workflow name but Files under that Is not available.

Can anyone please guide through this.!?

Parth


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend