|
-
May 28th, 2023, 02:39 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] column value not binding to combobox text property
Yes, I have discussed this before. However, I have been looking at it and still cannot figure out what is causing the problem. Here is what I am seeing.
The combobox, cboType displays a specific value from a specific column on a table using the following code:
Code:
cboType.DataBindings.Add("Text",MasterBase.listTable, "colType")
The value that should be displayed from colType is, "Document". The value actually displayed was from colFilePath and was
]C:\Development\FileCabinet\DocMaster\MB100000024\Rev 00
I then changed the binding code for colChangePath.
Code:
cboType.DataBindings.Add("Text", MasterBase.listTable, "colChangePath")
Instead of a value being displayed, i got the following error.

I tried this again, using a different binding approach
Code:
cboType.Text = MasterBase.listTable.Rows(0).Item(X).ToString
I varied X from 4 to 7. While I never received the error, I found that when the value for X=6 (colType) was used, the actual value displayed was for X=7 (colOwner). The value for colType could never be made to display.
Now at this point, I can think of a couple more tests that I can run, but I don't think it will get me any closer to understanding what is causing this phenomenon. Nor does the message telling me that it can't bind to the datamember really help either. I can see that it cannot do that, but I cannot see why.
At this point I believe I have pretty thoroughly checked the code, but have still been unable to find a coding mistake that would cause this set of events. Besides some coding error, what might cause this to happen?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|