datagridview没有显示第1行 [英] datagridview not showing 1st row

查看:125
本文介绍了datagridview没有显示第1行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助



i需要过滤我的datagridview,所以我使用下面的代码工作正常,除了

它不是显示第1行

i意味着当我卸下过滤器时,我可以看到第1行处于过滤器显示的状态,但是当我打开过滤器代码时,一切都很好,除了第一排



任何想法请









PLEASE HELP

i need to filter my datagridview, so I am using the code below which is working fine, EXCEPT
its not showing the 1st row
i mean when i remover the filter i can see that the 1st row is in the condition to be showed by the filter, but when i turn the filter code on everything thing is fine except for that 1st row

any ideas PLEASE




ItemsDataGridView.ClearSelection()
  Me.ItemsBindingSource.RemoveFilter()
  Dim SI As Integer
  SI = SuppliersITEMSDataGridView.RowCount()
  Dim idgr As Integer
  idgr = Me.ItemsDataGridView.RowCount
  Dim count As Integer
  For count = 0 To (idgr - 1)
      Me.ItemsDataGridView.Rows(count).Cells(12).Value = 0
      Me.ItemsDataGridView.Rows(0).Cells(12).Value = 0
      '  MsgBox(Me.ItemsDataGridView.RowCount)

  Next



  Dim ASIF(SI - 1) As Integer
  Dim LSIF As Integer = 0
  For LSIF = 0 To (SI - 1)
      Dim MISIF As Integer
      MISIF = (Me.SuppliersITEMSDataGridView.Rows(LSIF).Cells(15).Value)
      ASIF(LSIF) = MISIF
  Next
  Dim ifd As Integer = 0
  Dim ir As Integer = 0
  Dim an As Integer = 0
  Dim ar As Integer
  ir = Me.ItemsDataGridView.RowCount
  For ar = 0 To (SI - 1)
      For ifd = 0 To (ir - 1)
          If Me.ItemsDataGridView.Rows(ifd).Cells(0).Value = CStr(ASIF(ar)) Then
              Me.ItemsDataGridView.Rows(ifd).Cells(12).Value = 1

          Else
              ' Me.ItemsDataGridView.Rows(ifd).Cells(12).Value = 0
          End If
      Next
  Next
  MsgBox(Me.ItemsDataGridView.Rows(0).Cells(12).Value)
  ItemsDataGridView.ClearSelection()

  Me.ItemsBindingSource.RemoveFilter()
  ItemsDataGridView.DataSource = Me.DATABASEDataSet.Items.Select("convert(I_S_D, 'System.String') LIKE '%" & 1 & "%'")
  ' Me.ItemsBindingSource.Filter = "convert(I_S_D, 'System.String') LIKE '%" & 1 & "%'"
  ItemsDataGridView.Refresh()

推荐答案

ok得到它

i需要在我过滤之前验证:)



ok got it
i need to validate before i filter :)

Me.Validate()
      Me.ItemsBindingSource.EndEdit()
      Me.TableAdapterManager.UpdateAll(Me.DATABASEDataSet)


这篇关于datagridview没有显示第1行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