gridview单元格以填充另一个gridview单元格 [英] gridview cell to populate another gridview cell

查看:131
本文介绍了gridview单元格以填充另一个gridview单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有2个gridview表...通过datbound从下拉列表中填充1个.例如,当用户从下拉列表中选择tameside cc时,数据库中保存的所有有关tameside的详细信息都显示在下面的gridview中.一列是他们的companyID,
现在,如果第二个gridview中的companyID为空白,则需要使用所选的第一个gridview表中的companyID填充我的第二个gridview表.有谁知道我该怎么做

到目前为止,如果第二个gridview中的companyid为空白,则可以使用以下代码更改背景的颜色:

 如果(例如,Row.Cells( 11 ).Text = "   e.Row.Cells(  11 ).Text = " )然后
          e.Row.Cells( 11 ).BackColor = System.Drawing.Color.Salmon
          importButtonEnabled = 错误
      结束 如果 


谢谢您的帮助:-)

解决方案

非常感谢您的所有帮助,我现在设法使用以下代码对其进行排序.

 如果(例如,Row.Cells( 11 ).Text = "   e.Row.Cells(  11 ).Text = " )然后
    e.Row.Cells( 11 ).Text = GridCompany.DataKeys( 0 )(" ).ToString()
结束 如果 


hi
i have 2 gridview tables... 1 is populated from a dropdown list by datbound.e.g when the user select tameside cc from the dropdown list all the details about tameside that are saved on the database are displayed in the gridview below. One column is their companyID,
now i need to populate my second gridview table with the companyID from the selected FIrst gridview table, if the companyID in the Second gridview is blank. Does anyone know how i can do this please

so far i can change the colour of the background if the companyid in second gridview is blank using the following code:

If (e.Row.Cells(11).Text = "" Or e.Row.Cells(11).Text = " ") Then
          e.Row.Cells(11).BackColor = System.Drawing.Color.Salmon
          importButtonEnabled = False
      End If


thanks for any help :-)

解决方案

hi many thanks for all the help, i have manage to sort it now using the following code.

If (e.Row.Cells(11).Text = "" Or e.Row.Cells(11).Text = " ") Then
    e.Row.Cells(11).Text = GridCompany.DataKeys(0)("compDataID").ToString()
End If


这篇关于gridview单元格以填充另一个gridview单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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