Jimmyjay21
asked on
VB express 2008. appears handicaped in dealing with grids.
I am having problems getting this information from MS helpers maybe someone here can give me a boost in the right direction. The application has a function which receives data over a serial port, I want to display the incomming data within a grid, but looking a the toolbox I only see the vb 2008 express datagridviewer control listed. Since this data is in memory I would like to populate the datagriidviewer one row at a time. Sounds easy and should be, but the new required codes do not seem to have a method with which I can control where in the grid to place data, namely column and rows. I have seven columns to display for each row.
Something like below should work, but the compiler will not allow this technique.
Any suggestions will be appreciated. Could it be the express version is cut off at the knees?
Something like below should work, but the compiler will not allow this technique.
Any suggestions will be appreciated. Could it be the express version is cut off at the knees?
FirstGrid = False
Dim newrow As DataGridView.DataGridViewControlCollection
newrow.Item
RowCount = RowCount + 1
DataGridView1.NewRowIndex
With DataGridView1
.CurrentRow = RowCount
.currentcol = 1
.CurrentCell = srf
.currentcol = 2
.CurrentCell = scol
.currentcol = 3
.CurrentCell = srow
.currentcol = 4
.CurrentCell = stxt
.currentcol = 5
.CurrentCell = asts
.currentcol = 6
.CurrentCell = initalarm
.currentcol = 7
.CurrentCell = desc
End With
ASKER
That's good, and safe, however I need to add several thousand records over a period of 24 hours.
This method will require me to refresh the list evertime a record arrives. I was hoping there might me a method in which I could manually add each record to the grid, bypassing the need to refresh every time a record is received.
I can do this with the list box, however it looks tackey, an organized grid ioffers a much better view.
If not possible I will just have to live with the listbox.
This method will require me to refresh the list evertime a record arrives. I was hoping there might me a method in which I could manually add each record to the grid, bypassing the need to refresh every time a record is received.
I can do this with the list box, however it looks tackey, an organized grid ioffers a much better view.
If not possible I will just have to live with the listbox.
ASKER
Comment was given in previous response. The solution offered certainly will work and worth the points, before closing I would like to see if the manual process to creating this grid list is possible with VB 2008 express.
Thanks,
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Whops, that process is what I want to avoid, adding the records to a table is a given, already being done. Ok I want to move forward with this I will get back ASAP ; but if I am reading this correctly you are saying I only need to add the record to the table and the item will then display without a refresh, I think a refresh will be needed, I'll test to determine what will work.
Thanks.
Thanks.
This simple examples make a DataTable with 7 columns and 10 rows, then proceeds to fill it up:
Open in new window
DataGridViewExample.jpg