Direct input into DataGrid?

R

RV

Hello

I have used the Microsoft FlexGrid Control in VB6 to directly accept
user input & display the same in its cells. For example, a user could
click a cell to enter info which would be subsequently displayed in
that cell.

Is there a way to directly enter info into the DataGrid Control in
Visual Basic .NET the same way? I do not want to connect to any
database / table.

Thanks in advance :)
 
S

Steven Nagy

You sure can.

But you still need a DataTable.

So try this:
Create a new data table and specify its columns (Columns collection
takes DataColumn objects).
Then bind that data table to your grid.
When the user enters new rows of information, those rows are in your
datatable.Rows collection.

A few notes: Datagrid will need to be editable. The datatable that you
create has a DefaultView property which allows you to set whether the
user can add rows, delete rows, and edit existing rows.

Hope this helps buddy!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top