doctor cesar doctor cesar - 9 months ago 20
C# Question

Datagrid doesn't show older data

I have 2 datagrids. ultraGrid1 and ultraGrid2.

Ultragrid1 has newest values and Ultragrid2 has older Ultragrid1 values.

However, It always shows the same newest data not older one.

public void getAllTopActivityData()
dtTopAllTemp.Clear(); // Clear the all rows before new values

odagetTopAllTemp = new OracleDataAdapter(getTopAll, oradb);
odagetTopAllTemp.Fill(dtTopAllTemp); // get new rows

ultraGrid1.DataSource = dtTopAllTemp; // Shows new rows
ultraGrid2.DataSource = dtTopAllTempOld; // Shows older rows

dtTopAllTempOld = dtTopAllTemp; // Set Older rows to the datatable

Answer Source

Try changing this;

dtTopAllTempOld = dtTopAllTemp();

to this;

dtTopAllTempOld = dtTopAllTemp.Copy();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download