SlideShare a Scribd company logo
1 of 7
Download to read offline
9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums
http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 1/7
Home / ASP.NET Forums / Community / Component Discussions / RadGrid: dynamically building a grid and adding
a hierarchy with decl...
2 replies
Last post May 12, 2010 08:01 AM by bloggernext
RadGrid: dynamically building a grid and adding
a hierarchy with declarative relations row?
[Answered]
RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row?
Apr 26, 2010 12:04 AM | sholdorf
I have searched the internet and can't find out what my final problem is. What I have is RadGrid and I am creating
a sub‐column that is a bound column. Now, when I select the icon to open the sub‐column the relation field's
bound column appearing but even though I am binding a List<> to it I get the message: No child records to
display. Below is the code so if anyone can help with my final problem that would be great!
 
public partial class _Default : System.Web.UI.Page   
{  
    protected RadGrid grid;  
    protected static List<TestListItem> list = new List<TestListItem>﴾﴿;  
    protected static List<TestListItem2> list2 = new List<TestListItem2>﴾﴿;  
      
   override protected void OnInit﴾EventArgs e﴿  
   {  
       DefineGridStructure﴾﴿;  
       base.OnInit﴾e﴿;  
   }  
   private void DefineGridStructure﴾﴿  
   {  
       this.grid = new RadGrid﴾﴿;  
       this.grid.AutoGenerateColumns = false;  
       this.grid.NeedDataSource += new GridNeedDataSourceEventHandler﴾OnNeedDataSource﴿;  
       this.grid.ItemDataBound += new GridItemEventHandler﴾grid_ItemDataBound﴿;  
       this.grid.DetailTableDataBind += new GridDetailTableDataBindEventHandler﴾grid_DetailTableDataBind﴿;  
       this.grid.AllowMultiRowEdit = true;  
       this.grid.AllowPaging = true;  
       this.grid.AllowSorting = true;  
       this.grid.Width = 700;  
         
        
 
       //other columns definitions ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐  
       string gridEditColumnLinkName = "Action Column";  
9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums
http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 2/7
       GridEditCommandColumn gridEditColumn = new GridEditCommandColumn﴾﴿;  
       gridEditColumn.ButtonType = GridButtonColumnType.LinkButton;  
       gridEditColumn.EditText = "Edit";  
       gridEditColumn.UpdateText = "Save";  
       gridEditColumn.CancelText = "Cancel";  
       gridEditColumn.UniqueName = "ActionButton";  
       gridEditColumn.HeaderText = gridEditColumnLinkName;  
       gridEditColumn.HeaderStyle.Width = 50;  
 
       string boundColumnName1 = "Column 1";  
       GridBoundColumn boundColumn1 = new GridBoundColumn﴾﴿;  
       boundColumn1.DataField = "A";  
       boundColumn1.UniqueName = "Column1";  
       boundColumn1.HeaderText = boundColumnName1;  
       boundColumn1.HeaderStyle.Width = 300;  
         
       string boundColumnName2 = "Column 2";  
       GridBoundColumn boundColumn2 = new GridBoundColumn﴾﴿;  
       boundColumn2.DataField = "B";  
       boundColumn2.UniqueName = "Column2";  
       boundColumn2.HeaderText = boundColumnName2;  
       boundColumn2.HeaderStyle.Width = 300;  
 
       string boundColumnName3 = "Column 3";  
       GridBoundColumn boundColumn3 = new GridBoundColumn﴾﴿;  
       boundColumn3.DataField = "C";  
       boundColumn3.UniqueName = "Column3";  
       boundColumn3.HeaderText = boundColumnName3;  
       boundColumn3.HeaderStyle.Width = 300;  
         
       string dropdownColumnName = "Dropdown Column2";  
       GridBoundColumn dropdownColumn = new GridBoundColumn﴾﴿;  
       dropdownColumn.UniqueName = "Column4";  
       dropdownColumn.DataField = "D";  
       dropdownColumn.HeaderText = dropdownColumnName;  
       dropdownColumn.HeaderStyle.Width = 300;  
         
       //Detail table ‐ ﴾II in hierarchy level﴿  
       GridTableView tableView = new GridTableView﴾this.grid﴿;  
       tableView.Width = Unit.Percentage﴾100﴿;  
 
       tableView.DataKeyNames = new string[1] { "A1" };  
 
       GridRelationFields relationFields = new GridRelationFields﴾﴿;  
       relationFields.MasterKeyField = "A";  
       relationFields.DetailKeyField = "A1";  
       tableView.ParentTableRelation.Add﴾relationFields﴿;  
 
       grid.MasterTableView.DetailTables.Add﴾tableView﴿;  
9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums
http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 3/7
 
       //Add columns  
       GridBoundColumn boundColumnr = new GridBoundColumn﴾﴿;  
       boundColumnr.DataField = "A1";  
       boundColumnr.HeaderText = "A1";  
       tableView.Columns.Add﴾boundColumnr﴿;  
 
       this.grid.MasterTableView.DataKeyNames = new string[] { "A" };  
       this.grid.MasterTableView.Columns.Add﴾gridEditColumn﴿;  
       this.grid.MasterTableView.Columns.Add﴾boundColumn1﴿;  
       this.grid.MasterTableView.Columns.Add﴾boundColumn2﴿;  
       this.grid.MasterTableView.Columns.Add﴾boundColumn3﴿;  
       this.grid.MasterTableView.Columns.Add﴾dropdownColumn﴿;  
       this.grid.MasterTableView.EditMode = GridEditMode.InPlace;  
       grid.PageSize = 5;  
       grid.ClientSettings.Scrolling.ScrollHeight = 230;  
       grid.ClientSettings.Scrolling.ScrollWidth = 750;  
       grid.ClientSettings.EnableClientKeyValues = true;  
       this.PlaceHolder1.Controls.Add﴾grid﴿;  
 
   }  
 
