L leng0601 Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-11 #1 谁能告诉我DbgridEh 某一列存不存在时怎么判断(比如我要Pricep这列,但DBgridEh栏目上我没增加,怎么判断),急。。。。。。。
Y yunxi126 Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-11 #2 if dbgrideh1.datasource.dataset.FieldList.Find('aa')<>nil thenShowMessage('a')elseShowMessage('b');
B bsense Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-11 #3 datasource.dataset can found field in dataset ,but may be not in grid ,this method can do this, if assigned(DBGrid1.Columns) then if lowercase(DBGrid1.Columns.fieldname)='pricep' then found := true;
datasource.dataset can found field in dataset ,but may be not in grid ,this method can do this, if assigned(DBGrid1.Columns) then if lowercase(DBGrid1.Columns.fieldname)='pricep' then found := true;
D denjin98 Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-11 #5 for i:=0 to DBGrid1.Columns.Count-1 do begin if DBGrid1.Columns.Items.Field.AsString='pricep' then ....... end;
for i:=0 to DBGrid1.Columns.Count-1 do begin if DBGrid1.Columns.Items.Field.AsString='pricep' then ....... end;
L lasmai Unregistered / Unconfirmed GUEST, unregistred user! 2009-03-11 #7 如果是fieldname 这样就好了dbgrideh1.datasource.dataset.findfield('Pricep') <> nil
D dgtg0710 Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-24 #8 trydbgrideh.fieldcolumn[FieldName]except//出错说明不存在end;dbgrideh1.datasource.dataset.findfield('Pricep') <> nil 这个只是基DataSet里有时DataSet里有,但DBGrid里没有,用for 是可以得到
trydbgrideh.fieldcolumn[FieldName]except//出错说明不存在end;dbgrideh1.datasource.dataset.findfield('Pricep') <> nil 这个只是基DataSet里有时DataSet里有,但DBGrid里没有,用for 是可以得到