You have to do some minor changes in your code like
protected void ddlMasterData_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlMasterData.SelectedValue == "0")
{
gvMasterData.Visible = false;
}
else
{
bindGridview(Convert.ToInt32(ddlMasterData.SelectedValue));
}
}
private void bindGridview(int yourSelectedValue)
{
List valueType = new List();
valueType = BLLMasterData.getAllValueTypeData();
gvMasterData.DataSource = valueType;
gvMasterData.DataBind();
}
}