AJAX Forums

Problem with Accordion control

This is a discussion on Problem with Accordion control within the AJAX Controls forums, part of the Advanced Ajax category; Hi, Good morning to everybody. I am developing one sample webpage using Accordion control in ASP.NET. I want to bind Accordion control with Database data. For this, there is a ...

Go Back   AJAX Forums > Advanced Ajax > AJAX Controls

AJAX Made Easy


AJAX Controls Discuss on AJAX Controls

Reply

 

LinkBack Thread Tools Display Modes
Old 01-22-2010, 05:59 AM   #1 (permalink)
Junior Member
 
Join Date: Jan 2010
Posts: 1
Rep Power: 0
kak.mca is on a distinguished road
Problem with Accordion control

Hi,
Good morning to everybody.

I am developing one sample webpage using Accordion control in ASP.NET.

I want to bind Accordion control with Database data. For this, there is a Employee(EName, Salary, Designation, DeptNo) table in the SQL Server database.

I want to print EName on the HeaderTemplate of the Accordion control along with RadioButton control.

I wnat to print all the remaining fields like Salary, Designation, DeptNo in the ContentTemplate of the Accordion control.

What I want to do is:

when I select one RadioButton which is on the HeaderTemplate, should automatically display ContentTemplate also of that AccordionPane. No problem, it is happening as it is the default behavior of Accordion control.

THE MAIN PROBLEM IS HERE:

When I select RadioButton which is on the HeaderTemplate of the Accordion control, previously selected RadioButton selection IS NOT GOING. Means, the two RadioButtons are also have been left selected.

BUT I WANT ONLY ONE RADIOBUTTON SHOULD BE SELECTED.

Can anybody please tell what is the problem?

This is my code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AccordionRadioTest.aspx.cs" Inherits="AccordionRadioTest" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Accordion + Radio Button</title>
<script type="text/javascript">
var index = 0;
function pageLoad()
{
var accordion = $find('<%= Accordion1.ClientID %>'+'_AccordionExtender');
accordion.add_selectedIndexChanged(onACESelectedIn dexChanged);
}
function onACESelectedIndexChanged(sender, eventArgs)
{
var radioButton =
index = sender.get_SelectedIndex();
alert(index);
if(index == -1)alert('Already opened');
alert(sender.Name);
}
//Stop doing undo
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<cc1:Accordion ID="Accordion1" runat="server" DataSourceID="SqlDataSource1" RequireOpenedPane="false">
<HeaderTemplate>
<asp:RadioButton ID="RadioButton1" GroupName="EmpGroup" runat="server" />
<b><%# Eval("EName") %></b>
</HeaderTemplate>
<ContentTemplate>
Salary: <%#Eval("Sal") %><br />
Designation: <%#Eval("Designation") %><br />
Department No: <%#Eval("DeptNo") %>
</ContentTemplate>
</cc1:Accordion>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ connectionStrings:STIRAConnectionString %>"
SelectCommand="SELECT EName, Sal, Designation, DeptNo FROM Employee"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
kak.mca is offline   Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
click event in AJAX Accordion Control sasil AJAX Help 0 12-26-2008 03:57 AM
How do you control the height of DIV section using CSS? SwissCheeseo XHTML and CSS 3 06-08-2007 02:51 PM
I want to know that How Can I placed Ajax Control in my Webpage to display data Jack J AJAX Controls 1 06-05-2007 09:50 AM
Menu Control via CSS? Sam Braidley XHTML and CSS 1 05-20-2007 05:12 PM
How To Control Your Browsers History prabhu AJAX Articles 0 11-22-2006 06:13 AM


All times are GMT -4. The time now is 04:16 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Copyright ©2006 - 2009, AJAXwith.com