Hello,

I have 2 tables: news and users

news
- N_id (primary)
- title
- article
- time
- U_id

users
- U_id (primary)
- member

I have managed to create the gridview with edit/add/delete for news only, without incorporating the users who wrote that news article.

My question here is how can I add a column for the member in the main gridview so that whenever I add a new row, I can select a member (id) to go along with the article.

Hello, drugoholic.
The first fast idea that came to me is:
1. Create a DataSource in your project and bind a grid to it (I'm not considering here custom cell renders, so we can focus on the approach).
2. Modify the DataSource (Including it's TableAdapter and DataSet) to return the given query. You can easily write your own sql-commands in SelectCommand (or other similar) property.
3. Voala! You have customized data displayed in your grid.

This is just a base idea. But, as for me, it's better to write the custom dataSource to achieve this (I guess, it would be more clean solution :)).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.