   void grid_DetailTableDataBind﴾object source, GridDetailTableDataBindEventArgs e﴿  
   {  
           e.DetailTableView.DataSource = list2;  
 
    }  
 
 
 
   void grid_ItemDataBound﴾object sender, GridItemEventArgs e﴿  
   {  
       if ﴾e.Item is GridDataItem﴿  
       {  
           GridDataItem item = e.Item as GridDataItem;  
 
           if ﴾e.Item.IsInEditMode﴿  
           {  
     
           }  
       }  
   }  
         
   protected void Page_Load﴾object sender, EventArgs e﴿  
   {  
                List<string> alist = new List<string>﴾﴿;  
                list = new List<TestListItem>﴾﴿;  
                list2 = new List<TestListItem2>﴾﴿;  
      
9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums
http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 4/7
                alist.Add﴾"1"﴿;  
                alist.Add﴾"2"﴿;  
                alist.Add﴾"3"﴿;  
                alist.Add﴾"4"﴿;  
                alist.Add﴾"5"﴿;  
                alist.Add﴾"5"﴿;  
                list.Add﴾ new TestListItem﴾ "ItemA 0", "ItemB a", "ItemC a", "ItemD a", alist ﴿﴿;  
                list.Add﴾ new TestListItem﴾ "ItemA 1", "ItemB b", "ItemC b", "ItemD b", alist ﴿﴿;  
                list.Add﴾ new TestListItem﴾ "ItemA 2", "ItemB c", "ItemC c", "ItemD c", alist ﴿﴿;  
                list.Add﴾ new TestListItem﴾ "ItemA 3", "ItemB d", "ItemC d", "ItemD d", alist ﴿﴿;  
                list.Add﴾ new TestListItem﴾ "ItemA 4", "ItemB e", "ItemC e", "ItemD e", alist ﴿﴿;  
                list.Add﴾ new TestListItem﴾ "ItemA 5", "ItemB f", "ItemC f", "ItemD f", alist ﴿﴿;  
 
                list2.Add ﴾new TestListItem2﴾"SubItem A"﴿﴿;  
                list2.Add﴾new TestListItem2﴾"SubItem B"﴿﴿;  
                list2.Add﴾new TestListItem2﴾"SubItem C"﴿﴿;  
                list2.Add﴾new TestListItem2﴾"SubItem D"﴿﴿;  
                list2.Add﴾new TestListItem2﴾"SubItem E"﴿﴿;  
                list2.Add﴾new TestListItem2﴾"SubItem F"﴿﴿;  
   }  
 
 
    void OnNeedDataSource﴾object source, GridNeedDataSourceEventArgs e﴿    
    {  
        if ﴾!e.IsFromDetailTable﴿  
        {  
            grid.DataSource = list;  
        }  
        else 
        {  
            //grid.MasterTableView.DataSource = list2;  
        }  
    }   
      
