listitem

ListItems attributes in a DropDownList are lost on postback?

自作多情 提交于 2019-12-17 03:34:42
问题 A coworker showed me this: He has a DropDownList and a button on a web page. Here's the code behind: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ListItem item = new ListItem("1"); item.Attributes.Add("title", "A"); ListItem item2 = new ListItem("2"); item2.Attributes.Add("title", "B"); DropDownList1.Items.AddRange(new[] {item, item2}); string s = DropDownList1.Items[0].Attributes["title"]; } } protected void Button1_Click(object sender, EventArgs e) {

ListView onClickListner not working and Delete row from ListView

人走茶凉 提交于 2019-12-14 03:12:37
问题 list_item.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginTop="5dp"> <TextView android:id="@+id/mytitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="5dip" android:layout_marginTop="5dp" android:layout_toRightOf="@+id/icon" android:background="@drawable/textbox1" android

White Space around List View Items

风流意气都作罢 提交于 2019-12-13 06:01:28
问题 I am having a list view and its list items are generated using Array List and it creates unecessary white space which occupies much space. How do I remove it from the list items? Here is my list view: <ListView android:id="@+id/list" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:divider="@android:color/transparent" android:dividerHeight="10.0sp"/> And my list items: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http:/

foreach loop to retrieve list items and create a table

半城伤御伤魂 提交于 2019-12-13 03:22:12
问题 I am a little confused as to how to display list data in two columns in a webpart. Here is what i have at the moment (Webpart): <table width="100%"> <tr> <td width="50%"> <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> </td> <td width="50%"> <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder> </td> </tr> </table> and the code behind for it is the following: foreach (SPListItem oListItem in listItemCollection) { awardYear = oListItem["Year"].ToString();

How to create a nested bulleted list

二次信任 提交于 2019-12-12 19:56:34
问题 I am using ASP.net with C# and I would like to have a list that i can code dynamically to look like somewhat this: Menu Item A Sub Menu Link 1 Sub Menu Link 2 Sub Menu Link 3 so far i have managed to create the first past by doing this: BulletedList MainUl = new BulletedList(); MainUl.DisplayMode = BulletedListDisplayMode.HyperLink; ListItem item = new ListItem("Menu Item A", "http://www.google.com"); MainUl.Items.Add(item); panel.Controls.Add(MainUl); The problem is i do not know how to nest

CSS gap between list items in IE7

孤人 提交于 2019-12-12 19:19:17
问题 I'm unable to remove the gap between the list items in IE7. HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link type="text/css" rel="stylesheet" href="base.css" /> </head> <body> <ul> <li> <div>row 1.1</div> <div>row 1.2</div> </li> <li> <div>row 2.1</div> <div>row 2.2</div> </li> <li> <div>row 3.1</div> <div>row 3.2</div> </li> </ul> </body> </html> CSS: ul { padding: 0px; margin: 0px; } li { list-style-type:

Sorting List Items (Latest one first)

安稳与你 提交于 2019-12-12 18:40:28
问题 I am having trouble displayin the values of list itmes in the proper order. The following are the fields in the list (with their actual system names): -Title -Category -NominatedWon -Logo The "Title" field contains year values eg, "2011", "2010", etc. //getting the awards list and extracting correct values from the necesary fields //asp running with elevated privilegs SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(webUrl)) { using (SPWeb web = site.OpenWeb()

List Item child not refreshing

断了今生、忘了曾经 提交于 2019-12-12 05:39:58
问题 I am writing an custom list, in which displayed 3rd list item has toggle button as an child. On toggle button click it launch an confirmation dialog, if wants toggle button or not. Now if list not scrolled then it work perfect. But if scroll list(so 3rd displayed as 1st item) then button toggle state(for toggleButton.setChecked(false) ) not working after Dialog-Cancel action. Any suggestion if I am missing anything. EDIT public View getView(int position, View convertView, ViewGroup parent) {

Change event on TextField inside ListView Template

最后都变了- 提交于 2019-12-12 04:26:17
问题 I've a ListView Template, that has a title Label, 2 button Views (more and less) and a TextField with a value, I need to add a change event to this TextField. <ItemTemplate name="item" id="item" bindId="item"> <View id="row" bindId="row"> <Label bindId="title" id="title"/> <View id="options" bindId="options"> <View class="option" bindId="less" id="less"/> <TextField bindId="input" id="input"/> <View class="option" bindId="more" id="more"/> </View> </View> </ItemTemplate> In the change event I

How does WPF sets a list item value?

爱⌒轻易说出口 提交于 2019-12-12 03:31:07
问题 I have a WPF application (MVVM pattern) with databinding to strings and list of strings: public string Property { get { return _model.property; } set { if (value == _model.property) { return; } _model.property= value; base.NotifyPropertyChanged(); } } public List<string> PropertyList { get { return _model.PropertyList; } set { if (value == _model.PropertyList) { return; } _model.PropertyList= value; base.NotifyPropertyChanged(); } } My binding looks like this: <TextBox Text="{Binding Path