Grid Control in .NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!!!

Can anyone tell me how can I use a grid control in my Visual Basic.NET
application??? In VB6 there was a nice control called "Flexi Grid" from
Microsoft. However, it seems that .NET does not have this control anymore.
There is other stuff called "DataGrid", but it seems that this control won't
do a thing unless it has a data source assigned to it - and I don't have one.

Any help is greatelly appreciated!!!

Tarh ik
 
Yes, it will only work with a DataSource. But the DataSource can be anything
from a DataSet to an Object that supports IList or IListSource (Collections).
What I use instead sometimes is the ListView in the Details View. Works well
and fast but not editable.

Hope that helps.

David McCarter
www.vsdntips.com
 
Tarh ik said:
Hi!!!

Can anyone tell me how can I use a grid control in my Visual Basic.NET
application??? In VB6 there was a nice control called "Flexi Grid" from
Microsoft. However, it seems that .NET does not have this control anymore.
There is other stuff called "DataGrid", but it seems that this control
won't
do a thing unless it has a data source assigned to it - and I don't have
one.

Any help is greatelly appreciated!!!

Tarh ik
The DataGrid class must have a data source, but that source can be something
as simple as an array.
<quote>
To display a table in the System.Windows.Forms.DataGrid at run time, use the
SetDataBinding method to set the DataSource and DataMember properties to a
valid data source. The following data sources are valid:

a.. A DataTable
b.. A DataView
c.. A DataSet
d.. A DataViewManager
e.. A single dimension array
f.. Any component that implements the IListSource interface
g.. Any component that implements the IList interface
</quote>
Note the last three entries in the list above.
If you meant that you have no data at all to display, then the DataGrid
class is not for you.
Perhaps these articles will be useful:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/actxctrlswinforms.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/actxvnetcontrols.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;318597
 
Hi Dave!!!

Thanks for the tip!!! I created a DataSet and inserted the data
manually. It was a shock for me because it really broke the paradigm I
follow, but at the end it does make sense to have data separated from
presentation.

Thanks!!!

Tarh Ik
 
Hi Peter!!!!

Thank you very much for your tip!!! I created a DataSet (using "New")
and I filled it manually. Later on I binded this DataSet to the DataGrid. It
was really a shock for me since it broke the paradigm I always use. But at
the end, it does make sense to have data and presentation in separated
objects.

I also tried to import the FlexGrid control to .NET (using COM), but I
think that using DataGrid is better.

Thanks!!!

Tarh ik
 
Back
Top