Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1370
UltraGrid doesn't refresh after setting DataSource
posted

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();

Parents
No Data
Reply
  • 53790
    posted

    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.

     

     

Children