.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

Custom Object as the TreeViewItem

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :WPF
Hi, My work demands that I need to have an object stored in a treeviewitem. I tried doing it, but with no avail. It would be brilliant if somebody could throw some light on how to achieve this with minimum fuss. Cheery Krish  

View Complete Post

More Related Resource Links

Contexts in .NET: Decouple Components by Injecting Custom Services into Your Object's Interception


The .NET Framework can use contexts as an object's execution scope and intercept calls going to and from the object, similar to the way COM+ provides component services. What is new with this mechanism is that the runtime allows developers to take part in the interception chain and add powerful services, thus extending existing component services. This in turn decouples the business logic from the system plumbing and simplifies long-term maintenance. Presently, .NET contexts and interception are undocumented aspects of .NET. This article presents the underlying interception architecture and message processing, explains custom context attributes, and walks through a custom interception-based component service.

Juval Lowy

MSDN Magazine March 2003

Building a Custom Data Grid: Performing Ad Hoc Web Reporting with a VBScript 5.0 Class Object


A flexible, customizable grid for displaying data is a useful tool for ASP developers. It allows Web visitors to customize their view of your data. This article takes the data grid presented in "Ad Hoc Web Reporting with ADO 2.0" by John Papa and Charles Caison (MIND, December 1998) and adds handy features such as a finds feature that supports multiple finds and a mode for adding and editing records. This version also improves response time by allowing asynchronous record download and it componentizes the code so it can be used as a standalone VBScript class object that can be reused in other pages.

Randall Kindig

MSDN Magazine July 2000

Problem passing custom object returned by the same webservice among two separate projects

I am running into casting issue with this scenario: 1. I made a custom object lets call it EmployeeObject.  2. The Employee object is wrapped in the EmployeeWebservice.  3. I have a client application project lets call it EmployeeClientApplication and a class library called DoSomeWorkClassLibrary.  Both EmployeeClientApplication and DoSomeWorkClassLibrary reference the EmployeeWebService and need to be able to pass the EmployeeObject back and forth.  4. The EmployeeClientApplication also references the DoSomeWorkClassLibrary. 5. The employeeObject in the EmployeeClientApplication becomes EmployeeClientApplication.EmployeeWebService.EmployeeObject. 6. The employeeObject in the DoSomeWorkClassLibrary becomes DoSomeWorkClassLibrary.EmployeeWebService.EmployeeObject. 7. The DoSomeWorkClassLibrary has a method called DoSomeWork that takes an EmployeeObject. When I try to pass employeeObject from EmployeeClientApplication to DoSomeWorkClassLibrary by doing something like this: DoSomeWorkClassLibrary.DoSomeWork(EmployeeClientApplication.EmployeeWebService.EmployeeObject), I am getting Unable to convert EmployeeClientApplication.EmployeeWebService.EmployeeObject to DoSomeWorkClassLibrary.EmployeeWebService.EmployeeObject.  I have searched high and low to fix this issue, I have tried changing the namespace of the reference.cs file of the webservice in

Details View Biding Custom Object with Enum properties fields

Hello, I'm trying to bind custom object to details view. The problem is that enum property fields are not show.Is there any way to show enum property fields in details view ?I put some example code below (I do not specify any rows mappings, they are generated dynamically because different kind of objects are bound to details view):// My object public class OrderItem { public ItemKindEnum unitemizedItemKind { get { return (ItemKindEnum)this.unitemizedItemKindID; } } ... } // Details view configuration <asp:DetailsView ID="dvOperationDetails" runat="server" DefaultMode="ReadOnly" ... />

How to create one instance of COM object that can be accessed from custom fields/workflows

Hi, Ive got a COM-object that is used to perform some actions on another server, and i can use only one instance of it ... But : 1. my custom fields must interact with it for fetching data 2. my custom workflows must interact with it for posting data So the question is : How to create only one instance of COM-object which can be fully accessible from custom fields/workflows ( custom too ) Thanks :)

Is it possible to cast COM object to the custom interface?


