I am trying to set condition on two GridView but it is not working.
I am retrieving data from database to gvtrans0 GridView, when gvtrans0 has data then gvtrans get hide, if gvtrans0 does not have data then gvtrans0 get hide and gvtrans get visible on page load
private void Loadinvoicgv()
{
con.Open();
// SqlCommand cmd = new SqlCommand("[SP_Retreive_Customer_Legder]");
SqlCommand cmd = new SqlCommand("[Sp_Ret_Import_Detail_ID]");
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter daf = new SqlDataAdapter(cmd);
cmd.Parameters.AddWithValue("@ID", lbimpid.Text);
DataTable dtf = new DataTable();
daf.Fill(dtf);
gvtrans0.DataSource = dtf;
gvtrans0.DataBind();
con.Close();
}