listitem

Attaching an object to an already existing ListItem?

烈酒焚心 提交于 2019-12-06 10:46:18
In a ListView, how can I attach an object at any time to an already existing ListItem? (I know I can attach an object to a ListItem with AddItem , however I need to attach the object after the ListItem has been created). You can access it through the TListItem.Data property. For example: var ListItem: TListItem; begin ListView1.AddItem('Item 1', nil); ... ListItem := ListView1.Items[0]; ListItem.Data := Edit1; TEdit(ListItem.Data).Text := 'Updated text...'; end; You could solve this using the Data property of TListItem . That's often a quick and easy approach. The only slight wrinkle is if you

How to set multiple items as selected in ListBox?

放肆的年华 提交于 2019-12-06 02:57:35
问题 I have one ListBox with selection mode of multiple. In code behind, I want to set some values as selected. These values are present in a ListItems[] named 'Names' . HTML code: <asp:ListBox ID="lbto" class="chosen" runat="server" Width="450px" Height="20px" SelectionMode="Multiple"> <asp:ListItem>Mandy</asp:ListItem> <asp:ListItem>Amit</asp:ListItem> <asp:ListItem>sundar</asp:ListItem> <asp:ListItem>ragu</asp:ListItem> <asp:ListItem>raju</asp:ListItem> </asp:ListBox> ListItem[] Names contains

ForEach Extension Method for ListItemCollection

不打扰是莪最后的温柔 提交于 2019-12-05 08:20:39
I implemented an ExtensionMethod which basically works as ForEach-Loop, my Implementation looks like this: public static void ForEach(this ListItemCollection collection, Action<ListItem> act ) { foreach (ListItem item in collection) act(item); } However, I'd like the method to stop looping after the first time a specific condition is met. Here's how I currently use it: ddlProcesses.Items.ForEach(item => item.Selected = item.Value == Request["Process"]?true:false); The Problem with this is that there can only be one item inside the DropDownList which matches this requirement, but the loop is

setItemChecked (int position, boolean value) not working?

邮差的信 提交于 2019-12-05 05:37:35
I have a listview which is customized to display an image and 2 textview. I just simply wanted to highlight one of the item from my list. Firstly, I go with setSelection method of listview which i finally found out it is not the way as it is not working in touch mode. So, I do some searching and found that I'd need to use setItemChecked method. Thus, I make a state-list color. <?xml version="1.0" encoding="UTF-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:drawable="@color/checkbox_bg_fcs" /> <item android:drawable="@color

SharePoint list item permissions

泪湿孤枕 提交于 2019-12-05 00:47:41
问题 I want to programmatically make it so that users can see only particuar items on the list. Basically in an workflow that runs when an item is created I'm going to do some stuff and notify some people about this item. I also want it to change the permissions on the item so that only particular users (looked up on runtime based on the items contents) can read the item. The rest of the users that have access to the list will only see particular items but not all of them. The list item might not

programmatically add css class to ListItem

点点圈 提交于 2019-12-05 00:43:05
I need to produce with asp.net controls this structure, but ListItem doesn't allow add properties and classes. What is the best way to do it? <ul> <li class="1">SomeText</li> <li class="2">SomeText2</li> </ul> You can pass-through class attribute: <asp:BulletedList ID="BulletedList1" runat="server"> <asp:ListItem class="1">SomeText</asp:ListItem> <asp:ListItem class="2">SomeText2</asp:ListItem> </asp:BulletedList> . . . protected void Page_Load(object sender, EventArgs e) { ListItem listItem = new ListItem("Test 3"); listItem.Attributes.Add("class", "3"); BulletedList1.Items.Add(listItem); }

List view implementation with text view and toggle button i=

試著忘記壹切 提交于 2019-12-04 15:58:06
问题 Here in my application I want to create the list view with toggle button and text view. when I am clicking on the list item I want to go next Activity. But when I am clicking on the Toogle button I need to display it is in off mode or on mode. below I add my code. $ This is my main activity public class MainActivity extends Activity { int startminute; int endminute; Date date; ToggleButton togg; ListView lv; String[] days = { "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY",

How to set multiple items as selected in ListBox?

烂漫一生 提交于 2019-12-04 06:31:55
I have one ListBox with selection mode of multiple. In code behind, I want to set some values as selected. These values are present in a ListItems[] named 'Names' . HTML code: <asp:ListBox ID="lbto" class="chosen" runat="server" Width="450px" Height="20px" SelectionMode="Multiple"> <asp:ListItem>Mandy</asp:ListItem> <asp:ListItem>Amit</asp:ListItem> <asp:ListItem>sundar</asp:ListItem> <asp:ListItem>ragu</asp:ListItem> <asp:ListItem>raju</asp:ListItem> </asp:ListBox> ListItem[] Names contains 'ragu' and 'raju' . Now, when the page loads, the ListBox should contain 'ragu' and 'raju' as selected

SharePoint list item permissions

回眸只為那壹抹淺笑 提交于 2019-12-03 15:51:09
I want to programmatically make it so that users can see only particuar items on the list. Basically in an workflow that runs when an item is created I'm going to do some stuff and notify some people about this item. I also want it to change the permissions on the item so that only particular users (looked up on runtime based on the items contents) can read the item. The rest of the users that have access to the list will only see particular items but not all of them. The list item might not necessarily be owned but the user(s) that need to see it so I can't set the list permissions to letting

List view implementation with text view and toggle button i=

我是研究僧i 提交于 2019-12-03 10:06:52
Here in my application I want to create the list view with toggle button and text view. when I am clicking on the list item I want to go next Activity. But when I am clicking on the Toogle button I need to display it is in off mode or on mode. below I add my code. $ This is my main activity public class MainActivity extends Activity { int startminute; int endminute; Date date; ToggleButton togg; ListView lv; String[] days = { "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY" }; boolean[] onOff = new boolean[] { false, false, false, false, false, false, false };