Devexpress 将progressbar添加到cxGrid列的最佳方式是什么
我正在将progressbar添加到第一个网格的带状tableview列的每一行! 我这样做=>我在表单和 btvArrProgGetPropertiesTcxCustomGridTableItem*发送方,TcxCustomGridRecord*记录, TcxCustomEditProperties*&通过更改putted progressbar属性将属性指定给特定行的属性。 这是我的密码Devexpress 将progressbar添加到cxGrid列的最佳方式是什么,devexpress,c++builder,c++builder-2010,Devexpress,C++builder,C++builder 2010,我正在将progressbar添加到第一个网格的带状tableview列的每一行! 我这样做=>我在表单和 btvArrProgGetPropertiesTcxCustomGridTableItem*发送方,TcxCustomGridRecord*记录, TcxCustomEditProperties*&通过更改putted progressbar属性将属性指定给特定行的属性。 这是我的密码 void __fastcall TfMain::btvArrProgGetProperties(TcxC
void __fastcall TfMain::btvArrProgGetProperties(TcxCustomGridTableItem *Sender, TcxCustomGridRecord *ARecord,
TcxCustomEditProperties *&AProperties)
{
if ( StrToInt(ARecord->Values[ARecord->RecordIndex,1])==4 ){
ARecord->Values[ARecord->RecordIndex,0]=100;
AProperties=pCancel->Properties;
}
else
if ( StrToInt(ARecord->Values[ARecord->RecordIndex,1])==2) {
ARecord->Values[ARecord->RecordIndex,0]=100;
AProperties=pDep->Properties;
}
else {
if (StrToInt(ARecord->Values[ARecord->RecordIndex,1])==1) {
if ((ARecord->Values[ARecord->RecordIndex,7])!=0 && (ARecord->Values[ARecord->RecordIndex,12])!=0) {
//now time
nwTm=Now().FormatString("hh:mm:ss");
//get dep time
dpTm=StrToDateTime(ARecord->Values[ARecord->RecordIndex,7]);
dpTm.DecodeTime(&dpH,&dpM,&dpS,&dpMS);
//get reg time
rgTm=StrToDateTime(ARecord->Values[ARecord->RecordIndex,12]);
//find difference between dep and reg
dif=(1.0 + Double(dpTm)-Double(rgTm));
//get difference hours and mins
dif.DecodeTime(&difH,&difM,&difS,&difMS);
//diff between dep and reg in seconds
pReg->Properties->Max=difH*3600+difM*60+difS;
nwTm=Now().FormatString("hh:mm:ss");
nwTm.DecodeTime(&nwH,&nwM,&nwS,&nwMS);
if ((dpH>nwH) || ((dpH>nwH) && (dpM>=nwM ||dpM<=nwM)) || (dpH==nwH && dpM>nwM) ) {
fltRem =(1.0 + Double(dpTm)-Double(nwTm));
fltRem.DecodeTime(&remH,&remM,&remS,&remMS);
_result=remH*3600+remM*60+remS;
pReg->Properties->Text=getTimeBySecs(_result);
ARecord->Values[ARecord->RecordIndex,0]=pReg->Properties->Max-_result;
pReg->Position=- _result;
}
else
{
pReg->Properties->Max=100;
ARecord->Values[ARecord->RecordIndex,0]=100;
pReg->Properties->Text="Готово";
/*
ARecord->Values[ARecord->RecordIndex,0]=pReg->Properties->Max;
pReg->Position=pReg->Properties->Max;
*/
}
AProperties=pReg->Properties;
}
}
}
}
我认为这不是一个解决将progressbar添加到其位置动态更改的列中的问题的好方法,因为当我单击每个列的行时,progressbar的位置会因为最后一个值设置为progressbar而更改
我更喜欢在运行时为它动态创建progressbar集合名称和其他属性,并在GetProperties事件中分配给特定行。
最好的方法是什么?
有关于这个问题的演示吗?如果是,请分享!
提前谢谢 也可调用btvDep->LayoutChangedtrue;在btvDepFocusedRecordChanged事件上!当我单击一行时,它的属性位置会发生变化。。