>You are right and they look terrible being so dimmed you can hardly tell if they are checked or not. I think I may have figured out why I was getting a bad result appearing to not be bound at all. I do not like them however in this very dimmed state. I do not need to edit any rows in this situation however.
If you use a templated control you have a bit more control over it's appearance.
>>
>>>How about if I want to display an enumeratin value that corresponds to an integer in the data within a datagrid? So if I have a type column that can be a 0, 1, or 2 value but I want to display in the datagrid "Message", "Tip", "Location".
>>
>>if you simply want to display these values, you can (again) create a template column with no control inside.
>>In the RowDataBound event of the gridview, you can modify the "Text" property of the "cell" in that particular column.
>
>Thanks, I am going to give this a try today just so I know how to do this.
If it's display only, this is probably the simplest approach. Just cast the value back to the enum and convert it to a string. If you actually need to support editing, I generally just create a user control and add a drop down list to it. There isn't a direct way of binding to it, so you usually just create an array from the enum and use that instead, ex:
public enum SampleList
{
FirstItem,
SecondItem,
ThirdItem,
FourthItem
}
Array names = Enum.GetNames(typeof(SampleList));
Array values = Enum.GetValues(typeof(SampleList));
for (int index = 0; index < names.Length; index++)
{
this.cboEnum.Items.Add(new ListItem(names.GetValue(index).ToString(), values.GetValue(index).ToString()));
}
Then I'll just expose the drop down list's Text property, SelectedValue (among others) and set it in the calling form.