I am using an AccessDataSource control bound to a DetailsView control. When the select returns no rows (the DetailsView disappears, but is still set to visible), then I would like to disable some further functionality by disabling a button.
In the C# code behind, I know I will need:
ButtonMyButton.enabled = false;
However, I am uncertain of a way of getting the information from the AccessDataSource or the DetailsView that would let me know when to set the value.
I have seen some other articles that suggested the example of for a similar item:
DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
int reorderedProducts = (int)dv.Table.Rows[0][0]
For me, DataView is in error as not having the right namespace, despite having:
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
What should I do to disable the button?
(While this is a real newbie question, it is not school homework, since that seems to be the first comment on so many simple questions.)