I guess you want to disable control in edit form based on your condition. Please check the following code I tried to disable a TextBox inside the edit form(GridBoundColumn).
And if I use template type edit form?
Because your code throw the following exception in this case:
'Specified argument was out of the range of valid values.Parameter name: index'