您好我想在gridview中更改TankLevel1列的值或文本。
如果TankLevel1等于0我想在TankLevel1列上显示“Tank 1 is offline”。
我试过这样的 TankLevel1在SQL
中是整数<dx:GridViewDataProgressBarColumn
Settings-AllowAutoFilter=False Settings-AllowGroup=False Settings-AllowSort=False FieldName="TankLevel1" Caption="Tank Level 1">
<PropertiesProgressBar Width="" Height=""/>
<Settings AllowAutoFilter="False" AllowSort="False" AllowGroup="False"/>
</dx:GridViewDataProgressBarColumn>
protected void myGrid_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
{
if (e.Column.FieldName == "TankLevel1 ") return;
if (e.Value.Equals(50))
{
e.DisplayText = "Tank 1 is offline";
}
}