We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

TreeView Virtual Grid

Thread ID:





56060 Feb 8,2007 05:23 PM Feb 9,2007 03:25 PM Windows Forms 4
Tags: GridControl
Adnan Sohail
Asked On February 8, 2007 05:23 PM


Bitmap bm = new Bitmap(GetType().Module.Assembly.GetManifestResourceStream("CustomGridCell.minus.bmp"));

This line produces the following error.

Value of 'null' is not valid for 'stream'.

What would cause this error? Do i need to add some kind of assembly to my project?

I have the bmp files in the project.

Administrator [Syncfusion]
Replied On February 8, 2007 06:45 PM

Hi Adnan,

What would cause this error?
The reason for getting this issue is that you are not setting the "minus.bmp" file build action as Embeded Resource. By default, it should be content. Please try the following steps to resolve this.

1) Open your application
2) Right click on the "minus.bmp" file in the solution explorer and go the properties.
3) set the Build Action to Embeded Resource in properties.
4) Run your application.

Please let me know if this helps.

Best regards,

Adnan Sohail
Replied On February 9, 2007 10:49 AM

This didnt solve the problem.

I have a folder called "Product" and i have the form that contains a virutal grid in Product's folder. Bmps are also in that folder.

Again this line is producing error.
Bitmap bm = new Bitmap(GetType().Module.Assembly.GetManifestResourceStream("CustomGridCell.minus.bmp"));

Just to let you know this is a separate project and not the sample project.

Administrator [Syncfusion]
Replied On February 9, 2007 03:16 PM

Hi Adnan,

Reading the information from the resource to a stream is performed with a method call to GetManifestResourceStream. The parameter that is passed to this method is the name of the resource that is to be accessed. The resources are named using the following convention: .. So if you embed a file named minus.bmp into your project in the MyNS namespace, you have a resource in the manifest named MyNS.minus.bmp.If you want to get resource streams, use the following code:

Bitmap bm = new Bitmap(GetType().Module.Assembly.GetManifestResourceStream("MyNS.minus.bmp"));

The only tricky thing here is you need to prepend the name of your Assembly to the name of the resource stream. If you want to view all the resource streams available to you, use the following code:

Assembly a = Assembly.GetExecutingAssembly();
string resNames[] = a.GetManifestResourceNames();

foreach(string s in resNames)

Best regards,

Adnan Sohail
Replied On February 9, 2007 03:25 PM



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.