Click here to Skip to main content
15,898,942 members
Home / Discussions / C#
   

C#

 
AnswerRe: Make a widget (like the old konfabulator) in C# Pin
Christian Graus18-Jun-07 15:33
protectorChristian Graus18-Jun-07 15:33 
GeneralRe: Make a widget (like the old konfabulator) in C# Pin
ksno0418-Jun-07 17:05
ksno0418-Jun-07 17:05 
GeneralRe: Make a widget (like the old konfabulator) in C# Pin
Mark Greenwood18-Jun-07 17:38
Mark Greenwood18-Jun-07 17:38 
QuestionFill a DataGridView with data from 2 related tables Pin
aecordoba18-Jun-07 13:19
aecordoba18-Jun-07 13:19 
AnswerRe: Fill a DataGridView with data from 2 related tables Pin
RepliCrux18-Jun-07 14:14
RepliCrux18-Jun-07 14:14 
AnswerRe: Fill a DataGridView with data from 2 related tables Pin
I.explore.code18-Jun-07 18:50
I.explore.code18-Jun-07 18:50 
GeneralRe: Fill a DataGridView with data from 2 related tables Pin
aecordoba19-Jun-07 3:21
aecordoba19-Jun-07 3:21 
AnswerRe: Fill a DataGridView with data from 2 related tables Pin
aecordoba21-Jun-07 11:29
aecordoba21-Jun-07 11:29 
Hi, fellows!

When I was trying the solutions you recommended to me, I found a third way to solve my problem (and I think it work so good).

1. I created a DataGridView and I chose as Data Source, the Binding Source of the first table.
2. I added unbound columns to the DataGridView according to the second table.
3. I added a handler for DataBindingComplete event of the DataGridView.
4. I added the following code in that handler in order to fill the cells corresponding to the second table:
<br />
            foreach (DataGridViewRow listRow in listDataGridView.Rows)<br />
            {<br />
                int addressId = (int)listRow.Cells[2].Value;<br />
<br />
                CompaniesDataSet.AddressesRow addressRow =                 companiesDataSet.Addresses.FindByAddressId(addressId);<br />
                listRow.Cells[4].Value = addressRow.Address;<br />
                listRow.Cells[5].Value = addressRow.City;<br />
                listRow.Cells[6].Value = addressRow.ZIPCode;<br />
                listRow.Cells[7].Value = addressRow.State;<br />
            }<br />
<br />


(I hope you can understand my explanation because my English is not so good.)

Thank you very much, again.

--
Adrián Córdoba

QuestionA couple thread questions Pin
Marc Clifton18-Jun-07 9:58
mvaMarc Clifton18-Jun-07 9:58 
AnswerRe: A couple thread questions Pin
Luc Pattyn18-Jun-07 10:30
sitebuilderLuc Pattyn18-Jun-07 10:30 
AnswerRe: A couple thread questions Pin
Jimmanuel18-Jun-07 10:44
Jimmanuel18-Jun-07 10:44 
GeneralRe: A couple thread questions Pin
Marc Clifton18-Jun-07 11:06
mvaMarc Clifton18-Jun-07 11:06 
AnswerRe: A couple thread questions Pin
Luc Pattyn18-Jun-07 10:44
sitebuilderLuc Pattyn18-Jun-07 10:44 
Questionhelp me (F1) Pin
eiman jamnezhad18-Jun-07 8:58
eiman jamnezhad18-Jun-07 8:58 
GeneralI would try, if you asked something! Pin
Martin#18-Jun-07 9:02
Martin#18-Jun-07 9:02 
Generalthanks Pin
eiman jamnezhad18-Jun-07 9:21
eiman jamnezhad18-Jun-07 9:21 
AnswerYou are wellcome! Pin
Martin#18-Jun-07 9:43
Martin#18-Jun-07 9:43 
GeneralRe: You are wellcome! Pin
eiman jamnezhad18-Jun-07 11:41
eiman jamnezhad18-Jun-07 11:41 
QuestionRe: help me (F1) Pin
Guangli(Glen) Liu18-Jun-07 9:48
professionalGuangli(Glen) Liu18-Jun-07 9:48 
GeneralRe: help me (F1) Pin
Guffa18-Jun-07 12:07
Guffa18-Jun-07 12:07 
QuestionKill session in terminal server Pin
Guangli(Glen) Liu18-Jun-07 7:16
professionalGuangli(Glen) Liu18-Jun-07 7:16 
AnswerRe: Kill session in terminal server Pin
\laddie18-Jun-07 19:06
\laddie18-Jun-07 19:06 
Questionadd reference to a .exe Pin
cmarmr18-Jun-07 7:03
cmarmr18-Jun-07 7:03 
AnswerRe: add reference to a .exe Pin
Dave Kreskowiak18-Jun-07 7:36
mveDave Kreskowiak18-Jun-07 7:36 
GeneralRe: add reference to a .exe Pin
cmarmr18-Jun-07 9:05
cmarmr18-Jun-07 9:05 

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.