      public class TestListItem  
    {  
        private string _a;  
        private string _b;  
        private string _c;  
        private string _d;  
        List<string> _aList;  
 
        public TestListItem﴾ string a, string b, string c, string d,List<string> aList ﴿  
        {  
            this._a = a;  
            this._b = b;  
            this._c = c;  
            this._d = d;  
9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums
http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 5/7
            this._aList = aList;  
        }  
 
        public string A  
        {  
            get 
            {  
                return this._a;   
            }  
            set 
            {  
                this._a = value;  
            }  
        }  
          
          
 
        public string B  
        {  
            get 
            {  
                return this._b;  
            }  
              
                        set 
            {  
                this._b = value;  
            }  
 
        }  
          
        public string C  
        {  
            get 
            {  
                return this._c;  
            }  
              
                        set 
            {  
                this._c = value;  
            }  
 
        }  
        public string D  
        {  
            get 
            {  
                return this._d;  
9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums
http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 6/7
            }  
 
            set 
            {  
                this._d = value;  
            }  
 
        }  
          
        public List<string> AList  
        {  
            get 
            {  
                return this._aList;  
            }  
            set 
            {  
                this._aList = value;  
            }  
        }  
     }  
 
      public class TestListItem2  
      {  
          private string _a1;  
 
          public TestListItem2﴾string a1﴿  
          {  
              this._a1 = a1;  
          }  
 
          public string A1  
          {  
              get 
              {  
                  return this._a1;  
              }  
              set 
              {  
                  this._a1 = value;  
              }  
          }  
   
      }  
} 
 
9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums
http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 7/7
Re: RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row?
May 12, 2010 08:01 AM | bloggernext
dude post it in their forum http://www.telerik.com/community/forums/aspnet‐ajax/grid.aspx
﴾http://www.telerik.com/community/forums/aspnet‐ajax/grid.aspx﴿
the response is always quick.
 
Re: RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row?
May 12, 2010 08:01 AM | bloggernext
dude post it in their forum http://www.telerik.com/community/forums/aspnet‐ajax/grid.aspx
﴾http://www.telerik.com/community/forums/aspnet‐ajax/grid.aspx﴿
their response is always quick.
 
This site is managed for Microsoft by Neudesic, LLC. | © 2015 Microsoft. All rights reserved.

More Related Content

Viewers also liked

Viewers also liked (12)

Android wear notes
Android wear notesAndroid wear notes
Android wear notes
 
Release documentation
Release documentationRelease documentation
Release documentation
 
Item based approach
Item based approachItem based approach
Item based approach
 
Lec7 collaborative filtering
Lec7 collaborative filteringLec7 collaborative filtering
Lec7 collaborative filtering
 
Brian.suda.thesis
Brian.suda.thesisBrian.suda.thesis
Brian.suda.thesis
 
Twdatasci cjlin-big data analytics - challenges and opportunities
Twdatasci cjlin-big data analytics - challenges and opportunitiesTwdatasci cjlin-big data analytics - challenges and opportunities
Twdatasci cjlin-big data analytics - challenges and opportunities
 
Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0
 
