473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

RadionButtonList in DataList

Hi,
RadioButtonList's onSelectionIndexChanged event is not firing.Earlier it was
working fine.But now its no working.
Help me get out of this!.................
Expand|Select|Wrap|Line Numbers
  1. .Aspx Page
  2. <asp:DataList>
  3. <ItemTemplate>
  4. <asp:RadioButtonList id="rdbList" Runat="server" OnSelectedIndexChanged="OnSelection" AutoPostBack="True">
  5. <asp:ListItem Value="1">1</asp:ListItem>
  6. <asp:ListItem Value="2">2</asp:ListItem>                                </asp:RadioButtonList></ItemTemplate></asp:DataList>
  7.  
  8. CodeBehind
  9. public OnSelection()
  10. {
  11. code goes here.
  12. }
  13.  
  14.  
Mar 2 '07 #1
6 1873
radcaesar
759 Expert 512MB
Earlier its workin ?

Then, check whether the code execution executes that assocaite method by debug the code using breakpoints.

:)
Mar 2 '07 #2
i did the same

But, not working :(

OnSelectedIndexChanged is not firing.
Any other help will be appreciated!!!!!!!!!

Thanks
Manisha


Earlier its workin ?

Then, check whether the code execution executes that assocaite method by debug the code using breakpoints.

:)
Mar 9 '07 #3
expert
1
[other language removed]

ok
Thanks:)

Hi,
RadioButtonList's onSelectionIndexChanged event is not firing.Earlier it was
working fine.But now its no working.
Help me get out of this!.................
Expand|Select|Wrap|Line Numbers
  1. .Aspx Page
  2. <asp:DataList>
  3. <ItemTemplate>
  4. <asp:RadioButtonList id="rdbList" Runat="server" OnSelectedIndexChanged="OnSelection" AutoPostBack="True">
  5. <asp:ListItem Value="1">1</asp:ListItem>
  6. <asp:ListItem Value="2">2</asp:ListItem>                                </asp:RadioButtonList></ItemTemplate></asp:DataList>
  7.  
  8. CodeBehind
  9. public OnSelection()
  10. {
  11. code goes here.
  12. }
  13.  
  14.  
Mar 9 '07 #4
bahut din ho gaye,but its not working

Please give any other solution
Mar 9 '07 #5
kenobewan
4,871 Expert 4TB
Have you written an alert or value in the first line of OnSelection to confirm it is not firing? Please post the OnSelection code.
Mar 9 '07 #6
<asp:datalist id="datalst" Runat="server" RepeatLayout="Table" CellPadding="5" CellSpacing="5"
BorderWidth="0" RepeatColumns="4">
<ItemTemplate>
<asp:Label id=lbllogoid Visible="false" Runat="server" text='<%# DataBinder.Eval(Container.DataItem,"UsrLogoId")%>' >
</asp:Label>
<asp:Image ID="logoimg" Runat="server" ImageUrl='<%#ImageUrl(Convert.ToInt32(DataBinder.E val(Container.DataItem,"UsrLogoId")))%>'></asp:Image>
<asp:RadioButtonList id="rdbList" Runat="server" EnableViewState="True" OnSelectedIndexChanged="OnSelection" AutoPostBack="True">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:datalist>







public void OnSelection(object sender, System.EventArgs e)
{
int selectedvalue;
for(int i=0;i<datalst.Items.Count;i++)
{
RadioButtonList rdb=(RadioButtonList)datalst.Items[i].FindControl("rdbList");
if(rdb.SelectedIndex > -1)
{
selectedvalue=Convert.ToInt32(rdb.SelectedItem.Val ue);
adjustelement(selectedvalue);
}
}

}
//Removing the selected option from other datalist items.
private void adjustelement(int x)
{
for(int i=0;i<datalst.Items.Count;i++)
{
RadioButtonList rdb=(RadioButtonList)datalst.Items[i].FindControl("rdbList");
for(int j=0;j<rdb.Items.Count;j++)
{
if(Convert.ToInt32(rdb.Items[j].Value)==x)
{
if(rdb.SelectedIndex>-1)
{
//remove other options except the selected one
for(int k=0;k<rdb.Items.Count;k++)
{
if(rdb.Items[k].Selected==false)
{
rdb.Items.RemoveAt(k);
k=k-1;
}
}
}
else
{
//remove same(selected) options from other items in the datalist
rdb.Items.RemoveAt(j);
}
}

}
}

}


i did put the breakpoints but all in vain as event is not firing :(
help me out or give me other solution where should i write this code.
Mar 9 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: pete K | last post by:
Is it possible in asp.net to have a datalist in the itemtemplate of another datalist? For example: <asp:datalist id="MyList" runat="server"> <ItemTemplate> <table border="0" width="300">...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
4
by: Patrick.O.Ige | last post by:
I have a CheckBoxList in a DataList and i'm trying to get item Selected after doing a postBack. I have set my CheckBoxlist AutoPostBack="True" Any ideas what 'm doing wrong? It seems not to...
6
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but...
2
by: Hans Merkl | last post by:
Hi, I am trying to use a user control as EditItemTemplate in a DataList. It loads fine but I can't figure out how to bind to the data of the DataList. Here is what I have got so far: ...
3
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template...
0
by: Les Caudle | last post by:
I have a menu system composed of a DataList nested inside a DataList. The outer DataList has it's DataSource (composed of a DataSet with two tables linked by a CategoryPagesRelation Relation) set...
1
by: AJ | last post by:
Hi all, With the following code in mind : <asp:DataList ID="dlOne" DataKeyField="myField1" DataSource="<%# GetDataSource1()" Runat="server"> <ItemTemplate> Output Value Here! <asp:DataList...
3
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.