This is a migrated thread and some comments may be shown as answers.

How to bind Panel placed in NestedViewtemplate through code behind

3 Answers 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Masroor
Top achievements
Rank 1
Masroor asked on 22 Dec 2011, 09:34 AM
Actually I am working on Grid / NestedViewTemplate Relations.My requirement is to show the details of Customers in  inner Panel placed in nestedviewtemplate.



But not able to bind the panel and nestedviewtemplate from code behind.I have the exact requirement as shown in the link the only thing I want to bind the data from code behind instead of SqldataSource.

Kindly suggest me the events which i have to use to bind the panel placed in nestedviewtemplate.

Thanks In Advance

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Dec 2011, 10:15 AM
Hello,

Try the following code.
C#:
protected void Page_Init(object sender, EventArgs e)
  {
      RadGrid grid = new RadGrid();
      grid.AutoGenerateColumns = true;
      grid.DataSourceID = "SqlDataSource1";
      grid.MasterTableView.NestedViewTemplate = new MyTemplate();
      grid.AllowPaging = true;
      grid.PageSize = 3;
      form1.Controls.Add(grid);
  }
  private class MyTemplate : ITemplate
  {
    public void InstantiateIn(System.Web.UI.Control container)
    {
      Panel panel1 = new Panel();
      panel1.Width = Unit.Pixel(250);
      panel1.Height = Unit.Pixel(250);
      panel1.BackColor = System.Drawing.Color.Red;
      Label label1=new Label(); // add label inside panel
      label1.Text="Contact Title";
      panel1.Controls.Add(label1);
      container.Controls.Add(panel1);
    }
   }

-Shinu.
0
Masroor
Top achievements
Rank 1
answered on 22 Dec 2011, 11:06 AM
Thanks for the reply.

But I guess you didn't get my requirement kindly go to the link mentioned above I need the same on clicking the expand button of grid I need the details which are in a panel placed in nestedviewtemplate.I want to do this by binding the datasource through code behind so for that I need some events where I have to bind the data....
0
Suresh Krishna
Top achievements
Rank 1
answered on 31 Jul 2013, 11:59 AM
Hi Masroor,


I know its too long to ask this, but Have you got any solution for your question. I have come across something similar. If you have the answer please let me know.


regards,
Tags
General Discussions
Asked by
Masroor
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Masroor
Top achievements
Rank 1
Suresh Krishna
Top achievements
Rank 1
Share this question
or