What is Bubble Event ?

Answer Posted / sudheer

parent control raised the child control events.ex:In the
grid view we are placing the one dropdown.But dropdown can't
raised the onselectedIndexchanged event.Just follow the
below code
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
onrowcommand="GridView1_RowCommand"
onrowdatabound="GridView1_RowDataBound">
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList ID="ddlItems" runat="server"
DataSource='<% #BindCombo() %>' DataValueField="AuthorID"
DataTextField="author"
OnSelectedIndexChanged="ddlItems_SelectedIndexChanged"
AutoPostBack="true">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
protected System.Data.DataSet BindCombo()
{
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXml(Server.MapPath("./XmlFiles/DBFile.xml"));
return ds;
}
protected void ddlItems_SelectedIndexChanged(object sender,
EventArgs e)
{
foreach(GridViewRow row in GridView1.Rows)
{
DropDownList ddlList =
(DropDownList)row.FindControl("ddlItems");
string items = ddlList.SelectedItem.Text.ToString();
}
}

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you create an instance of a static class?

548


What is c# windows form application?

493


Why do we use interface in c#?

478


If the interface in c# only contains the declaration of the methods and we need to define those methods in the class, then why we use the interface?

556


Differentiate between method overriding from method overloading with its functionality?

531






Why we use delegates in c#?

495


How to do and Apply Themes to Datagrid,Lable,Textbox,etc., in C#.NET 2005 Windows Application? (like who we will do themes in ASP.NET using .CSS and .SKIN files). Urgent!!

1678


What is a dbml?

494


My switch statement works differently! Why?

509


Explain code compilation in c#.

518


How does yield return work c#?

504


What is an assembly in dotnet?

544


What is meaning of type safety in c#?

459


What is dll in vb.net?

480


What are scriptable objects?

502