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

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

Detect property changed for DataGridColumn

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :WPF


I build my DataGridColumns in code. The user can choose to hide and show columns by interacting with a context menu. I would like to listen to the events when a DataGridColumn's Visibility has been changed and when it does I need to run a custom code. Is there a way to do that? 





View Complete Post

More Related Resource Links

Detect if Windows theme was changed

Hi,   Is there a way to detect if the Windows theme was changed? Some sort of event.

Detect if document has changed.



I'm working on a workflow that operates on a document library.  It works with .docx files that need approval.
There is a workflow that runs on modify and checks to see if the document has been approved by all the required people. 

That all works fine.  The requirement that I'm having trouble with is that if a document has been modified, it needs to be moved to a different document library for a second round of approval.  Is there any way to detect if the document has changed since it was uploaded?  I've tried checking the version, but it didn't change when I tried editing the document.

Thanks for any help!

DataGridColumn CellStyle doesn't work. > The Property Setter "IsReadOnly" cannot be set because it


hello i have the folowing DataGridColumn:

<DataGridTextColumn Header="Number of pipes:" Binding="{Binding Path=Pipes.Count}">
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="IsReadOnly" Value="True"></Setter>


But I get the following error: The Property Setter "IsReadOnly" cannot be set because it does not have an accessible set accessor.


Can anyone help me out ?

Manage user Properties - Changed property "work phone" Property mapping for Synchronization but user


Hi, I've changed the a user profile settings in CA (see below) so it is no longer mapped to AD, but when I edit the user profile in SharePoint MySite I have a yellow triangle with an exclaimation mark that states "indicated a filed that is updated automatically from the corporate directory. Changes to these properties may be lost. But I have removed the mapping as above. Am I missing some thing or is there a job that I need to run to carry the update through.   

I made the change in  - "user profile service application - manage user properties - Work phone" I have removed the "property mapping for Synchronization" so it now displays "There are no items to show in this view" - Do I need to make further changes to carry this through? 

How to detect and avoid memory and resources leaks in .NET application

Despite what a lot of people believe, it's easy to introduce memory and resources leaks in .NET applications. The Garbage Collector, or GC for close friends, is not a magician who would completely relieve you from taking care of your memory and resources consumption.

I'll explain in this article why memory leaks exist in .NET and how to avoid them. Don't worry, I won't focus here on the inner workings of the garbage collector and other advanced characteristics of memory and resources management in .NET.

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.

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:

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Is it possible to populate property choices from a database?


I'm creating my first server control, and have it working where I can set up an enum and the user can set a property's choices,  based off of that enum.  But I'd like it to pull records from a database and populate the list of choices for the property from a database.  This would allow me to add a new "Host System" to the database, and the other designers wouldn't have to get a new copy of the dll.



Custom Server Control Property not maintaining state


I have created a server control consisting of a TextArea and a div under it.  My goal is to create my own asp:TextArea type control.  the div is for a Character count of the text area and seems to work ok but i added a CharacterCountVisible property to the control that is always returning true.  See Proptery definition below


<Bindable(False), Category("Appearance"), DefaultValue("True"), Localizable(True)> Property CharacterCountVisible() As Boolean
        Return _CountBoxVisible
    End Get
    Set(ByVal value As Boolean)
        _CountBoxVisible = value
    End Set
End Property

Note the _CountBoxVisible variable is define inside the class as :

Dim _CountBoxVisible as Boolean = True

What I am trying to do is give the user/coder the option to show/utilize the char count feature.  Can make it disappear with textarea1.CharacterCountVisible = False but setting it to true will not make it display.


What am i missing





Category attribute of user control property does not work correctly in categories tab.



I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".

[Category("Styles"), DefaultValue(""), Description("The value for formating something.")]
public String MyFormatProperty
set { /* the code for set */; }
get { /* the code for get */; }

And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.

Does anybody know why? How can I display the category correctly only with set?

Thanks, S.

Detect Browser Screen Size??


Hi Everyone,  I need to detect the size of the user's screen for mobile devices (especially the BlackBerry). I've read a lot of pages that seem to refer me to the Request.Browser object, but I'm finding that this object doesn't have the correct values. For example, I have a BlackBerry and when I use the Request.Browser to get the screen size, it tells me it is 640x480. Well, I know it's not that big since an image of 300px wide just barely fits. Also, when I run on my desktop browser, it also says my screen is 640x480. I can assure you, it is not 640x480! ha!

  How does anyone reliably get the browser's screen size?? Do I have to revert to some kind of JavaScript? If so, where can I read more about it? Will it be any more reliable? Someone must have an idea about this. Thanks in advance!!

How to detect mobile phone name/model no from asp.net?


Hi experts,

Can I detect the Name/model no of the mobile phones ,which are browsing my asp.net website from C# code behind? I need to show welcome message, addressing their model numbers and redirect to appropriate pages.

Thanks in advance for your reply.


Create web site specific to mobile device, how to detect?



I have a website that is written in .Net 2.0 which uses all the nice rich functionality of the web (Ajax, javascript etc..).  However I have noticed that the site does not display very well on mobile devices. 

So therefore I would like to create a more streamlined version of my site that is better tailored to these devices.  However how do detect that the user has come to the site via a mobile device and how can i redirect them to my tailored page

Many thanks in advance

How to detect Mobile devices like Pocket PC??

Hi all,
Need help on this. As you know there is PDA-phone like Pocket PC-phone run on Window Mobile 2003 and above. It has Ms Internet Explorer of scale down version.

So, the question is this kind of device is under mobile device category but having IE browser. So, how to detect this kind of MObile device using MobileCapabilities class?  YOu see, SmartPhone also have Ms IE browser. How to tell them apart?? If I serve Pda-html website to SmartPhone, its screen size will be too small for it.

My objective is this : to detect the PDA device and Mobile Phone .

If it is PocketPC-phone, I will serve PDA-html website or Mobile web base on customer selection.
If it is smartphone or WAP 2.0 -base mobile phone, I will serve  Mobile Web.

please help.

No More Hangs: Advanced Techniques To Avoid And Detect Deadlocks In .NET Apps


You can combat deadlock using a combination of disciplined locking practices which Joe Duffy aptly explains in this article.

Joe Duffy

MSDN Magazine April 2006

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