I have following code which succesfully works using some COM wrapper library with all needed managed types for COM objects

mshtml.HTMLDocumentClass doc = (mshtml.HTMLDocumentClass)_webBrowser.Document;

mshtml.HTMLIFrameClass iframe = (doc).getElementById("SomeFrameName") as mshtml.HTMLIFrameClass;

if (string.Equals(iframe.readyState.ToString(), "complete", StringComparison.OrdinalIgnoreCase))


 // Do something


But I need to avoid this COM wrapper Micrososft.mshtml.dll and use custom interfaces for this reason, so please explain me how way can I work with COM objects with custom interfaces? How do I write them and avoid classes mshtml.HTMLDocumentClass and mshtml.HTMLIFrameClass?

how to add custom button to ribbon using server object model?(not using xml)

how to add custom button to ribbon using server object model?(not using xml)

new custom control using object model?


Is it possible to create our own ribbon ?if possible,

How To add new ribbon and under that new  custom controls to ribbon using server object model?


How to add a custom tab to ribbon using server object model?


How to add a custom tab to ribbon using server object model in share point 2010?

how to create new Custom ribbon and new tab under ribbon using programatically?

Please send The answer?


error using a custom collection object in a WCF service


I'm relatively new to WCF but have gotten most of my service to work very well. I'm having one "strange" problem: My service makes use of several custom data types, and all of them work fine except for the custom collections. Note...I am NOT trying to pass a collection object to the client...I am simply trying to initalize and use it from the main service object. Here is an example:

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)> _
Public Class User
    Implements IUser

    Public Memberships As new Memberships   ' this is the collection I am calling!

    Public Function countMemberships() as integer Implements IUser.countMemberships
         return Me.Memberships.count       'this returns an error! Object reference not set to an instance of the object...

    End Function 

End Class

' and here is my custom colection 

Public Class Memberships
    Inherits System.Collections.CollectionBase

    Public Sub Add(ByRef Membership As Membership)
    End Sub


Custom Sharepoint 2007 Timer Job - Object Reference Not set to an instance



I am creating a Custom Sharpeoint timer job (in 2007) and i used Andrew Connel's blog and his code to create it. But for some reason I always get this error. I commeted out all my code inside execute method but still its the same. I am deploying my timer using Solution Package installation and activated the Feature.

Here is the error: The Execute method of job definition CustomSPJobDefinition.CustomSPService (ID 88a735f1-bbb7-4fea-932f-690dfc25a212) threw an exception. More information is included below.

Object reference not set to an instance of an object.



Guid targetInstanceId = new Guid("EAC61BD1-0C2A-45F6-9148-3A8BC9C93339"

Best method for typing a custom object thru a web service


I have several web services with a custom business object being used as a parameter (MyNamespace.MyBizObj).

After I create my web references that same  business object gets retyped to whatever web service that is is in Example:

webserviceRef1.MyBizObj, webserviceRef2.MyBizObj, webserviceRef3.MyBizObj


Right now my UI isn't allowing me to retype this object back to the object that I need. In essence I need one unified version of this object that I can use across web services.

How to get a list of unkown number of Object from a custom Activity Designer



I'm  trying to get a list of Object of unknown size. I use a stackpanel in my designer to have as many ExpressionTextBox as needed. The number is only known at design time through an ExpressiontTextBox and a validate button. Once the button is clicked, I generate the ExpressionTextBoxes as follow :

    Private Sub btnValidate_Click(ByVal sender As System.Object,
                                  ByVal e As System.Windows.RoutedEventArgs)
      stack.Children.RemoveRange(0, stack.Children.Count)
      For i As Integer = 0 To (

Replicate non indexed view to a table - custom sync object/


What is the best way to replicate data from a view containing a LEFT OUTER JOIN (so cannot be indexed) to a physical fact table on the subscriber in as real time a fashion as possible?

I have heard of the use of custom sync objects etc.. can anyone suggest the best way forward and any references?

Is CDC a candidate for this type of task?

Thanks in advance

Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.
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