Aws tkv-ug
Aws tkv-ugAws tkv-ug
Aws tkv-ug
 
9 content-providers
9 content-providers9 content-providers
9 content-providers
 
Workshop 04 android-development
Workshop 04 android-developmentWorkshop 04 android-development
Workshop 04 android-development
 
Collab filtering-tutorial
Collab filtering-tutorialCollab filtering-tutorial
Collab filtering-tutorial
 
Emergency androidstudiochapter
Emergency androidstudiochapterEmergency androidstudiochapter
Emergency androidstudiochapter
 

Similar to Rad grid dynamically building a grid and adding a hierarchy with declarative relations row_ _ the asp

Ebookrentalfilm
EbookrentalfilmEbookrentalfilm
Ebookrentalfilmdhi her
 
The Ring programming language version 1.5.3 book - Part 53 of 184
The Ring programming language version 1.5.3 book - Part 53 of 184The Ring programming language version 1.5.3 book - Part 53 of 184
The Ring programming language version 1.5.3 book - Part 53 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 43 of 184
The Ring programming language version 1.5.3 book - Part 43 of 184The Ring programming language version 1.5.3 book - Part 43 of 184
The Ring programming language version 1.5.3 book - Part 43 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 31 of 84
The Ring programming language version 1.2 book - Part 31 of 84The Ring programming language version 1.2 book - Part 31 of 84
The Ring programming language version 1.2 book - Part 31 of 84Mahmoud Samir Fayed
 
CSS- Smacss Design Rule
CSS- Smacss Design RuleCSS- Smacss Design Rule
CSS- Smacss Design Rule皮馬 頑
 
The Ring programming language version 1.10 book - Part 53 of 212
The Ring programming language version 1.10 book - Part 53 of 212The Ring programming language version 1.10 book - Part 53 of 212
The Ring programming language version 1.10 book - Part 53 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 54 of 210
The Ring programming language version 1.9 book - Part 54 of 210The Ring programming language version 1.9 book - Part 54 of 210
The Ring programming language version 1.9 book - Part 54 of 210Mahmoud Samir Fayed
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSRachel Andrew
 
Ebooktiketkapal
EbooktiketkapalEbooktiketkapal
Ebooktiketkapaldhi her
 
The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196Mahmoud Samir Fayed
 
Introduction to CSS Grid
Introduction to CSS GridIntroduction to CSS Grid
Introduction to CSS GridKara Luton
 
The Ring programming language version 1.3 book - Part 33 of 88
The Ring programming language version 1.3 book - Part 33 of 88The Ring programming language version 1.3 book - Part 33 of 88
The Ring programming language version 1.3 book - Part 33 of 88Mahmoud Samir Fayed
 

Similar to Rad grid dynamically building a grid and adding a hierarchy with declarative relations row_ _ the asp (20)

GRID VIEW PPT
GRID VIEW PPTGRID VIEW PPT
GRID VIEW PPT
 
World of CSS Grid
World of CSS GridWorld of CSS Grid
World of CSS Grid
 
Ebookrentalfilm
EbookrentalfilmEbookrentalfilm
Ebookrentalfilm
 
Grid View Control CS
Grid View Control CSGrid View Control CS
Grid View Control CS
 
The Ring programming language version 1.5.3 book - Part 53 of 184
The Ring programming language version 1.5.3 book - Part 53 of 184The Ring programming language version 1.5.3 book - Part 53 of 184
The Ring programming language version 1.5.3 book - Part 53 of 184
 
The Ring programming language version 1.5.3 book - Part 43 of 184
The Ring programming language version 1.5.3 book - Part 43 of 184The Ring programming language version 1.5.3 book - Part 43 of 184
The Ring programming language version 1.5.3 book - Part 43 of 184
 
The Ring programming language version 1.2 book - Part 31 of 84
The Ring programming language version 1.2 book - Part 31 of 84The Ring programming language version 1.2 book - Part 31 of 84
The Ring programming language version 1.2 book - Part 31 of 84
 
