Hi Michal,
Thanks for your update.
Query1:Grid binds first data source after refresh
We are Sorry for the inconvenience caused.Your Reported query is " Data source automatically
changing after click event" actual reason of the error is because of post back. If we click
plus/minus button it triggers post back event. I think your grid binds first data source in on load event.Then in every post back event your grid bind first data source only. You need to check "ispostback" condition in on load to avoid this error.
Please refer the following code snippet:
[Code behind]
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
bindDataSource();
bindDataSource1();
GridRelationDescriptor childrelationdescriptor = new GridRelationDescriptor();
childrelationdescriptor.ChildTableName = "Product";
childrelationdescriptor.RelationKind = RelationKind.RelatedMasterDetails;
childrelationdescriptor.RelationKeys.Add("ID", "ID");
GridGroupingControl1.TableDescriptor.Relations.Add(childrelationdescriptor);
this.GridGroupingControl1.Engine.SourceListSet.Add("details", list);
this.GridGroupingControl1.Engine.SourceListSet.Add("Product", list1);
this.GridGroupingControl1.DataMember = "DefaultView";
this.GridGroupingControl1.DataSource = list;
this.GridGroupingControl1.TableDescriptor.Name = "details";
}
this.ChangeDatasource.Click +=new EventHandler(Serialize_Click);
}
Query 2: strange behavior with child table.if I open another child table,the old table is closed.
Your second query is also related with first query. IsPostBack is the resolution for this two query.
For your convenience, We have created the sample and the same it can be download from below link:
datasourcechang1772136206.zipPlease let us know if any other concerns.
Regards.
Yogesh R.