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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

DataTrigger bound to a datebound property using a converter not working.

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

Hi all, this will sound like a simple problem but I am really stumped!

I'm trying to create a TextBlock with a style that collapses when the text is "" or null. So in the style there's a DataTrigger bound to Text using a Converter that provide a boolean test for "" or null.

The problem is that the triggers never seem to fire. Debugging the converter suggests it never gets used. The debug output also doesn't warn me of failed bindings so I have no idea what is going wrong!


			<GlacialControls:IsNullOrEmptyStringConverter x:Key="isNullOrEmptyStringConverter"/>
			<Style x:Key="Co

View Complete Post

More Related Resource Links

Combobox SelectedValue with Converter and PropertyChangedCallback() is not working together?

Hi, I have a combobox, I want to have a PropertyChangedCallback and at the same time I want to bind selected value with IsEnable property of a Checkbox. Problem is when I add Converter Neither Converter gets called and nor the  PropertyChangedCallbac().   <ComboBox ItemsSource="{Binding Source={StaticResource EnumExportType}}" Name="CB_ExpType" SelectedValue="{Binding Path=ExpType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged" /> Combobox is binded with static Enum resource EnumExportType. Selected value is Binded with a Dependency Property ExpType which is a Enum.   public ExportType ExpType { get { return (ExportType)GetValue(ExpTypeProperty); } set { SetValue(ExpTypeProperty, value); } } public static readonly DependencyProperty ExpTypeProperty = DependencyProperty.Register("ExpType", typeof(ExportType), typeof(ExportScreen), new FrameworkPropertyMetadata(ExportType.EntireProject, new PropertyChangedCallback(ExportTypeChanged))); this works fine On changing Item from combobox PropertyChangeCallback gets called. Now I want To bind the IsEnabled property of a Checkbox to the ExpType property and I use IValueConverter to convert the ExpType to the correct boolean value. <CheckBox Content="Test" Name="CHK_WithModels" IsEnabled="{Binding ElementName=CB_ExpTyp

DataTrigger - Binding Value Property to Target Controls Content Property

This Gives me an error..   <Style x:Key="radioButtonSelctionKey" TargetType="{x:Type RadioButton}">       <Style.Triggers>       <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}},Path=ValueText}" Value="{Binding Path=Content}">       <Setter Property="IsChecked" Value="True"></Setter>       </DataTrigger>       </Style.Triggers>       </Style> Is it valid to bind Value Property. If not then does it mean that the Value propety must always fix and can not be changed or Bound to any property Dose it mean that both of the way of setting Value proeprt are WRONG..? 1) Value="{Binding Path=Content}"> Or 2) Value="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content}">

<%# eval> not working for a simple property

<form id="form1" runat="server"> <div> <table> <tr> <td>Name: <%#customer%> </td> </tr> </table> </div> </form>        Partial Class ScorePage Inherits System.Web.UI.Page Private _customer As String = "Sachin" Public Property customer() As String Get Return _customer End Get Set(ByVal value As String) _customer = value End Set End Property End Class   The expected result in html page is Name: Sachin But i am getting Name: property is not getting displayed. I thought instead of creating a label control, we can use this method, but it is not working  

Member_Caption property not working in SSAS 2000