Data Binding in qooxdoo
Data Binding in qooxdooData Binding in qooxdoo
Data Binding in qooxdoo
 
Grid Vew Control VB
Grid Vew Control VBGrid Vew Control VB
Grid Vew Control VB
 
Sign in
Sign inSign in
Sign in
 
CSS- Smacss Design Rule
CSS- Smacss Design RuleCSS- Smacss Design Rule
CSS- Smacss Design Rule
 
The Ring programming language version 1.10 book - Part 53 of 212
The Ring programming language version 1.10 book - Part 53 of 212The Ring programming language version 1.10 book - Part 53 of 212
The Ring programming language version 1.10 book - Part 53 of 212
 
The Ring programming language version 1.9 book - Part 54 of 210
The Ring programming language version 1.9 book - Part 54 of 210The Ring programming language version 1.9 book - Part 54 of 210
The Ring programming language version 1.9 book - Part 54 of 210
 
Radgrid
RadgridRadgrid
Radgrid
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJS
 
Ebooktiketkapal
EbooktiketkapalEbooktiketkapal
Ebooktiketkapal
 
Android Data Binding
Android Data BindingAndroid Data Binding
Android Data Binding
 
The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196
 
Introduction to CSS Grid
Introduction to CSS GridIntroduction to CSS Grid
Introduction to CSS Grid
 
The Ring programming language version 1.3 book - Part 33 of 88
The Ring programming language version 1.3 book - Part 33 of 88The Ring programming language version 1.3 book - Part 33 of 88
The Ring programming language version 1.3 book - Part 33 of 88
 

