P
Philip Yeo
Just a question,
If I have a column that performs delete. But I want to disable all the
delete buttons in this column when user click's on edit,
I put this code here,
Protected sub mydatagrid_edit(sender as object, e as
datagridcommandeventargs)
mydatagrid.edititemindex = cint(e.item.itemindex)
' because it is in the 2nd col item's integer parameter is 1
dim btnDel as button = e.item(1).controls(0)
btnDel.enable = false
loaddata()
end sub
However this doesn't work.
So I figured that it could be because there's a whole row of the table that
has this button so the controls(0) is actually returning an array object.
Thus would it be wise to write the code this way. Pls advice if there's any
mistake
Protected sub mydatagrid_edit(sender as object, e as
datagridcommandeventargs)
mydatagrid.edititemindex = cint(e.item.itemindex)
' because it is in the 2nd col item's integer parameter is 1
dim btnDel() as button = e.item(1).controls(0)
dim i as integer
for i = 0 to btnDel.count
btnDel(i).enable = false
next i
loaddata()
end sub
If I have a column that performs delete. But I want to disable all the
delete buttons in this column when user click's on edit,
I put this code here,
Protected sub mydatagrid_edit(sender as object, e as
datagridcommandeventargs)
mydatagrid.edititemindex = cint(e.item.itemindex)
' because it is in the 2nd col item's integer parameter is 1
dim btnDel as button = e.item(1).controls(0)
btnDel.enable = false
loaddata()
end sub
However this doesn't work.
So I figured that it could be because there's a whole row of the table that
has this button so the controls(0) is actually returning an array object.
Thus would it be wise to write the code this way. Pls advice if there's any
mistake
Protected sub mydatagrid_edit(sender as object, e as
datagridcommandeventargs)
mydatagrid.edititemindex = cint(e.item.itemindex)
' because it is in the 2nd col item's integer parameter is 1
dim btnDel() as button = e.item(1).controls(0)
dim i as integer
for i = 0 to btnDel.count
btnDel(i).enable = false
next i
loaddata()
end sub