multiple datagridviews on a single form - problems
Posted on 2010-11-08
I need 3 datagridviews on a single form. There are things that seem to be causing them to be entertwined.. For example..
Private Sub dgRanktkn_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgMeritBadgetkn.CellFormatting, dgRanktkn.CellFormatting
Dim setRow As WannalancitDataSet.ScoutAdvancementRankRow = _
If dgMeritBadgetkn.Columns(e.ColumnIndex).Name = "AwardDesc" Then
sqlStr = "Select * from RankMBAwardCodes where AwardType = '" + setAwardType + "' and AwardCode = '" + setRow.AwardCode + "'"
rdr = GetAdvancement(sqlStr)
e.Value = rdr("AwardDescription").ToString
If first & second grid have nothing, no errors. But if first grid has detail in a row, this second grid blows up with "Index 0 is either negitive or above rows count.
Before this I had an issue with the rows in grid 1 showing up on grid 2 & grid 3.. Figured out that although they all used the same table, I could not filter the table & move the filtered Dataset into the Grid.datasource. then refilter the same table and set those records into the next grids datasource.. Instead I had to have 3 seprate tables in my datasource all pointing to the same table, but to be used one each on each grid..
This got rid of all the grids being alike, but that's when I got this new error where all the datagrids seem to want to use the same System.Windows.Forms.DataGridViewCellFormattingEventArgs