加上列名判断
If e.DataCol.Name="关联编号" AndAlso e.DataRow.IsNull("关联编号")=False Then
然后看看 http://www.foxtable.com/webhelp/scr/1453.htm