VB.net Datagridview, bind combobox with different datasources -


i'm having hard time figuring out how bind items datasource in each row in each combobox in datagridview.
basically, have 3 columns, 1st , 2nd rows texts while third row combobox.
1st row question category
2nd row question
3rd row answer each question

the answer varies per question, that's why answer set combobox.

this i've got far..

for each question crm.domain.entities.campaigndb.campaignquestion in questions     'get question category     questioncategorystr = questioncategory.find(function(column) column.questioncategoryid = question.questioncategoryid)     'filter answers     answerstr = answers.findall(function(column) column.campaignquestionid = question.campaignquestionid)       dim dgvcc new datagridviewcomboboxcell      dgvcc          .datasource = answerstr          .valuemember = "campaignanswerid"           .displaymember = "answer"      end       'this add rows question category , question,       dgvsurveyquestions.rows.add(questioncategorystr.categoryname, question.question)      'however, if      dgvsurveyquestions.rows.add(questioncategorystr.categoryname, question.question, dgvcc)      'it throws error "datagridview default error dialog" next 

sample image of error

lol okay it..

 dgvsurveyquestions.rows.add(questioncategorystr.categoryname, question.question)  dgvsurveyquestions.item(2, rowindex) = dgvcc 

rowindex counter starts 0 , increments loop progresses.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -