<dx:GridViewDataTextColumn Caption="勾选" ShowInCustomizationForm="True" VisibleIndex="1" Width="76%">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle">
</CellStyle>
<DataItemTemplate>
<center>
<dx:ASPxRadioButtonList ID="ASPxRadioButtonList_mmcpxx" runat="server" RepeatColumns="3"
RepeatDirection="Horizontal" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="ASPxRadioButtonList_mmcpxx_SelectedIndexChanged"> ToolTip='<%# Eval("ID") %>'
<ClientSideEvents SelectedIndexChanged="function(s, e) {onCallbackStart();}" />
</dx:ASPxRadioButtonList></center>
</DataItemTemplate>
</dx:GridViewDataTextColumn>
protected void ASPxGridView_mzcp_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
{
员工 yg = (员工)Session["dncp203"];//登陆者,可以是考评人,有可能是其他所有类型员工
//找到分数标签
//ASPxCheckBox cbx = ASPxGridView_glyplxk.FindRowCellTemplateControl(e.VisibleIndex, null, "cbk_gv_wdxk") as ASPxCheckBox;
ASPxRadioButtonList rbl = ASPxGridView_mzcp.FindRowCellTemplateControl(e.VisibleIndex, null, "ASPxRadioButtonList_mmcpxx") as ASPxRadioButtonList;
if (rbl != null)
{
//先初始化绑定当前学校的测评等级名称
var cx_dj = from aa in sjklj.民主测评等级
where aa.单位id == yg.单位id
select aa;
rbl.TextField = "等级";
rbl.ValueField = "等级";
rbl.DataSource = cx_dj;
rbl.DataBind();
//定位到对那个被测评人打分
int bcpid = int.Parse(e.KeyValue.ToString());//员工主键,被测评人id
rbl.ToolTip = bcpid.ToString();
int kpid = yg.ID;//考评者id
var cx_kpfs = from aa in sjklj.被测评人分数明细
where aa.单位id == yg.单位id && aa.被测评人id == bcpid && aa.测评人id == kpid
select aa;
if (cx_kpfs.Count() > 0)
{
// rbl.SelectedIndex = cx_kpfs.First().民主测评等级 == null ? -1 : Math.Round(((double)cx_kpfs.First().组织考评分), 1).ToString();
if(cx_kpfs.First().民主测评等级 == null)
{
rbl.SelectedIndex = -1;//不选择任何一个
}
else
{
rbl.Items.FindByText(cx_kpfs.First().民主测评等级).Selected = true;
}
}
else
{
rbl.SelectedIndex = -1;//不选择任何一个
}
}
}