Data Grid population

DekaFlash

Well-known member
Joined
Feb 14, 2006
Messages
117
Programming Experience
1-3
I have a dynamically populated datagrid, which is clickable.

The user can click on items from the datagrid in order to populate input fields, of which there are 20. When the user clicks one of the cells, a corresponding checkbox is checked

The assignment logic has been split into 4 batches.

The first batch presents no problem because it deals with the first 5 rows of the datagrid and the first 5 input fields.

The remaining batches include code to check to see which input field is empty in order to know which input field to assign to.

Unfortunately a side effect of this is that some of the checks aren't exclusive and as a result multiple input field assignment is occurring.

Any suggestions how to remedy this problem would be most welcome.

Thanks.
 
Not really enough info provided to give an accurate answer, but it sounds like a Nested IF structure would help.

VB.NET:
IF field1 is blank then
  assign value
Else
  IF field2 is blank then
    assign value
  Else
    IF field3 is blank then
      assign value
    End IF
  End IF
End IF
Check them in order it will fill only the first empty field and skip the rest.
 
Back
Top