Click here to Skip to main content
15,899,825 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Related value in Datagridviewcolumn Pin
amit k mistry23-Jul-09 6:53
amit k mistry23-Jul-09 6:53 
GeneralRe: Related value in Datagridviewcolumn Pin
Sergiev23-Jul-09 10:04
Sergiev23-Jul-09 10:04 
Thank you very much for your reply!

I will take a look.

Anyway I will try to clarify myself by pseudo-code.

Consider DB with two tables:

table "payments" with the following structure:

"p_id" int,
"price" int,
"empl_id" int

and "employees":
"empl_id" int,
"empl_name" varchar /* this I want to get later */

It is not difficult to bind the DataGridView control to the "payments" table.

In the form I define the following columns (binding them to corresponding columns in data source):
datagridview.Columns("pay_id").DataPropertyName = "payments"."p_id"
datagridview.Columns("price").DataPropertyName = "payments"."price"
datagridview.Columns("empl_id").DataPropertyName = "payments"."empl_id"

And here is it, I want to have a column which displays the employee's name taking it from table "employees". Something like:

datagridview.Columns("empl_name").DataPropertyName = "employees"."empl_name"

This column should refresh every time the user changes the value of datagridview.Columns("empl_id") providing him with the name of the employee.

But there is no way (at least I don't know how) to define another data source for DataGridViewTextBox column. May be I need to populate manually the cell with the employee's name fetching it from dataset relation.

Previously I hadn't used .NET for data entry forms which is my primary fields so I am not very certain about its classes and their properties.

Thanks and regards,
GeneralRe: Related value in Datagridviewcolumn Pin
Infarkt25-Jul-09 15:29
Infarkt25-Jul-09 15:29 
QuestionOleDbParameter and "IS NOT NULL" Pin
:o:k:23-Jul-09 0:32
:o:k:23-Jul-09 0:32 
AnswerRe: OleDbParameter and "IS NOT NULL" Pin
:o:k:24-Jul-09 3:02
:o:k:24-Jul-09 3:02 
AnswerRe: OleDbParameter and "IS NOT NULL" Pin
Jack Vanderhorst25-Jul-09 4:20
Jack Vanderhorst25-Jul-09 4:20 
Questionabout ajax Pin
sapna sangole22-Jul-09 20:59
sapna sangole22-Jul-09 20:59 
AnswerRe: about ajax Pin
Pete O'Hanlon22-Jul-09 22:03
mvePete O'Hanlon22-Jul-09 22:03 
AnswerRe: about ajax Pin
Baran M22-Jul-09 22:47
Baran M22-Jul-09 22:47 
QuestionRegistry Manipulation - Odd behaviour Pin
Tristan Rhodes22-Jul-09 6:31
Tristan Rhodes22-Jul-09 6:31 
AnswerRe: Registry Manipulation - Odd behaviour Pin
led mike22-Jul-09 6:54
led mike22-Jul-09 6:54 
GeneralRe: Registry Manipulation - Odd behaviour Pin
Luc Pattyn22-Jul-09 7:11
sitebuilderLuc Pattyn22-Jul-09 7:11 
GeneralRe: Registry Manipulation - Odd behaviour Pin
led mike22-Jul-09 7:19
led mike22-Jul-09 7:19 
GeneralRe: Registry Manipulation - Odd behaviour Pin
Luc Pattyn22-Jul-09 7:23
sitebuilderLuc Pattyn22-Jul-09 7:23 
GeneralRe: Registry Manipulation - Odd behaviour Pin
led mike22-Jul-09 7:26
led mike22-Jul-09 7:26 
GeneralRe: Registry Manipulation - Odd behaviour Pin
Luc Pattyn22-Jul-09 7:52
sitebuilderLuc Pattyn22-Jul-09 7:52 
GeneralRe: Registry Manipulation - Odd behaviour Pin
Tristan Rhodes22-Jul-09 23:04
Tristan Rhodes22-Jul-09 23:04 
AnswerRe: Registry Manipulation - Odd behaviour Pin
Luc Pattyn22-Jul-09 7:09
sitebuilderLuc Pattyn22-Jul-09 7:09 
GeneralRe: Registry Manipulation - Odd behaviour Pin
Tristan Rhodes22-Jul-09 23:21
Tristan Rhodes22-Jul-09 23:21 
GeneralRe: Registry Manipulation - Odd behaviour Pin
Luc Pattyn23-Jul-09 0:20
sitebuilderLuc Pattyn23-Jul-09 0:20 
Question[Message Deleted] Pin
ksss_maheshece22-Jul-09 3:21
ksss_maheshece22-Jul-09 3:21 
AnswerRe: How can Embed a xml file? Pin
led mike22-Jul-09 5:49
led mike22-Jul-09 5:49 
GeneralRe: How can Embed a xml file? Pin
Mark Salsbery22-Jul-09 6:10
Mark Salsbery22-Jul-09 6:10 
GeneralRe: How can Embed a xml file? Pin
led mike22-Jul-09 6:12
led mike22-Jul-09 6:12 
GeneralRe: How can Embed a xml file? Pin
Mark Salsbery22-Jul-09 6:23
Mark Salsbery22-Jul-09 6:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.