2009-06-30 8 views

Antwort

1

Eine Möglichkeit ist etwa so:

<asp:CheckBox ID="CheckBox1" runat="server" 
Checked='<%# (((String)DataBinder.Eval(Container.DataItem, "Status")) == "O")?true:false %>' /> 

und dann haben Sie die Kontrolle in der Code-behind wie:

protected void gvFiles_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
    if (e.Row.RowType == DataControlRowType.DataRow) 
    { 
     if (DataBinder.Eval(e.Row.DataItem, "LastUser").ToString() == "x") 
     { 
      TextBox txtId = gvFiles.FindControl("txtId") as TextBox; 
      txtId.Text = "NA"; 
     } 
    } 

} 
Verwandte Themen