or
<telerik:RadGrid ID="RadGrid1" runat="server"> <MasterTableView DataMember="Employee" DataKeyNames="ID" GroupLoadMode="Client" HierarchyLoadMode="Client" GroupsDefaultExpanded="false"> <GroupByExpressions> <telerik:GridGroupByExpression> <GroupByFields> <telerik:GridGroupByField FieldName="Location" /> </GroupByFields> <SelectFields> <telerik:GridGroupByField FieldName="Location" /> </SelectFields> </telerik:GridGroupByExpression> </GroupByExpressions> <DetailTables> <telerik:GridTableView DataMember="EmployeeProperties" DataKeyNames="ID"> <ParentTableRelation> <telerik:GridRelationFields MasterKeyField="ID" DetailKeyField="EmployeeID" /> </ParentTableRelation> </telerik:GridTableView> </DetailTables> </MasterTableView></telerik:RadGrid>protected override void OnInit(EventArgs e){ RadGrid1.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource); RadGrid1.DetailTableDataBind += new Telerik.Web.UI.GridDetailTableDataBindEventHandler(RadGrid1_DetailTableDataBind); base.OnInit(e);}void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e){ DataSet ds = GetDataSource(); e.DetailTableView.DataSource = ds;}void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e){ DataSet ds = GetDataSource(); RadGrid1.DataSource = ds;}private DataSet GetDataSource(){ DataSet ds = new DataSet(); DataTable employee = ds.Tables.Add("Employee"); DataTable employeeProperties = ds.Tables.Add("EmployeeProperties"); var empKey = employee.Columns.Add("ID", typeof(int)); employee.Columns.Add("FullName", typeof(string)); employee.Columns.Add("DepartmentID", typeof(string)); employee.Columns.Add("Location", typeof(string)); var empPKey = employeeProperties.Columns.Add("ID", typeof(int)); var empPFK = employeeProperties.Columns.Add("EmployeeID", typeof(int)); employeeProperties.Columns.Add("Title", typeof(string)); employeeProperties.Columns.Add("Value", typeof(string)); employee.PrimaryKey = new[] { empKey }; employeeProperties.PrimaryKey = new[] { empPKey }; ds.Relations.Add(new DataRelation("rel", empKey, empPFK)); employee.Rows.Add(new object[] { 1, "Scott Smith", 1, "Sweden" }); employee.Rows.Add(new object[] { 2, "Adam West", 1, "Sweden" }); employee.Rows.Add(new object[] { 3, "John Doe", 2, "Norway" }); employee.Rows.Add(new object[] { 4, "Sven Svensson", 2, "Norway" }); employee.Rows.Add(new object[] { 5, "Anders Andersson", 3, "Finland" }); employee.Rows.Add(new object[] { 6, "Jane Doe", 3, "Finland" }); employee.Rows.Add(new object[] { 7, "Stan Smith", 4, "United States of America" }); int i = 0; foreach (DataRow emp in employee.Rows) { string[] s = ((string)emp["FullName"]).Split(new[] { ' ' }); employeeProperties.Rows.Add(new object[] { ++i, (int)emp["ID"], "GivenName", s[0] }); employeeProperties.Rows.Add(new object[] { ++i, (int)emp["ID"], "GivenName", s[1] }); } return ds;}hi all
i have a little problem with radalert method, i am trying to open an alert with an asp button, try with register startup script but this dont work as expected
somebody have an example that can show me
dcConnections dc = new dcConnections();g.DataSource = dc.GetMetrics();if (Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("3.5") != -1 || Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("4.0") != 1){ g.MasterTableView.FilterExpression = @"it[""ParentID""] == null";}else{ g.MasterTableView.FilterExpression = "ParentID IS NULL"; } g.MasterTableView.FilterExpression = @"it.ParentID == null";