标签:ar os sp for 数据 on bs ad ef
前台页面
</f:TemplateField>
<f:TemplateField HeaderText="普通巡检频次" Width="60px">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text=‘<%# GetFrequency(Eval("freq")) %>‘></asp:Label>
</ItemTemplate>
</f:TemplateField>
后台
private Area[] arr;
private void LoadData()
{
arr = DB.Areas.ToArray(); //数据准备
// 每页记录数
Grid1.PageSize = ConfigHelper.PageSize;
ddlGridPageSize.SelectedValue = ConfigHelper.PageSize.ToString();
BindGrid();
}
protected string GetFrequency(object freq)
{ string tmpStr = "";
var tmpInt = Convert.ToInt32(freq);
foreach (var a in arr)
{
if (a.ID == tmpInt)
{
tmpStr = a.Name;
break;
}
}
return tmpStr;
}
标签:ar os sp for 数据 on bs ad ef
原文地址:http://www.cnblogs.com/xihong2014/p/4099476.html