Hi,
In winforms, I set datasource on a UltraGrid from DataSet with only 1 table.
The Grid is OK, data are well displayed.
When DataSet changes (Stored procedure with parameter), i reset the DataSource but the Grid doesn't change !
ultraGrid.Refresh() doesn't refresh anything. I tried manything ...
if (ds != null) { ds.Tables.Clear(); ds.Clear(); } if (ds2 != null) { ds2.Tables.Clear(); ds2.Clear(); }
ds2 = Library.BLL.GetCRA(out error, dateSelect);
ds.Tables.Add(ds2.Tables[0].Clone());
for (int x = 4; x < ds.Tables[0].Columns.Count; x++) ds.Tables[0].Columns[x].DataType = typeof(int);
foreach (DataRow dr in ds2.Tables[0].Rows) ds.Tables[0].ImportRow(dr);
grdCRA.DataSource = ds; grdCRA.DataBind();grdCRA.Refresh();
Thanks for your response. If you have any questions, feel free to write us
I Found the problem.
I'm importing ds2 into ds when parameter has changed.doing :ds.dispose();ds = new DataSet();[...] importing ds2 into dsGrid.DataSource = ds;
Clear the problem :)
Thank you for your time. Sorry.
Already checked the Data with
ds.WriteXml(@"d:\test5.xml");
Xml changes normally.
I tried : grdCRA.DataSource = ds;grdCRA.DataBind();grdCRA.Rows.Refresh(RefreshRow.ReloadData, true);grdCRA.Refresh();
With and Without "DataBind" and "Refresh". Nothing Change.
I tried toogrdCRA.DataSource = null;
The Grid is Editable with Summary and can be grouped by columns.
Hello UCF_user,
Thanks for attached code. Could you please verify (using a break point or debug message) that your ds contains data after changes through stored procedure. After that you could try one of these options below:
Option 1: Please try to call :
this.grdCRA.Rows.Refresh(Infragistics.Win.UltraWinGrid.RefreshRow.ReloadData, true);
Option 2: Maybe you could try to set:
grdCRA.DataSource = Null;
grdCRA.DataSource = ds;
Please let me know if you have any questions.