vendredi 20 novembre 2015

Check Checkboxes in a gridview based on a non-boolean value from a stored procedure

I have a gridview where the first column is a checkbox (cb_pain), and the second column is an ID (DrugID). I'm getting the DrugID from a stored procedure which is run from my VB code behind on dropdown lists post back event.

My grid looks like this: (sorry for the dot's, I couldn't figure out how to tab)

cb_pain.....DrugID............Field1
x.................3...................other data
x.................23.................other data
x.................24.................other data
x.................37.................other data

With out a lot of detail about the stored procedure, I think I can sum up what I've got by saying I know the value of this will the DrugID of the checkbox in need checked: dt.Rows(0)("pain1").ToString()

For example, I know: dt.Rows(0)("pain1").ToString() = 23

How can I use this to check the checkbox on the row that has DrugID 23?

I've tried a couple of different DirectCast things, but no success. Can anyone point me in the right direction?

Thanks




Aucun commentaire:

Enregistrer un commentaire