Sorry for the crappy question title.
Is there a way to do this on one line:
Button button = (Button)Gridview.Cells[0].FindControl("controlname");
button.Enabled = (some boolean);
For example, a directcast in vb will allow:
DirectCast(Gridview.Cells(0).FindControl("controlname"), Button).Enabled = (some boolean value)
Or does it need to be on two lines?
Thanks!
I’m guessing you tried the obvious but got caught out by binding priority. The methods and properties will be done before the cast unless specified otherwise. Using parentheses you can make it do the cast first and then call the property on the now cast control.