Question How to Add Rows to a custom Datagridview column

viper5646

Active member
Joined
Jan 20, 2009
Messages
38
Location
Canada
Programming Experience
Beginner
Hi;)

I have a Datavridview that is working which includes the customer information an Order that is Hidden, an empty custom column named "Order Number" .
The App. gets its data from an Access Database .
I create the new Order number by attaching the country to the Hidden number
for example Ordernum = Order + Country the result would be
14523cnd .
How can I add the Ordernum to the custom Order Number column in the respective index.

Thanks
 
I've read your post several times and I still don't really understand it. Can you ask it a different way?
 
OK.
Lets see if you understand this way.

This is my Datagridview:

ID Name Address City Country OrderNumber
56 John Doe 54 Dundas Toronto Canada

The OrderNumber is generated by adding 1000+ID+CountryCoed ex. 1056CND . I Have no problem in creating the Order Number.
My question is how can I add the 1056CND to the order Number in the Datagridview.
The number needs to be assign to the ID that was generated from.

Thanks.
 
Add a data column to the table and set the Expression property, for example:
1000 + ID + CountryCoed
 
Thank you for your reply.
I have added another column to the table as follows.
CustumerOrder.CustGrid.Columns(7).HeaderText = "Order #"

Since this is my first app. can you show me how to go about addinfg the expression property.
 
John said to add a column to the underlying store of data; the DataTable, not the grid. The grid only shows what it finds in the model. True that you'll have to add a column in the grid that references the data column, but you have to add the datacolumn in order to have something to reference


See the documentation DataColumn.Expression Property (System.Data)
 
Back
Top