DataGridView Inserted Column showing no data

L

LuvinLunch

Hi,

I’m loading a datagridview and once it’s loaded I’m adding a new
column that combines two of the columns into one. So i’m doing a
string concatenate of two cols into the new column I’ve inserted.
When I debug I can see that the string is populating into the new
column and when I finish debugging I can see that the new column is
inserting into the grid but the column is empty when the grid is fully
loaded. Anyone any ideas why?

Just to confuse me further, the code that creates the new column,
populates it and inserts is called on a different form and works
perfectly. I’ve isolated my page to make sure that I’m calling the
correct grid so it’s not that I’m writing to the wrong grid. I’ve
also tried hard coding a string to the inserted column but it’s not
showing that.

I thought it had to be a setting on the grid that’s not working but
I’ve replaced the non-working grid with the working grid but it’s
still now working.

Could anyone suggest anything I could try as at the moment I’m
stumped?

Thanks

LL
 
C

Cor

Luvin,

Just an advice, get away from regarding to the DataGridView as a kind of
Excel replacement.

It is a Data control, which assumes that it can be used with a List,
Collection or Dataset/Datatable to call some.

In those you can combine easily values of columns or properties.

Cor

"LuvinLunch" wrote in message

Hi,

I’m loading a datagridview and once it’s loaded I’m adding a new
column that combines two of the columns into one. So i’m doing a
string concatenate of two cols into the new column I’ve inserted.
When I debug I can see that the string is populating into the new
column and when I finish debugging I can see that the new column is
inserting into the grid but the column is empty when the grid is fully
loaded. Anyone any ideas why?

Just to confuse me further, the code that creates the new column,
populates it and inserts is called on a different form and works
perfectly. I’ve isolated my page to make sure that I’m calling the
correct grid so it’s not that I’m writing to the wrong grid. I’ve
also tried hard coding a string to the inserted column but it’s not
showing that.

I thought it had to be a setting on the grid that’s not working but
I’ve replaced the non-working grid with the working grid but it’s
still now working.

Could anyone suggest anything I could try as at the moment I’m
stumped?

Thanks

LL
 
L

LuvinLunch

Hey Cor,

I appreciate the advice as I'm just learning .net. Are you suggesting
that I need to combine my data in the database and only use the
DataGridView to render my data? If not, what would you suggest I use?
I'm migrating code and haven't re-written the stored procedures so
that could be my problem.

Thanks

LL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top