I have 2 tables: news and users

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

- 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.

6 Years
Discussion Span
Last Post by Antenka

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 :)).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.