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

What is a trace and asset? Explain some differences?

703


What is a byte in c#?

555


Why do we need singleton pattern in c#?

487


What exactly is serverless?

426


How does inheritance work in c#?

624






Can struct have constructor c#?

507


What basic steps are needed to display a simple report in crystal?

540


Explain what a diffgram, and a good use for one Define diffgram? How it be used?

552


What is data set in c#?

502


What is generic method in c#?

496


Describe how a .net application is compiled and executed

522


Int map to which .net types?

543


What problem does Delegate Solve?

568


What is console read in c#?

489


What is the difference between package and interface?

497