1。每行前面有一个类似CheckBox的选择框,用以标识该行是否选中
数据库不用建字段,在写SQL是用虚拟字段select convert(bit,1) selFlag from EveryTable
2。每行的颜色可任意控制或可由一个字段的值来控制
给出一段代码给与参考
procedure Tfrom1.DBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin
if (Rect.Top = DBGridEh1.CellRect(DBGridEh1.Col, DBGridEh1.Row).Top) and (not
(gdFocused in State) or not DBGridEh1.Focused) then
begin
DBGridEh1.Canvas.Font.Color :=clBlack;
DBGridEh1.Canvas.Brush.Color := $00FEEFF0;
end;
DBGridEh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
3。取出选中行的值
即数据集当前记录的值
4。最好给出源码
这个问题很太难了
^_^