pvg1975
asked on
Grid without using database
Hello, is it possible to have a grid on the screen (like a datagrid) without connecting the grid to a data control?
Thanks!
Paula
Thanks!
Paula
ASKER
Hi James!
Yes, I did VB6 A LOT!!! and I just moved to .NET
I need to fill a grid with numbers and text only, that's all.
Yes, I did VB6 A LOT!!! and I just moved to .NET
I need to fill a grid with numbers and text only, that's all.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi James! Yes its hard for me... to late to move, the company I work for had a huge application in VB6 and I got stucked on it... anyway, time to move :)
The grid is to enter numeric values coming from some textboxes.
I tried this:
MyGrid.Rows.Add(1)
MyGrid.Item(0, MyGrid.RowCount - 1).Value = N1.Text
MyGrid.Item(1, MyGrid.RowCount - 1).Value = N5.Text
MyGrid.Item(2, MyGrid.RowCount - 1).Value = N2.Text
with the intention of adding a row and possitioning the values on that last row, but what it does is to delete all previous entered rows and place the text on the last row.
The grid is to enter numeric values coming from some textboxes.
I tried this:
MyGrid.Rows.Add(1)
MyGrid.Item(0, MyGrid.RowCount - 1).Value = N1.Text
MyGrid.Item(1, MyGrid.RowCount - 1).Value = N5.Text
MyGrid.Item(2, MyGrid.RowCount - 1).Value = N2.Text
with the intention of adding a row and possitioning the values on that last row, but what it does is to delete all previous entered rows and place the text on the last row.
ASKER
Oh, Im using a datagridview not linked to any database.
ASKER
I made it work like this:
Dim row = New String() {"4", "25", "4000"}
MyGrid.Rows.Add(row)
Thanks!!
Dim row = New String() {"4", "25", "4000"}
MyGrid.Rows.Add(row)
Thanks!!
To answer your question: yes.
A datagrid can work with any array or collection in the .NET framework.
It can also be fed cell by cell. This is not hard to do if you want only to display invormation, but it can become more involved if the user need to edit the code and you need to keep the result changes).
What type of data do you want to put in the grid?