The following method will be invoked during an ItemDataBound event occurs.
Code:
protected void DataBoundList(Object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
// Get a handle to the ddlState DropDownList control
DropDownList ddl = (DropDownList)e.Item.FindControl("ddlState");
// Make sure we have the handle !
if (ddl != null)
{
ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByText
(strCurrentState));
}
}
}
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!