Hi Yatin,
Re-write your code as below.
protected void GrdRightDetails_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
System.Web.UI.WebControls.CheckBox chk = (System.Web.UI.WebControls.CheckBox)e.Row.FindControl("ChkStatus");
string QryCount = "SELECT * FROM RightMaster WHERE UserID='" + Convert.ToInt32(HiddenField1.Value) + "' AND Status = 1";
try
{
SqlConnection con = new SqlConnection(ConnString);
SqlCommand cmd = new SqlCommand(con, QryCount);
DataSet ds = new DataSet();
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
if (ds.Table[0].Rows.Count>0)
{
chk.Checked = true;
}
}
Catch {}
}
}
If you face any issue please let me know.
Hope this will help you.