View Single Post
  #9 (permalink)  
Old 03-29-2008, 12:12 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Cool Re: ListView server control in ASP.Net 3.5

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!
Reply With Quote