I am trying to bind a collection (that inherits from BindingList) to a DataGridView. The grid headers show up fine and the I get the number of rows that I expect. However, the cells are empty. Has anyone else had this problem? If so, how did you resolve it? I've talked to someone else who had the same problem but they can't remember how they resolved it. I've tried to create a simple version that shows the problem but haven't had any luck. So I'm sorry, I haven't included any code.
EDIT #1:
I don't think this code will help but just in case. I have simplified things in order to prevent from having to outline the 47 layers of our code. But like I said, I can't recreate the problem with a very simple example like this. I'm not really wanting code analysis--just words of wisdom from those who have run into this problem. Surely I'm not the only one.
public interface ISearchResultCollection : IList<ISearchResult>
{
...
}
public class SearchResultCollection : BindingList<ISearchResult>, ISearchResultCollection
{
...
}
public interface ISearchResult
{
ILineNum LineNumber {get; set;}
string Text {get; set;}
}
public class SearchResult
{
...
}
ISearchResultCollection results = objectToSearch.Find("searchstring");
dataGridView1.DataSource = results;
EDIT #2:
I think I've got a lead. All of the public properties on my interface that represents an item (ISearchResult) are interface types as well. I added a string property and its data is magically showing up. So, in the above example, the Text column's data would show up. But, the LineNumber column's data would not since it is of an interface type (ILineNum). I figured ToString() would be called to populate the grid on these. Any ideas now?