Recently uploaded

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Recently uploaded (20)

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Rad grid dynamically building a grid and adding a hierarchy with declarative relations row_ _ the asp

  • 1. 9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 1/7 Home / ASP.NET Forums / Community / Component Discussions / RadGrid: dynamically building a grid and adding a hierarchy with decl... 2 replies Last post May 12, 2010 08:01 AM by bloggernext RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? [Answered] RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? Apr 26, 2010 12:04 AM | sholdorf I have searched the internet and can't find out what my final problem is. What I have is RadGrid and I am creating a sub‐column that is a bound column. Now, when I select the icon to open the sub‐column the relation field's bound column appearing but even though I am binding a List<> to it I get the message: No child records to display. Below is the code so if anyone can help with my final problem that would be great!   public partial class _Default : System.Web.UI.Page    {       protected RadGrid grid;       protected static List<TestListItem> list = new List<TestListItem>﴾﴿;       protected static List<TestListItem2> list2 = new List<TestListItem2>﴾﴿;             override protected void OnInit﴾EventArgs e﴿      {          DefineGridStructure﴾﴿;          base.OnInit﴾e﴿;      }      private void DefineGridStructure﴾﴿      {          this.grid = new RadGrid﴾﴿;          this.grid.AutoGenerateColumns = false;          this.grid.NeedDataSource += new GridNeedDataSourceEventHandler﴾OnNeedDataSource﴿;          this.grid.ItemDataBound += new GridItemEventHandler﴾grid_ItemDataBound﴿;          this.grid.DetailTableDataBind += new GridDetailTableDataBindEventHandler﴾grid_DetailTableDataBind﴿;          this.grid.AllowMultiRowEdit = true;          this.grid.AllowPaging = true;          this.grid.AllowSorting = true;          this.grid.Width = 700;                               //other columns definitions ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐          string gridEditColumnLinkName = "Action Column";  
  • 2. 9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 2/7        GridEditCommandColumn gridEditColumn = new GridEditCommandColumn﴾﴿;          gridEditColumn.ButtonType = GridButtonColumnType.LinkButton;          gridEditColumn.EditText = "Edit";          gridEditColumn.UpdateText = "Save";          gridEditColumn.CancelText = "Cancel";          gridEditColumn.UniqueName = "ActionButton";          gridEditColumn.HeaderText = gridEditColumnLinkName;          gridEditColumn.HeaderStyle.Width = 50;            string boundColumnName1 = "Column 1";          GridBoundColumn boundColumn1 = new GridBoundColumn﴾﴿;          boundColumn1.DataField = "A";          boundColumn1.UniqueName = "Column1";          boundColumn1.HeaderText = boundColumnName1;          boundColumn1.HeaderStyle.Width = 300;                    string boundColumnName2 = "Column 2";          GridBoundColumn boundColumn2 = new GridBoundColumn﴾﴿;          boundColumn2.DataField = "B";          boundColumn2.UniqueName = "Column2";          boundColumn2.HeaderText = boundColumnName2;          boundColumn2.HeaderStyle.Width = 300;            string boundColumnName3 = "Column 3";          GridBoundColumn boundColumn3 = new GridBoundColumn﴾﴿;          boundColumn3.DataField = "C";          boundColumn3.UniqueName = "Column3";          boundColumn3.HeaderText = boundColumnName3;          boundColumn3.HeaderStyle.Width = 300;                    string dropdownColumnName = "Dropdown Column2";          GridBoundColumn dropdownColumn = new GridBoundColumn﴾﴿;          dropdownColumn.UniqueName = "Column4";          dropdownColumn.DataField = "D";          dropdownColumn.HeaderText = dropdownColumnName;          dropdownColumn.HeaderStyle.Width = 300;                    //Detail table ‐ ﴾II in hierarchy level﴿          GridTableView tableView = new GridTableView﴾this.grid﴿;          tableView.Width = Unit.Percentage﴾100﴿;            tableView.DataKeyNames = new string[1] { "A1" };            GridRelationFields relationFields = new GridRelationFields﴾﴿;          relationFields.MasterKeyField = "A";          relationFields.DetailKeyField = "A1";          tableView.ParentTableRelation.Add﴾relationFields﴿;            grid.MasterTableView.DetailTables.Add﴾tableView﴿;  
  • 3. 9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 3/7          //Add columns          GridBoundColumn boundColumnr = new GridBoundColumn﴾﴿;          boundColumnr.DataField = "A1";          boundColumnr.HeaderText = "A1";          tableView.Columns.Add﴾boundColumnr﴿;            this.grid.MasterTableView.DataKeyNames = new string[] { "A" };          this.grid.MasterTableView.Columns.Add﴾gridEditColumn﴿;          this.grid.MasterTableView.Columns.Add﴾boundColumn1﴿;          this.grid.MasterTableView.Columns.Add﴾boundColumn2﴿;          this.grid.MasterTableView.Columns.Add﴾boundColumn3﴿;          this.grid.MasterTableView.Columns.Add﴾dropdownColumn﴿;          this.grid.MasterTableView.EditMode = GridEditMode.InPlace;          grid.PageSize = 5;          grid.ClientSettings.Scrolling.ScrollHeight = 230;          grid.ClientSettings.Scrolling.ScrollWidth = 750;          grid.ClientSettings.EnableClientKeyValues = true;          this.PlaceHolder1.Controls.Add﴾grid﴿;        }        void grid_DetailTableDataBind﴾object source, GridDetailTableDataBindEventArgs e﴿      {              e.DetailTableView.DataSource = list2;         }            void grid_ItemDataBound﴾object sender, GridItemEventArgs e﴿      {          if ﴾e.Item is GridDataItem﴿          {              GridDataItem item = e.Item as GridDataItem;                if ﴾e.Item.IsInEditMode﴿              {                    }          }      }                protected void Page_Load﴾object sender, EventArgs e﴿      {                   List<string> alist = new List<string>﴾﴿;                   list = new List<TestListItem>﴾﴿;                   list2 = new List<TestListItem2>﴾﴿;         
  • 4. 9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 4/7                 alist.Add﴾"1"﴿;                   alist.Add﴾"2"﴿;                   alist.Add﴾"3"﴿;                   alist.Add﴾"4"﴿;                   alist.Add﴾"5"﴿;                   alist.Add﴾"5"﴿;                   list.Add﴾ new TestListItem﴾ "ItemA 0", "ItemB a", "ItemC a", "ItemD a", alist ﴿﴿;                   list.Add﴾ new TestListItem﴾ "ItemA 1", "ItemB b", "ItemC b", "ItemD b", alist ﴿﴿;                   list.Add﴾ new TestListItem﴾ "ItemA 2", "ItemB c", "ItemC c", "ItemD c", alist ﴿﴿;                   list.Add﴾ new TestListItem﴾ "ItemA 3", "ItemB d", "ItemC d", "ItemD d", alist ﴿﴿;                   list.Add﴾ new TestListItem﴾ "ItemA 4", "ItemB e", "ItemC e", "ItemD e", alist ﴿﴿;                   list.Add﴾ new TestListItem﴾ "ItemA 5", "ItemB f", "ItemC f", "ItemD f", alist ﴿﴿;                     list2.Add ﴾new TestListItem2﴾"SubItem A"﴿﴿;                   list2.Add﴾new TestListItem2﴾"SubItem B"﴿﴿;                   list2.Add﴾new TestListItem2﴾"SubItem C"﴿﴿;                   list2.Add﴾new TestListItem2﴾"SubItem D"﴿﴿;                   list2.Add﴾new TestListItem2﴾"SubItem E"﴿﴿;                   list2.Add﴾new TestListItem2﴾"SubItem F"﴿﴿;      }           void OnNeedDataSource﴾object source, GridNeedDataSourceEventArgs e﴿         {           if ﴾!e.IsFromDetailTable﴿           {               grid.DataSource = list;           }           else          {               //grid.MasterTableView.DataSource = list2;           }       }                 public class TestListItem       {           private string _a;           private string _b;           private string _c;           private string _d;           List<string> _aList;             public TestListItem﴾ string a, string b, string c, string d,List<string> aList ﴿           {               this._a = a;               this._b = b;               this._c = c;               this._d = d;  
  • 5. 9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 5/7             this._aList = aList;           }             public string A           {               get              {                   return this._a;                }               set              {                   this._a = value;               }           }                                   public string B           {               get              {                   return this._b;               }                                          set              {                   this._b = value;               }             }                      public string C           {               get              {                   return this._c;               }                                          set              {                   this._c = value;               }             }           public string D           {               get              {                   return this._d;  
  • 6. 9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 6/7             }                 set              {                   this._d = value;               }             }                      public List<string> AList           {               get              {                   return this._aList;               }               set              {                   this._aList = value;               }           }        }           public class TestListItem2         {             private string _a1;               public TestListItem2﴾string a1﴿             {                 this._a1 = a1;             }               public string A1             {                 get                {                     return this._a1;                 }                 set                {                     this._a1 = value;                 }             }             }   }   
  • 7. 9/1/2015 RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? | The ASP.NET Forums http://forums.asp.net/t/1551140.aspx?RadGrid+dynamically+building+a+grid+and+adding+a+hierarchy+with+declarative+relations+row+ 7/7 Re: RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? May 12, 2010 08:01 AM | bloggernext dude post it in their forum http://www.telerik.com/community/forums/aspnet‐ajax/grid.aspx ﴾http://www.telerik.com/community/forums/aspnet‐ajax/grid.aspx﴿ the response is always quick.   Re: RadGrid: dynamically building a grid and adding a hierarchy with declarative relations row? May 12, 2010 08:01 AM | bloggernext dude post it in their forum http://www.telerik.com/community/forums/aspnet‐ajax/grid.aspx ﴾http://www.telerik.com/community/forums/aspnet‐ajax/grid.aspx﴿ their response is always quick.   This site is managed for Microsoft by Neudesic, LLC. | © 2015 Microsoft. All rights reserved.