Jun 19, 2020
Six X Movie 720p Download Movie
Yeh Dil Aashiqanaa (2002) Hindi Movie DvDRip X264 32
2020 Yeh Dil Aashiqanaa (2002) Hindi Movie DvDRip X264 32 [Kodi Format 720p, 360p, 480p, DvDRip] English Movie - download video 1.
Q:
How to get selected value of dropdownlist inside a gridview in asp.net
I have a dropdownlist inside my gridview,
When the user clicks on a row of the gridview, I need the selected value of the dropdownlist in my database.
Following is my code
foreach (GridViewRow row in GridView1.Rows)
{
DropDownList1.Attributes.Add("onclick", "alert('" + DropDownList1.SelectedItem.Text + "')");
DropDownList1.Attributes.Add("OnSelectedIndexChanged", "test");
DropDownList1.Attributes.Add("SelectedIndex", row.RowIndex.ToString());
}
This code only works when I'm using the default RowDataBound method.
but this will work on postback(on updatepanel).
So, Is there any way to get the selected value of the dropdownlist from a gridview on selecting the row on pageload?
A:
Use the RowDataBound method to bind the DataItem to the Row. This will allow you to use the CurrentRow property to access the DataItem.
protected void gridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{ be359ba680
Related links:
Comments