Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...HOW TO Nested Grid in ASP.Net 2.0???HOW TO Nested Grid in ASP.Net 2.0???
Previous
 
Next
New Post
4/13/2006 5:47 AM
 

Problem 1:

i want nesting of grids like in hierarchical format (Expand-collapse) in ASP.Net 2.0, is there any trick to do that without heavy javascript or HTML? is there any way to do that using new GridView control?

i have done something like this (http://www.samspublishing.com/content/images/chap4_0672326744/elementLinks/fig04.jpg)

but i want the child grid only show when i click the select button( itemcommand event) of the parent grid and only current row display the child grid not others...

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Problem 2:

another example i tried is  http://msdn.microsoft.com/msdnmag/issues/03/10/CuttingEdge/

it has the proper format what i want but when i connect it with my sql server data it is showing me error: "The relation is not parented to the table to which this DataView points"

my tables are:

tbl1:

RegionCode -RegionName
R1   -North Region
R2   -Mumbai Region
R3   -East Region
R4   -South Region
R5   -Gujarat Region
R6   -Maharashtra Region

tbl2:

RegionCode -ZoneCode  -ZoneName
R1   -R1Z1   -Delhi NCR
R1   -R1Z2   -U.P, Bihar & Uttaranchal
R1   -R1Z3   -Haryana
R1   -R1Z4   -Punjab
R1   -R1Z5   -Chandigarh
R1  -R1Z6   -M.P.
R1   -R1Z7   -Jaipur
R2   -R2Z1   -Mumbai
R3   -R3Z1   -Kolkatta
R3   -R3Z2   -Rest of East

 


code is:

protected void Page_Load(object sender, System.EventArgs e)
  {
   // Put user code to initialize the page here
   if (!IsPostBack)
   {
    SqlDataAdapter adapter = new SqlDataAdapter(
 "SELECT * from tbl1", "SERVER=local;DATABASE=mydata0607;UID=sa;pwd=sa");

    SqlDataAdapter adapter1 = new SqlDataAdapter("select * from tbl2", "SERVER=local;DATABASE=mydata0607;UID=sa;pwd=sa");
               
    DataSet data = new DataSet();
                adapter.Fill(data, "tbl1");
                adapter1.Fill(data, "tbl2");

                data.Tables[0].TableName = "tbl1";
                data.Tables[1].TableName = "tbl2";


                string relName = "tbl12tbl2";
                DataRelation rel = new DataRelation(relName,
                    data.Tables["tbl1"].Columns["RegionCode"],
                    data.Tables["tbl2"].Columns["RegionCode"]);
                data.Relations.Add(rel);

                    Cache["MyData"] = data;
   }
   
   BindData();
 }


  protected void UpdateView(object sender, System.EventArgs e)
  {
   BindData();
  }

 
  private void BindData()
  {
   // Bind the data source
   dataGrid.DataSource = (DataSet) Cache["MyData"];
            dataGrid.DataMember = "tbl1";

   // Bind the data
   dataGrid.DataBind();
  }

 

//'please help me...

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...HOW TO Nested Grid in ASP.Net 2.0???HOW TO Nested Grid in ASP.Net 2.0???


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out