populating datagrid error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amber

    populating datagrid error

    Hello,

    I am having trouble with a datagrid.
    I received help online to create the datagrid the way I needed it, so I'm
    not entirely clear on how/why it works.

    I use the following code to populate the rows of my datagrid.
    The variable _arrstr contains my column headers.

    For i = 0 To (_dataset1.Tabl es(0).Rows.Coun t) - 1
    dataTable.LoadD ataRow(_arrstr, True)
    'column 1 - Cutting Permit
    datagrid1(i, 0) =
    _dataset1.Table s(0).Rows(i).It emArray(1).ToSt ring()
    'column 2 - Cutblock
    datagrid1(i, 1) =
    _dataset1.Table s(0).Rows(i).It emArray(2).ToSt ring()

    'etc for all my columns.
    Next i

    For the most part this works great.
    I run into a problem when:
    I have a combobox that provides a filter, and a button that when pressed,
    populates this datagrid, based on the filter.
    The first time I select a filter, then press the button, this works fine.
    If I change the value again, and press the button, the correct rows display,
    but additionally, for each row displayed, the values of _arrstr populate a
    row after that.
    So if there should be 4 rows of data, there are, and there are 4 additional
    rows containing my column header information.

    I'm not sure where this problem is coming from...

    Any suggestions??
    TIA,
    Amber
Working...