I was unable to find a way of manipulating the properties of either the BoundField or the TemplateField declaratively based on the DetailView's data.
Bendewey very charitably assumed I was binding to a business object when in fact I am dealing with the data directly in this instance - apologies for not making that clear.
My solution in the code behind was the following:
protected void DetailsView1_DataBound(object sender, EventArgs e)
{
DetailsView dv = (DetailsView)sender;
if (dv.DataItemCount > 0)
{
DataRowView data = (DataRowView)dv.DataItem;
bool isFixed = (bool)data["IsFixed"];
if (isFixed)
{
dv.Rows[2].Enabled = false;
dv.Rows[6].Enabled = false;
}
}
}
I was disapointed that I had to reference the rows I wanted to disable by index. Possibly there's a way of referencing these rows by their data field without iterating through all the rows, but I couldn't find it at first glance.
Thanks for the help!