---
title: "ListView DropDownList Edit ListView"  
description: "ListView DropDownList Edit ListView"  
author: "Anonymous User"  
published: 2014-08-23  
updated: 2014-08-23  
canonical: https://www.mindstick.com/forum/2108/listview-dropdownlist-edit-listview  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 2 minutes  

---

# ListView DropDownList Edit ListView

I have created a [ListView](https://www.mindstick.com/articles/12744/listview-in-android) that has [editing](https://www.mindstick.com/startup/27/photoroom-the-ai-powered-app-transforming-photo-and-video-editing) enabled, the [wizard](https://answers.mindstick.com/qa/34027/which-sporstman-is-known-as-the-wizard-of-hockey) generated the table with the use of textboxes but i require the use of dropdown [lists](https://www.mindstick.com/articles/126273/books-commonly-found-on-college-reading-lists) for some options.

I have created the [dropdown list](https://www.mindstick.com/forum/760/dropdown-list-open-hide-behind-another-dropdown-list-on-ie-7)

```
 <asp:DropDownList ID="ActionStatusTextBox" runat="server">                    <asp:ListItem Value="Ongoing">Ongoing</asp:ListItem>                    <asp:ListItem Value="Open">Open</asp:ListItem>                    <asp:ListItem Value="Closed">Closed</asp:ListItem> </asp:DropDownList>
```

The [drop down](https://www.mindstick.com/forum/263/drop-down-list-problem) list generates successfully but doesn't submit and enter itself in the databse.

<%# Bind("ActionStatus") %>'

The above snippet needs to used somewhere in order to bind the data but which [parameter](https://www.mindstick.com/blog/450/parameter-class-in-c-sharp) does it need attaching to to [pass the data](https://answers.mindstick.com/qa/33498/how-do-you-pass-the-data-to-sub-activities-android-explain-for-example)?

I've tried everything and its [giving](https://yourviews.mindstick.com/view/80639/regifting-is-far-better-than-giving-away-a-bouquet) me a right headache!

Thanks

## Replies

### Reply by Sumit Kesarwani

Hi Ankita, \

```
protected void ContactsListView_ItemDataBound(object sender,ListViewItemEventArgs e){  //Verify there is an item being edited.  if(ContactsListView.EditIndex >= 0)  {    //Get the item object.    ListViewDataItem dataItem = (ListViewDataItem)e.Item;    // Check for an item in edit mode.    if(dataItem.DisplayIndex == ContactsListView.EditIndex)    {      // Preselect the DropDownList control with the Title value      // for the current item.      // Retrieve the underlying data item. In this example      // the underlying data item is a DataRowView object.              DataRowView rowView = (DataRowView)dataItem.DataItem;      // Retrieve the Title value for the current item.       String title = rowView["Title"].ToString();      // Retrieve the DropDownList control from the current row.       DropDownList list = (DropDownList)dataItem.FindControl("TitlesList");      // Find the ListItem object in the DropDownList control with the       // title value and select the item.      ListItem item = list.Items.FindByText(title);      list.SelectedIndex = list.Items.IndexOf(item);    }  }}
```


---

Original Source: https://www.mindstick.com/forum/2108/listview-dropdownlist-edit-listview

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
