Home All Groups Group Topic Archive Search About

Direct input into DataGrid?

Author
13 Mar 2006 2:48 AM
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 :-)

Author
13 Mar 2006 3:27 AM
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!
Author
13 Mar 2006 6:56 AM
Cor Ligthert [MVP]
RV,

It is as Steve tells, our website is full as created samples to do that.

http://www.vb-tips.com/default.aspx?ID=76a81eb8-ea2d-48f4-99c3-a3539697edbd

Here is one, we have no samples which does not something extras so simple is
it in fact.

I hope this helps,

Cor


Show quoteHide quote
"RV" <raj***@hotmail.com> schreef in bericht
news:1142218085.153738.108910@j52g2000cwj.googlegroups.com...
> 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 :-)
>
Author
14 Mar 2006 1:46 AM
RV
Thanks many tons, Steve and Cor :-)

Will be trying this out and posting back.

Regards

RV