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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TreeView Virtual Grid

Thread ID:





56060 Feb 8,2007 10:23 PM UTC Feb 9,2007 08:25 PM UTC WinForms 4
Tags: GridControl
Adnan Sohail
Asked On February 8, 2007 10:23 PM UTC


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 11:45 PM UTC

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 03:49 PM UTC

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 08:16 PM UTC

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 08:25 PM UTC



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon