Problems with casting DataGridItem.findcontrol and DataGridItem.cells(0).control(1) to checkbox

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'.


Alternatively I have tried

chkbox = Ctype(i.cells(0).control(1),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
in order to delete the respective rows



Thanx


Sam
 
A

Alvin Bruney

wow, hold on you are trying to convert a WEB control into a WINDOWS control.
Is that really what you really want to do? Where is checkbox coming from?
Also what troubles me is that you seem to have two types of controls
(windows/web) on the same form. Is that by design?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top