or

protected override void OnInit(EventArgs e) { base.OnInit(e); this._RadLoadingPanel.ID = "_RadLoadingPanel"; this._RadLoadingPanel.Transparency = 30; this._RadLoadingPanel.Skin = "WebBlue"; this._RadLoadingPanel.BackgroundPosition = AjaxLoadingPanelBackgroundPosition.Center; this._RadGrid1.Skin = "WebBlue"; this._RadGrid1.Width = Unit.Percentage(100); this._RadGrid1.GridLines = GridLines.None; this._RadGrid1.PageSize = 20; this._RadGrid1.AllowPaging = true; this._RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; this._RadGrid1.AllowSorting = true; this._RadGrid1.AllowFilteringByColumn = false; this._RadGrid1.AllowAutomaticUpdates = false; this._RadGrid1.AutoGenerateColumns = false; this._RadGrid1.EnableLinqExpressions = false; this._RadGrid1.MasterTableView.NoMasterRecordsText = "No Deals found"; this._RadGrid1.ShowGroupPanel = false; this._RadGrid1.ShowStatusBar = true; this._RadGrid1.GroupingEnabled = false; this._RadGrid1.ClientSettings.Selecting.AllowRowSelect = true; this._RadGrid1.ClientSettings.EnableRowHoverStyle = true; this._RadGrid1.ClientSettings.EnablePostBackOnRowClick = true; this._RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
//add buttons this._RadGrid1.MasterTableView.CommandItemTemplate = new DealTemplate(this._RadGrid1, "State"); this._RadGrid1.MasterTableView.DataKeyNames = "PriceID"; this._RadGrid1.MasterTableView.ClientDataKeyNames = "Status"; this._RadGrid1.MasterTableView.EnableHeaderContextMenu = true; this._RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true; this._RadGrid1.ClientSettings.ClientEvents.OnRowSelected = "OnRowSelected"; this._RadGrid1.NeedDataSource += RadGrid1_NeedDataSource; this._RadGrid1.ItemDataBound += RadGrid1_ItemDataBound; #region Columns
}
<telerik:RadGrid ID="RadGrid1" DataSourceID="XmlDataSource1" runat="server" Width="990px" EnableLinqExpressions="False"> <MasterTableView AutoGenerateColumns="False"> <Columns> <telerik:GridBoundColumn runat="server" UniqueName="value1" DataField="value1" HeaderText="Value 1" /> <telerik:GridBoundColumn runat="server" UniqueName="value1" DataField="value1" HeaderText="Value 2" /> <telerik:GridCalculatedColumn runat="server" Expression="value1 + value2" /> </Columns> </MasterTableView></telerik:RadGrid><asp:xmldatasource id="XmlDataSource1" runat="server" datafile="Source.xml" xpath="DataPoints/Point"/><?xml version="1.0" encoding="utf-8" ?><DataPoints> <Point Value1="1" Value2="2"/></DataPoints>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|

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(); } }