Hi there,
I have a iOSTable with different CustomCells for each Row, and at LoadTable() I access different controls on each type and set some Textfields.
Then, by pressing Toolbar (Save) I would like to Loop Through all Rows in the iOSTable and fetch the data that is typed in each row and save the Answers to SQLite. But as each Row contains different CustomCellType, how can I get the Type of each row? so I can make a Select Case and fetch the data from the correct field? Here’s how I create the table:
While Not rs.EOF
Var QuestType As QuestionTypes = CType(rs.Field(“Type”).IntegerValue, QuestionTypes)
Var cell As iOSTableCellData
Select Case QuestType
Case QuestionTypes.Text
cell = tbl_ReportQuestions.CreateCustomCell(GetTypeInfo(Question_Textbox))
Dim container As Question_Textbox = Question_Textbox(cell.Control)
container.SetValues( _
rs.Field("ID").IntegerValue, _
rs.Field("Question").TextValue, _
rs.Field("Answer").TextValue _
)
Case QuestionTypes.Boolean
cell = tbl_ReportQuestions.CreateCustomCell(GetTypeInfo(Question_Boolean))
Dim container As Question_Boolean = Question_Boolean(cell.Control)
Case QuestionTypes.Number
cell = tbl_ReportQuestions.CreateCustomCell(GetTypeInfo(Question_Number))
Dim container As Question_Number = Question_Number(cell.Control)
Case QuestionTypes.Rating
cell = tbl_ReportQuestions.CreateCustomCell(GetTypeInfo(Question_Rating))
Dim container As Question_Rating = Question_Rating(cell.Control)
Case QuestionTypes.Selector
Case QuestionTypes.Signature
End Select
cell.Tag = rs.Field(“ID”).IntegerValue
Me.tbl_ReportQuestions.AddRow(0, cell)
rs.MoveNext
Wend