Datagrid bind using objects

prosys

Member
Joined
Aug 7, 2008
Messages
13
Programming Experience
Beginner
hi!

i created a class
i invoke the class as object in vb.forms
i want bind object(parameters) to datagrid
when return as arraylist from methods in form_load.
i want to bind arraylist to datagird in form_load.
it will bind, the grid show all the parameter from arraylist.
but i want few columns to bind from arrylist.


here arraylist is convert from list from method.
any has solution pl. reply me.

thanks for advance.
 
Please post in the most appropriate forum for the topic. Thread moved.

I'm going to assume that you're actually using a DataGridView rather than a DataGrid, given that you're targeting .NET 2.0.

By default, when you bind a list to a DataGridView, the grid will automatically create the columns for you, with a column for each accessible property. If you don't want to accept the default configuration then you should add the columns yourself in the designer. You can then which columns will be displayed and what they will look like. You need to set the DataPropertyName of each column to the name of the item property/column that it will bind to, then set the grid's AutoGenerateColumns property to False, which you must do in code.
 
Back
Top