T
Tester
Hi,
I'm developing a component which implements IListSource. The reference code
is attached at the bottom of this post.
When my component is dropped on the form with DataGrid, DataGrid is able to
bind to my component. The problem is if i select my component in designer go
to properties and change Dynamic name to be used in DataSet's Tables that is
returned in GetList(), DataGrid fails to bind to the newly added Table. BUT
the minute i build the project everything is fine again. As you can see from
the attached code I'm not doing anything unusual. It seems that Designer
pre-caches the DataSource. This is unfortunate.
The detailed error when selecting DataGrid's DataMember is:
"Properties Window"
Invalid property value
Cannot create a child list for field "blah...".
Thank you for any assistance on this
Code snippet:
string _tableName;
public string TableName
{
get { return _tableName; }
set { _tableName = value;}
}
#region IListSource Members
public IList GetList()
{
DataSet ds = new DataSet();
ds.Tables.Add(_tableName);
return ((IListSource)ds).GetList();
}
public bool ContainsListCollection
{
get { return true; }
}
#endregion
I'm developing a component which implements IListSource. The reference code
is attached at the bottom of this post.
When my component is dropped on the form with DataGrid, DataGrid is able to
bind to my component. The problem is if i select my component in designer go
to properties and change Dynamic name to be used in DataSet's Tables that is
returned in GetList(), DataGrid fails to bind to the newly added Table. BUT
the minute i build the project everything is fine again. As you can see from
the attached code I'm not doing anything unusual. It seems that Designer
pre-caches the DataSource. This is unfortunate.
The detailed error when selecting DataGrid's DataMember is:
"Properties Window"
Invalid property value
Cannot create a child list for field "blah...".
Thank you for any assistance on this
Code snippet:
string _tableName;
public string TableName
{
get { return _tableName; }
set { _tableName = value;}
}
#region IListSource Members
public IList GetList()
{
DataSet ds = new DataSet();
ds.Tables.Add(_tableName);
return ((IListSource)ds).GetList();
}
public bool ContainsListCollection
{
get { return true; }
}
#endregion