We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Selection, Changes when refresh data

Thread ID:

Created:

Updated:

Platform:

Replies:

11542 Mar 9,2004 11:12 PM UTC Mar 10,2004 05:01 PM UTC Windows Forms 3
loading
Tags: GridControl
Bidin Dinesababu
Asked On March 9, 2004 11:12 PM UTC

Hai, I am using DataBoundGrid, and the contents gets refreshed each time I press a refresh button. But the problem is, when I refresh the contents of the grid, the selection goes to the row just above the current selection. ( Selection shifts one row up each time I refresh the contents). The grid is wired with Filter bar. I update the filterbar, each time I refresh data. Is there any specific reason for this. Is there any means by which I can avoid the same.. THanks in advance, Bidin

Administrator [Syncfusion]
Replied On March 9, 2004 11:20 PM UTC

How are you refreshing the contents of the grid? Are you doing a DataSet.Merge, or changing values directly in the grid using an indexer on the grid, or changing values directly in your datatable, or set a new datasource to the grid, or something else?. Can you post a little sample showing the problem? If not, can you post your code that you use to refresh the contents?

Bidin Dinesababu
Replied On March 10, 2004 04:43 PM UTC

Here is the sample which I use to refresh the grid data within a class derived from DataBoundGrid. _dataSet is a member variable. Which gets merged with the new data. DataSet ds = _dataSet.Clone(); ds.ReadXml(new System.IO.StringReader((xmlData))); _dataSet.Merge(ds, false, MissingSchemaAction.AddWithKey); this.BeginUpdate(); this.FreezePainting = true; this.DataSource = _dataSet.Tables["M"]; this.BringToFront(); this.FreezePainting = false; this.EndUpdate();

Administrator [Syncfusion]
Replied On March 10, 2004 05:01 PM UTC

I don''t really understand how the grid would play a role on how the data is merged into this data set. If you use the same code to update a Windows Forms DataGrid, does the data get positioned properly there? You mentioned a FilterBar in your first post. You might consider unwiring and re-wiring the filterbar (while freezePainting is true) to see if that affects anything? Is there an active filter when this code is being hit?

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;