Hi,

I have a datagrid that I load some data into through a dataset.

Then I have som other controles, textboxes, where I can enter new posts into
my result, database.

When I have enterd a new post, I want to reload the data in the datagrid and
select the added post. Everything works fine exept the text that is kind of
selected. Itīs not really selected beacuse i progamatically select another
row, that get blue. This cell is grey and the text in it is not updated
untill I click another cell. So if I scroll up and down in my datagrid the
previous cell that was selected before thae update of the datagrid is still
semiselected and "replaces" the data of the other cells as long as it is on
top of them.

Hope that you understand my problem.

This is some of my code that I use to update and reload my datagrid:

//Reload the data into the datagrid
dataGridDiscountHolders.DataSource = null;
dataGridDiscountHolders.DataBindings.Clear();

DataSet mDiscountHolders = new DataSet("DiscountHolders");
mDiscountHolders = SQLGetData.getDiscountHolders(); //This method returns
my dataset
mDiscountHolders.Tables[0].TableName = "DiscountHolders";
dataGridDiscountHolders.DataSource = mDiscountHolders.Tables[0];

//Set my newly added row to selected, var newlyAddedRow contains that id,
this part works fine.
for(int i = 0; i <
((DataTable)dataGridDiscountHolders.DataSource).Ro ws.Count; i++)
{
if(Convert.ToInt32(((DataTable)dataGridDiscountHol ders.DataSource).Rows[i][0].ToString())== newlyAddedRow) { dataGridDiscountHolders.Select(i); dataGridDiscountHolders.CurrentRowIndex = i; } else dataGridDiscountHolders.UnSelect(i);}dataGridDisco untHolders.Update();dataGridDiscountHolders.Refres h();If anyone could give me some tips to remove the previous selected text, Iwould be very greateful!/Robert