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.

Displaying Images in GridListControl Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

45611 Jun 25,2006 04:51 PM Jun 29,2006 11:08 PM Windows Forms 9
loading
Tags: GridControl
Dave
Asked On June 25, 2006 04:51 PM

Hello, I can display an Image in my GridListControl by setting the "ImageColumn" and "ImageList" properties, but how can I display an image in more than one column? For example, I need to display a GridListControl with three columns; an Image, some text data, and then another image. How can I do this? Thanks... Dave

Administrator [Syncfusion]
Replied On June 26, 2006 12:01 PM

Hi Dave, This can be achieved by handling the PrepareViewStyleInfo event of the GridListControl and assigning the respective imagelist. The following sample demonstrates this process. Sample : GridListControl_Image_Multicolumn Thanks and regards, Madhan

Dave
Replied On June 27, 2006 12:53 PM

Hello - This ZIP file contains no files....please help. Thanks. Dave >Hello, > >I can display an Image in my GridListControl by setting the "ImageColumn" and "ImageList" properties, but how can I display an image in more than one column? For example, I need to display a GridListControl with three columns; an Image, some text data, and then another image. How can I do this? > >Thanks... >Dave

Dave
Replied On June 27, 2006 12:55 PM

Madhan, This ZIP file contains no files....please help. Thanks. Dave >Hi Dave, > >This can be achieved by handling the PrepareViewStyleInfo event of the GridListControl and assigning the respective imagelist. The following sample demonstrates this process. > >Sample : GridListControl_Image_Multicolumn > >Thanks and regards, >Madhan >

Administrator [Syncfusion]
Replied On June 27, 2006 01:22 PM

Hi Dave, Sorry for the inconvenience. Here is the link for the sample. http://www.syncfusion.com/Support/user/uploads/GridListControl_Image_Multicolumn_4bcde661.zip Thanks, Madhan

Dave
Replied On June 28, 2006 07:55 PM

Thanks Madhan, that works great. One last question - is there any reason why a DataTable has to be used for the GridListControl ''DataSource'' property? Is there any way an ArrayList could be used in your example? Thanks again. Dave >Hi Dave, > >Sorry for the inconvenience. Here is the link for the sample. > >http://www.syncfusion.com/Support/user/uploads/GridListControl_Image_Multicolumn_4bcde661.zip > >Thanks, >Madhan >

Administrator [Syncfusion]
Replied On June 28, 2006 08:22 PM

Hi Dave, You can have datasource as ArrayList as similar to a datatable. Kindly refer to the following code snippet for details. +++++++++++++++++++++++++++++++++++++++ public class Form1 : System.Windows.Forms.Form { =========== ========== private void Form1_Load(object sender, System.EventArgs e) { =========== ========== this.gridListControl1.DataSource = GetArrayList();//GetParentTable(); this.gridListControl1.DisplayMember = "ID"; this.gridListControl1.ValueMember = "ID"; this.gridListControl1.MultiColumn = true; } private ArrayList GetArrayList() { ArrayList array = new ArrayList(); array.Add(new MyArrayClass(null,"Name1",null)); ===== ==== return array; } } public class MyArrayClass { private string id, name, address; public MyArrayClass(string id,string name,string address) { this.id = id; this.name = name; this.address = address; } public string ID { get { return id; } set { id = value; } } ==== ====== } +++++++++++++++++++++++++++++++++++++++ Best regards, Madhan

Dave
Replied On June 29, 2006 08:30 PM

Hi again Madhan, Your example is kind of working for me - my question is, by setting the ''DisplayMember'' to the "ID" of that class, what does that do? Also, how do you know which fields within a class are going to display in the GridList? I still am trying to get ONLY four fields from my class to display in four columns: Id, ICON, Name, ICON2. The problem seems to be that I have several data members/fields in my (display) object, and others are getting populated in the columns. Thanks again, Dave Busch >Hi Dave, > >You can have datasource as ArrayList as similar to a datatable. Kindly refer to the following code snippet for details. > >+++++++++++++++++++++++++++++++++++++++ >public class Form1 : System.Windows.Forms.Form >{ >=========== >========== >private void Form1_Load(object sender, System.EventArgs e) >{ >=========== >========== > this.gridListControl1.DataSource = GetArrayList();//GetParentTable(); > this.gridListControl1.DisplayMember = "ID"; > this.gridListControl1.ValueMember = "ID"; > this.gridListControl1.MultiColumn = true; >} >private ArrayList GetArrayList() >{ > ArrayList array = new ArrayList(); > array.Add(new MyArrayClass(null,"Name1",null)); >===== >==== > return array; >} >} > >public class MyArrayClass >{ >private string id, name, address; >public MyArrayClass(string id,string name,string address) >{ > this.id = id; > this.name = name; > this.address = address; >} >public string ID >{ > get > { > return id; > } > set > { > id = value; > } >} >==== >====== >} >+++++++++++++++++++++++++++++++++++++++ > >Best regards, >Madhan >

Administrator [Syncfusion]
Replied On June 29, 2006 09:42 PM

Hi Dave, The Display and Value member will be helpful in displaying and retrieving the required column values, when we have the gridListControl as a dropdown in the grid. In this case, you can cancel it. The grid will display as in the datasource, so to display the required columns you can hide the unnecessary columns in the grid. Sample : http://www.syncfusion.com/Support/user/uploads/GridListControl_Image_Multicolumn_63b4d1b7.zip Best regards, Madhan

Dave
Replied On June 29, 2006 11:08 PM

Thanks for all of your prompt responses! I''ll take a look at your example :) >Hi Dave, > >The Display and Value member will be helpful in displaying and retrieving the required column values, when we have the gridListControl as a dropdown in the grid. In this case, you can cancel it. The grid will display as in the datasource, so to display the required columns you can hide the unnecessary columns in the grid. > >Sample : http://www.syncfusion.com/Support/user/uploads/GridListControl_Image_Multicolumn_63b4d1b7.zip > >Best regards, >Madhan

CONFIRMATION

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.

;