Hi, I need to pass a parameter to my SSRS report which is based on an Analysis services cube (AS 2000). I have created a query which will return me the members of a hierarchy that I can pas as a perameter. Interestingly the Member_Caption property is not working. In MDX Sample application it is returing "#err" in the column and when I run the same command in my SSRS MDX editor ( I am using OLEDB connection alongwith analysis services 9.0 client) I get empty space. My query is, WITH     Member [Measures].[ParameterCaption] as '[PRODUCT].CurrentMember.Member_caption' MEMBER   [Measures].[ParameterValue] AS '[PRODUCT].CurrentMember.UniqueName' MEMBER   [Measures].[ParameterLevel] AS '[PRODUCT].CURRENTMEMBER.LEVEL.ORDINAL' SELECT   {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , { Descendants([PRODUCT].Currentmember,1,leaves)+(Descendants([PRODUCT].Currentmember,2,leaves))} ON ROWS from   [My_Cube] Am I making any obvious mistake here ? I have used similar queries before and they have always worked (With SSAS 2005) Thanks in advance, Suman  

property setting in report server (2008) config file is not working as expected.



I have set the <WorkingSetMinimum> property to 2.4GB in my reportserver 2008 config file.

By defintion, <WorkingSetMinimum> setting means,

  1. Lower limit of service memory consumption; memory will not be released if the consumption is below this amount, though the service will not reserve the designated amount of memory when it starts.
  2. If service uses more than the designated amout of memory, it will release back the memory only till this declared value and not beyond that, which means it should keep 2.4GB as designated.

See this link for definition: http://books.google.com/books?id=mzY_Xo_9J-gC&pg=PA589&lpg=PA589&dq=What+is+%3Cworkingsetminimum%3E+in+report+server+configuration+file&source=bl&ots=r_xhRp8erj&sig=E_o0-Dh2SXOgMNrW3sptt5oZrYI&hl=en&ei=f5mjTNeNM5O8ccmErJMI&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCAQ6AEwAw#

DataGridComboBoxColumn bound to an enum w/ text converter


I'm trying to get a DataGridComboBoxColumn to bind to a property that is an value of an enum.  If I use AutoGenerateColumns=True, it does it automatically.  I know that I shouldn't have to create a static resource.  With auto generating columns it shows the name of the enum value selected.  Those don't have spaces in them, but are well described; therefore, I'd also like to get a string version of it the enum.  Any ideas how to do this?  Even if we can just solve the first part of my question; that would be nice.

<DataGrid Grid.Row="2" ItemsSource="{Binding Path=Users}" AutoGenerateColumns="False" >
        <DataGridTextColumn Header="Username" Binding="{Binding Name}"/>
        <DataGridTextColumn Header="Password" Binding="{Binding Password}"/>
        <DataGridComboBoxColumn Header="User Type" SelectedItemBinding="{Binding Type}" />

TextBox shows "old" value after being Coerced when bound to a Dependency Property




I am writing a WPF Custom Control.  I want to be able to limit the input for the DependancyProperty "Text".  I have the OnCoerce event handlers connected and this property is bound to the "Text" property on a TextBox in my content template as shown below:


Code Snippet

<TextBox Name="PART_txtEdit"

Background="{TemplateBinding Background}"

BorderBrush="{TemplateBinding BorderBrush}"

Force update of bound combobox when validation changes bound source property


.NET 3.5SP1, VS 2008

I have inherited a system for maintenance and I'm working my way through defect reports.  Once such issue involves insuring a combobox value is reset to a known good value when a validation failure occurs.  The combobox is bound to a source property loaded which is initialized when the user selects a case for update.  According to this post it is an issue inside of WPF to ignore value changes when processing an update to the source (at least that's how I interpret the post).  Unfortunately for me, the UpdateSourceTrigger for a combobox is PropertyChanged, so the suggested approach does not fit my needs.  I tried it anyway, just to be certain.

I've created a test app which mimics the application design and exhibits the behavior I'm attempting to work around.  At this point, I'm at a loss how to proceed further.  I'm certain there's something I'm missing and would appreciate a nudge in the proper direction.

xaml window:

<Window x:Class="TestWpf.ComboTest

Isenabled property in WPF not working on mouse right click



   I set Isenabled =false on a paticular condition using trigger evry thing got disabled but mouse right click is working and Getting selected,can any one let me know how to resolve this issue.


Thanks in Advance

Custom checkbox control 'checked' property is not working .


Hello ,


Iam developing a custom checkbox control deriving from the 'compositecontrol' which i need to use it for a composite control purpose.



public class TngCheckBox : CompositeControl


i have written the required properties which are working fine except the "checked" property. he

asp.net Radio button grouping property is not working



Iam developing a custom server control  of radiobuttton. it is working fine with the all the properties i wrapped  except the grouping . somehow the grouping is not working .

  // this is my class.
 public class TngRadioButton : CompositeControl


// this is my groupname property

[ DefaultValue(""), Themeable(false) ]
        public virtual string GroupName
                string str = (string)this.ViewState["GroupName"];
                if (str != null)
                    return str;
                return string.Empty;
                this.ViewState["GroupName"] = value;


Please  help me in this resolution.




Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.

Working with DropDownList and ListBox Controls in ASP.NET

"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

.net code converter

For coverting your programming langugae to another languge the below site is very help full


Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:
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