tags:

views:

143

answers:

1

How can i Bind data in Accordian in C# .net

A: 

You use the property DataSource and set it to your Item List which you want to bind.

After that you need to call DataBind() have a look at Accordion Sample for Ajax Toolkit

  • DataSource - The data source to use.
  • DataBind() must be called.
  • DataSourceID - The ID of the data source to use. DataMember - The member to bind to when using a DataSourceID

And here is an example

private void BindAccordion() 
{ 
  sql = "Select distinct Cus_Type from Customers"; 
  SqlDataAdapter da = new SqlDataAdapter(sql, “YourConnectionString”); 
  DataTable dt = new DataTable(); 
  da.Fill(dt); 

  Accordion1.DataSource = dt.DefaultView; 
  Accordion1.DataBind(); 
}

From Simple Parent-Child data binding using Accordion

Filip Ekberg
Actually I hav use <contentTemplate> in HTML but it didnt work.
Fly In SKY
The content template is what is used when you Bind something, see the link I provided, you will have an answer there! Follow their example and you should be good to go.
Filip Ekberg