public int? ID {get; set; } public String DisplayName {get; set;}
public string DisplayValue {get { return DisplayName; } }
//PickListItemClass
public PicklistItem(IPickListItem item, bool enabled)
{
ID = item.ID;
Description = item.DisplayValue;
Enabled = enabled; }
//bind data
bindingSource1.DataSource = data;
dgvSearch.AutoGenerateColumns = false;
dgvSearch.DataSource = data.ToSortableBindingList();
private void btnSearch_Click(object sender, EventArgs e)
{
BindData();
if (bindingSource1.Count <= 0)
{
MessageBox.Show("No results returned. Clear your search and enter a new case.");
return;
}
dgvSearch.DataSource = bindingSource1;
}
How do I get my dgv to display name? InvestigatorName=John Doe; InvestigatorID=2. I need the name, but I get ID.
Thank you in advance.