Hi,
it turns out we need the ability to add child records. Therefore we use Master-Details View and record preview is not needed.
But there are some issues with programmic expandng of Details. We would like to expand 3 topmost Details for user reference.
I have modified the DetailsView demo to illustrate the issues:
1) we need to call Application.DoEvents();
2) Every expansion incurs a noticeable delay, because grid is invalidated.
Gif.
Perhaps there could be a new method ExpandDetailsViewInRange(from, to)?
public Form1()
{
InitializeComponent();
SampleCustomization();
this.WindowState = FormWindowState.Maximized;
this.Shown += Form1_Shown;
}
private void Form1_Shown(object sender, EventArgs e)
{
Application.DoEvents();
this.sfDataGrid1.ExpandDetailsViewAt(0);
Application.DoEvents();
this.sfDataGrid1.ExpandDetailsViewAt(1);
Application.DoEvents();
this.sfDataGrid1.ExpandDetailsViewAt(2);
Application.DoEvents();
this.sfDataGrid1.ExpandDetailsViewAt(3);
Application.DoEvents();
}