or
protected void RadGridParentComponents_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { var result = new Inventory().GetComponets(this.HiddenFieldTag.Value); RadGridParentComponents.DataSource = result; }public IQueryable<TagInformationComponentView> GetComponets(string tag) { using (var dbContext = new TIPWebITLibrary.DAL.TIPWebITDataContext()) { if (String.IsNullOrEmpty(tag)) { throw new ArgumentNullException("tag", "Null or Empty is not allowed"); } var parent = dbContext.tblTechInventories.Where(x => x.Tag == tag).FirstOrDefault(); //TODO: Check to ensure it is a parent var result = from c in dbContext.tblTechInventories join p in dbContext.tblTechItems on c.ItemUID equals p.ItemUID join t in dbContext.tblTechItemTypes on p.ItemTypeUID equals t.ItemTypeUID where c.ParentInventoryUID == parent.InventoryUID select new TagInformationComponentView() { InventoryUID = c.InventoryUID, ProductName = p.ItemName, ProductType = t.ItemTypeName, Serial = c.Serial, Tag = c.Tag }; if (result.Count() == 0) return new List<TagInformationComponentView>().AsQueryable(); return result.AsQueryable(); } } protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; GridButtonColumn gbtnCol = item.OwnerTableView.Columns.FindByUniqueName("column") as GridButtonColumn; gbtnCol.Text = "Resume"; gbtnCol.DataTextFormatString = "Resume"; GridEditCommandColumn gbtnCol2 = item.OwnerTableView.Columns.FindByUniqueName("EditCommandColumn") as GridEditCommandColumn; Label txtProcessStatus = e.Item.FindControl("ProcessStatusLabel") as Label; //ProcessStatusTextBox gbtnCol3 = item.OwnerTableView.Columns.FindByUniqueName("ProcessStatus") as ProcessStatusTextBox; if (gbtnCol2 != null ) if (txtProcessStatus.Text != "98") { gbtnCol2.Visible = false; gbtnCol.Visible = false; txtProcessStatus.Text = "11"; } }}<tools name="Tools"> <tool name="Custom_StripWidth" text="Strip All Widths/Heights" /> <tool name="Custom_ClearAll" text="Clear" /> <tool name="Custom_Format" type="SplitButton"> <tool name="Custom_StripWidth" text="Strip Widths/Heights" /> <tool name="StripCss"/> <tool name="StripFont"/> <tool name="StripSpan"/> <tool name="StripWord"/> <tool name="StripAll"/> </tool></tools>.reTool .Custom_Format { background-image: url('../images/icons/format.png');} .reTool .Custom_StripWidth { background-image: url('../images/icons/strip_width.png');}