protected void RadTreeView1_Nodeclick(object sender, RadTreeNodeEventArgs e) { var dt = new object(); if (RadTreeView1.SelectedNode.Level != 0) { dt = _entities.GetHopDongByIDPhongBan(Int32.Parse(e.Node.Value)); } else { dt = _entities.GetAllHopDong(); } RadGrid1.DataSource = dt; RadGrid1.DataBind(); if (RadGrid1.Items.Count > 0) { RadGrid1.Items[0].Selected = true; GridDataItem item = RadGrid1.Items[0]; Int32 IDHD = Int32.Parse(item["IDHopDongLD"].Text); Session["idHD"] = IDHD; FillCurrentDetail(IDHD); RadContextMenu1.Items.FindItemByValue("xoa").Enabled = true; RadContextMenu1.Items.FindItemByValue("sua").Enabled = true; } else { RadContextMenu1.Items.FindItemByValue("xoa").Enabled = false; RadContextMenu1.Items.FindItemByValue("sua").Enabled = false; } }
protected void RadGridHanHD_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { var lstHopDong = _entities.GetAllHopDong().Where(x => x.DenNgay == DateTime.Today); RadGridHanHD.DataSource = lstHopDong; }