hi
i use these code for bind radgrid
but just first level bind
both of datasource is full
please help to me
i use these code for bind radgrid
but just first level bind
both of datasource is full
please help to me
protected void Button1_Click(object sender, EventArgs e) { RadGrid RadGrid1 = new RadGrid(); RadGrid1.ID = "RadGrid1"; RadGrid1.DataSource = ResultSearch(); RadGrid1.MasterTableView.DataKeyNames = new string[] { "ShareHolderID" }; RadGrid1.Width = Unit.Percentage(98); RadGrid1.PageSize = 3; RadGrid1.AllowPaging = true; RadGrid1.AllowSorting = true; RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; RadGrid1.AutoGenerateColumns = false; RadGrid1.ShowStatusBar = true; RadGrid1.MasterTableView.ExpandCollapseColumn.Visible = true; RadGrid1.MasterTableView.PageSize = 3; GridBoundColumn boundColumn; boundColumn = new GridBoundColumn(); boundColumn.DataField = "ShareHolderID"; boundColumn.HeaderText = "ShareHolderID"; RadGrid1.MasterTableView.Columns.Add(boundColumn); boundColumn = new GridBoundColumn(); boundColumn.DataField = "FirstName"; boundColumn.HeaderText = "FirstName"; RadGrid1.MasterTableView.Columns.Add(boundColumn); IQueryable<CDSStockDataAccess.tS002ShareHoldersInfo> shareholderinfo = CDSStockLogic.BusinessObjects.UI.ShareHolderInfo.RetrieveShareHolder("2"); GridTableView tableViewOrders = new GridTableView(RadGrid1); tableViewOrders.DataSource = shareholderinfo; tableViewOrders.Width = Unit.Percentage(100); tableViewOrders.DataKeyNames = new string[] { "_ShareHolderInfoID" }; GridRelationFields relationFields = new GridRelationFields(); relationFields.MasterKeyField = "ShareHolderInfoID"; relationFields.DetailKeyField = "ShareHolderInfoID"; tableViewOrders.ParentTableRelation.Add(relationFields); RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders); boundColumn = new GridBoundColumn(); boundColumn.DataField = "ShareHolderInfoID"; boundColumn.HeaderText = "ShareHolderInfoID"; tableViewOrders.Columns.Add(boundColumn); boundColumn = new GridBoundColumn(); boundColumn.DataField = "Address"; boundColumn.HeaderText = "Address"; tableViewOrders.Columns.Add(boundColumn); this.PlaceHolder1.Controls.Add(RadGrid1); RadGrid Grid1 = (RadGrid)PlaceHolder1.FindControl("RadGrid1"); RadGrid1.MasterTableView.Items[0].Expanded = true; Grid1.SelectedIndexes.Add(1, 0); }