Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5147
  • Last Modified:

how to refresh a DataGrid

Hi, I am modifying the contents of a DataGrid cell with this line of code:

     toolGrid.dataProvider.getItemAt(row)[field] = tempValue;

However, the change is not displayed on the screen.  If I add a refresh line:

     toolGrid.dataProvider.getItemAt(row)[field] = tempValue;
     toolGrid.dataProvider.refresh();

...the change is reflected on the screen.  However, the modified row is moved from its original position to the top of the DataGrid, causing major confusion by the user.  From their perspective, the row they were editing has disappeared.

Is there a better way to change the contents of a cell and have it appear immediately with nothing else about the DataGrid changing?

thanks

Kevin

0
caherciveen
Asked:
caherciveen
  • 2
1 Solution
 
ChristoferDutzCommented:
What type is your dataprovider?
0
 
ChristoferDutzCommented:
Have you tried the following command, it should run smoother.

toolGrid.invalidateList();

instead of:

toolGrid.dataProvider.refresh();
0
 
caherciveenAuthor Commented:
very nice fix!  works perfectly.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now