Casting DataGridItem.findcontrol("deletethis") to CheckBox

  • Thread starter Thread starter Samuel Chowdhuri
  • Start date Start date
S

Samuel Chowdhuri

this peace of code is giving me trouble

DIM i as DataGridItem

for each i in myDataGrid
checkbox chkbox = Ctype(i.findcontrol("deletethis"),checkbox)

if(chkbox.checked) then
......
.....

Compiler Error: Value of type 'System.Web.UI.Control' cannot be converted to
'System.Windows.Forms.CheckBox'.

How can I overcome this, i need to be able to see if the checkbox is checked
or not.


Thanx
 
Hi Samuel,

|| this peace of code is giving me trouble

Rephrased:
this trouble of code is giving me no peace :-(


That's because there's a
System.Web.UI.WebControls.CheckBox
and then there's a
System.Windows.Forms.CheckBox

Your app is thinking in terms of System.Windows.Forms.

Is this a Windows app or a Web app?

Regards,
Fergus
 
Back
Top