Search Results

Search found 1331 results on 54 pages for 'listview'.

Page 23/54 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Python GUI does not update until entire process is finished

    - by ccwhite1
    I have a process that gets a files from a directory and puts them in a list. It then iterates that list in a loop. The last line of the loop being where it should update my gui display, then it begins the loop again with the next item in the list. My problem is that it does not actually update the gui until the entire process is complete, which depending on the size of the list could be 30 seconds to over a minute. This gives the feeling of the program being 'hung' What I wanted it to do was to process one line in the list, update the gui and then continue. Where did I go wrong? The line to update the list is # Populate listview with drive contents. The print statements are just for debug. def populateList(self): print "populateList" sSource = self.txSource.Value sDest = self.txDest.Value # re-intialize listview and validated list self.listView1.DeleteAllItems() self.validatedMove = None self.validatedMove = [] #Create list of files listOfFiles = getList(sSource) #prompt if no files detected if listOfFiles == []: self.lvActions.Append([datetime.datetime.now(),"Parse Source for .MP3 files","No .MP3 files in source directory"]) #Populate list after both Source and Dest are chosen if len(sDest) > 1 and len(sDest) > 1: print "-iterate listOfFiles" for file in listOfFiles: sFilename = os.path.basename(file) sTitle = getTitle(file) sArtist = getArtist(file) sAlbum = getAblum(file) # Make path = sDest + Artist + Album sDestDir = os.path.join (sDest, sArtist) sDestDir = os.path.join (sDestDir, sAlbum) #If file exists change destination to *.copyX.mp3 sDestDir = self.defineDestFilename(os.path.join(sDestDir,sFilename)) # Populate listview with drive contents self.listView1.Append([sFilename,sTitle,sArtist,sAlbum,sDestDir]) #populate list to later use in move command self.validatedMove.append([file,sDestDir]) print "-item added to SourceDest list" else: print "-list not iterated"

    Read the article

  • Android: onListItemClick not opening up the .xml file

    - by Capsud
    Hi, public void onListItemClick(ListView l, View v, int position, long id) { if(position == 0){ setContentView(R.layout.cuisine); } } I have an array of Strings and i'm using the above method to try and open up a new xml file called 'cuisine' when it is clicked. but it keeps failing! Have I done this right, or what am I doing wrong? Thanks. Ok from looking at similar problems on the web, people have said to get the onListItemClick() to start a new activity and using that new activity to then open up the new view? So what i've done is this... protected void onListItemClick(ListView l, View v, int position, long id) { Intent dundrumIntent = new Intent(v.getContext(), DundrumSelector.class); dundrumIntent.putExtra("position", position); startActivityForResult(dundrumIntent, 0); } and then import android.app.Activity; import android.os.Bundle; public class DundrumSelector extends Activity { @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); int position = getIntent().getExtras().getInt("position"); if(position == 0){ setContentView(R.layout.cuisine); } } } Yet i'm still getting the same problem. The program crashes when I click on an item in the listView. And yes i've added the activity to the manifest. Does anyone have a resolution to this as alot of people seem to be having the same problem. Thanks alot.

    Read the article

  • Android: CustomListAdapter

    - by primal
    Hi, I have implemented a custom list view which looks like the twitter timeline. adapter = new MyClickableListAdapter(this, R.layout.timeline, mObjectList); setListAdapter(adapter); The constructor for MyClickableListAdapter is as follows private class MyClickableListAdapter extends ClickableListAdapter{ public MyClickableListAdapter(Context context, int viewId, List objects) { super(context, viewId, objects); } ClickableListAdapter extends BaseAdapter and implements the necessary methods. The xml code for the list view is as follows <ListView android:id="@+id/android:list" android:layout_width="fill_parent" android:layout_height="wrap_content" /> This is what it looks like. I have 3 questions 1) I tried registering a context menu for the list view by adding the line after setting the list adapter registerforContextMenu(getListView()); But on long-click the menu doesnt get displayed. I cannot understand what I am doing wrong! 2) Is it possible to display a textview above the listview? I tried it by adding the code for textview above the listview. But then, only the textview gets displayed. 3) I have seen in many twitter clients that on clicking post a window pops up from the top covering only some portion of the screen and rest of the timeline is visible. How can this be done possibly without starting a new activity? Any help would be much appreciated..

    Read the article

  • Android App crashing on Back Button (performResumeActivity)

    - by Rutger
    My App consists of 2 Activities at the moment. . the MAIN activity with a Gallery View . a FriendsListActivity with a ListView When the user moves away from the FriendsListActivity with the back button, and returns to the MAIN activity the following error keeps popping up in debug mode. DalvikVM[localhost:8676] Thread [<1 main] (Suspended (exception RuntimeException)) ActivityThread.performResumeActivity(IBinder, boolean) line: 2095 ActivityThread.handleResumeActivity(IBinder, boolean, boolean) line: 2110 BinderProxy(ActivityThread$H).handleMessage(Message) line: 954 ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 3647 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 507 ZygoteInit$MethodAndArgsCaller.run() line: 839 ZygoteInit.main(String[]) line: 597 NativeStart.main(String[]) line: not available [native method] Thread [<8 Binder Thread #2] (Running) Thread [<7 Binder Thread #1] (Running) With the LogCat 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): FATAL EXCEPTION: main 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): java.lang.RuntimeException: Unable to resume activity {com.package.MAIN/com.package.MAIN.MAIN}: java.lang.NullPointerException 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2095) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2110) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:954) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.os.Handler.dispatchMessage(Handler.java:99) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.os.Looper.loop(Looper.java:123) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread.main(ActivityThread.java:3647) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at java.lang.reflect.Method.invokeNative(Native Method) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at java.lang.reflect.Method.invoke(Method.java:507) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at dalvik.system.NativeStart.main(Native Method) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): Caused by: java.lang.NullPointerException 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at com.package.MAIN.MAIN.onResume(MAIN.java:91) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.Activity.performResume(Activity.java:3833) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2085) 03-13 22:01:10.972: ERROR/AndroidRuntime(1038): ... 10 more Further info in the Variables panel states: this: ActivityThread e: NullPointerException cause: NullPointerException detailMessage: null stackTrace: null r: ActivityThread$ActivityClientRecord activity: MAIN detailMessage after one Eclipse Resume: Unable to resume activity (MAIN) The code from the FriendsListActivity looks like this public class FriendsListActivity extends ListActivity { // =========================================================== // Fields // =========================================================== private ArrayList<Friend> friends = new ArrayList<Friend>(); private FriendsArrayAdapter friendsArrayAdapter; private ListView listView; // =========================================================== // onCreate // =========================================================== @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.friends_list); registerForContextMenu(getListView()); setButtonNewFriendClickListener(); } public void generateFriendsList() { FriendsService fs = new FriendsService(this); friends = fs.getFriendsList(); listView = (ListView) findViewById(android.R.id.list); friendsArrayAdapter = new FriendsArrayAdapter( this, R.layout.friend_list_item, friends); listView.setAdapter(friendsArrayAdapter); } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.friends_context_menu, menu); } @Override public boolean onContextItemSelected(MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); FriendsService fs = new FriendsService(this); Friend f = new Friend(); f = friends.get(info.position); switch (item.getItemId()) { case R.id.edit: Intent i = new Intent(this, FriendEditActivity.class); i.putExtra("userid", f.userId); startActivity(i); return true; case R.id.delete: fs.deleteFriend(f.userId); generateFriendsList(); return true; default: return super.onContextItemSelected(item); } } // =========================================================== // onPause // =========================================================== protected void onPause() { super.onPause(); finish(); } // =========================================================== // onResume // =========================================================== protected void onResume() { super.onResume(); generateFriendsList(); } // =========================================================== // onStop // =========================================================== protected void onStop() { super.onStop(); } // =========================================================== // onDestroy // =========================================================== @Override protected void onDestroy() { super.onDestroy(); } // =========================================================== // Activity methods // =========================================================== private void setButtonNewFriendClickListener() { Button clickButton = (Button)findViewById(R.id.button_add_friend); clickButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent i = new Intent(v.getContext(), FriendNewActivity.class); startActivity(i); } }); } The AndroidManifest looks like this <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.package.mypackage"> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name="com.package.mypackage.mypackage" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".FriendsListActivity"></activity> <activity android:name=".FriendEditActivity"></activity> <activity android:name=".FriendNewActivity"></activity> <activity android:name=".TakePictureActivity"></activity> <activity android:name=".FriendsService"></activity> <activity android:name=".MyService"></activity> </application> <uses-sdk android:minSdkVersion="9" /> The MAIN activity looks like this: package com.package.mypackage; import java.util.ArrayList; import com.package.domain.Domain; import com.package.service.MyService; import com.package.viewadapter.myImageAdapter; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.Window; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemLongClickListener; import android.widget.Button; import android.widget.Gallery; import android.widget.Toast; public class myActivity extends Activity { // =========================================================== // Fields // =========================================================== private MyImageAdapter myImageAdapter; private ArrayList<Domain> domain = new ArrayList<Domain>(); // =========================================================== // onCreate // =========================================================== @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); /* Set Buttons to listen for any click event. */ setButtonFriendsClickListener(); setButtonCameraClickListener(); setButtonPreferencesClickListener(); } // =========================================================== // onStart // =========================================================== @Override public void onStart() { super.onStart(); /* Find the gallery defined in the main.xml */ Gallery g = (Gallery) findViewById(R.id.gallery); /* Show a Toast message when image is clicked */ g.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { MyImageAdapter image_ID = new MyImageAdapter(myActivity.this, position, null); if (image_ID.getItemId(position) == 0) { Toast test_toast = Toast.makeText(myActivity.this, "This is the New Image click", Toast.LENGTH_SHORT); test_toast.show(); } else { Toast test_toast = Toast.makeText(myActivity.this, "The clicked image has image number " + image_ID.getItemId(position) + " in the imageadapter.", Toast.LENGTH_SHORT); test_toast.show(); } } }); g.setOnItemLongClickListener(new OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View v, int position, long id) { MyImageAdapter image_ID = new MyImageAdapter(myActivity.this, position, null); Toast test_toast = Toast.makeText(myActivity.this, "The long clicked image has image number " + image_ID.getItemId(position) + " in the imageadapter.", Toast.LENGTH_SHORT); test_toast.show(); return true; } }); } // =========================================================== // onPause // =========================================================== protected void onPause() { super.onPause(); } // =========================================================== // onResume // =========================================================== protected void onResume() { super.onResume(); generateMyGallery(); } // =========================================================== // onStop // =========================================================== protected void onStop() { super.onStop(); } // =========================================================== // onDestroy // Is also called when user changes from horizontal // to vertical orientation and back // =========================================================== @Override protected void onDestroy() { super.onDestroy(); } // =========================================================== // Save and Restore UI states // =========================================================== @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); } protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); } // =========================================================== // Main Activity methods // =========================================================== public void generateMyGallery() { MyService cs = new MyService(this); domain = cs.getDomainList(); // Add the new_image drawable to the ArrayList Domain d = new Domain(); d.photoLocation = "drawable"; d.photoName = "new_image"; d.extra1 = "no_text"; d.extra2 = "no_text"; domain.add(0, d); myImageAdapter = new MyImageAdapter(this, R.layout.text_overlay_image_view, domain); /* Find the gallery defined in the main.xml */ Gallery g = (Gallery) findViewById(R.id.gallery); g.setSpacing(10); /* Apply a new (custom) ImageAdapter to it. */ g.setAdapter(myImageAdapter); g.setSelection(1); } private void setButtonFriendsClickListener() { Button clickButton = (Button)findViewById(R.id.button_friends_list); clickButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { setContentView(R.layout.friends_list); Intent myIntent = new Intent(v.getContext(), FriendsListActivity.class); startActivity(myIntent); } }); } private void setButtonCameraClickListener() { Button clickButton = (Button)findViewById(R.id.button_take_picture); clickButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { setContentView(R.layout.take_picture); Intent myIntent = new Intent(v.getContext(), TakePictureActivity.class); startActivity(myIntent); } }); } private void setButtonPreferencesClickListener() { Button clickButton = (Button)findViewById(R.id.button_preferences); clickButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent myIntent = new Intent(v.getContext(), MyPreferencesActivity.class); startActivity(myIntent); } }); } }; Anyone has an idea why the App crashes. Any help is much appreciated. I did find out that, when I finish() the MAIN activity when I start the FriendListActivity and restart the MAIN activity when closing the FriendListActivity, that the crash does not occur. However, this basically restarts the App and that is not the intention. Thanks all, I got the problem solved. This is what I did. . When moving all gallery related actions to the onCreate, the creash didn't happen anymore. But then after returning to the MAIN activity, the activity wasn't shown. . I then moved all the onCreate (except the super), the generateGallery, and the onStart() to the onResume. Now it works fine!

    Read the article

  • Dismiss android activity displayed as Popup

    - by Sit
    So i have a service, that starts an activity displayed as a Popup thank's to "android:style/Theme.Dialog" This Activity shows a Listview, with a list of application. On each element of the listview, there is a short description of the application, and two buttons. 1 for launching the application 2 for displaying a toast with more informations. Here is the code in my service : it starts the activity Intent intent = new Intent(this, PopUpActivity.class); intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getApplicationContext().startActivity(intent); this activity uses a custom layout, with a listview, adapted with a custom ArrayAdapter In this adaptater, i've put an action on the start button in order to start the current application Button lanceur = (Button) v.findViewById(R.id.Buttonlancer); lanceur.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { p.start(mcontext); } }); with p.start, i start the application. But now, if i press "back" from the application, i go back to the popup... and i can start another application. I don't want it to be possible. That's why i wish i could dismiss/destroy/finish my PopupActivity, but i can't manage to do it with the code i have.

    Read the article

  • WPF: How to set column width with auto fill in ListView with custom user control.

    - by powerk
    A ListView with Datatemplate in GridViewColumn: <ListView Name ="LogDataList" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding LogDataCollection}" Background="Cyan"> <ListView.View> <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Event Log Information"> <GridViewColumn Header="Event Log Name" Width="100"> <GridViewColumn.CellTemplate> <DataTemplate> <l:MyTextBlock Height="25" DataContext="{Binding LogName, Converter={StaticResource DataFieldConverter}}" HighlightMatchCase="{Binding Element}" Loaded="EditBox_Loaded"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> ... </GridView> </ListView.View> </ListView> I have no idea about how to make column width autofill although I have tried a lot of way to walk up. The general idea for demo is : <ListView Name ="LogDataList" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding LogDataCollection}" Background="Cyan"> <ListView.Resources> <Style x:Key="ColumnWidthStyle" TargetType="{x:Null GridViewColumn}"> <Style.Setters> <Setter Property="HorizontalContentAlignment" Value="Stretch" > </Setter> </Style.Setters> </Style> </ListView.Resources> <ListView.View> <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Event Log Information"> <GridViewColumn Header="Event Log Name" DisplayMemberBinding="{Binding Path=LogName}" HeaderContainerStyle="{StaticResource ColumnWidthStyle}"> It works, but not accord with my demand. I need to customize datatemplate with my custom user control(MyTextBlock) since the enhancement(HighlighMatchCase property) and binding datacontext. How can I set up ColumnWidthMode with Fill in the word? On-line'in. I really appreciate your help.

    Read the article

  • Focusable EditText inside ListView

    - by Joe
    I've spent about 6 hours on this so far, and been hitting nothing but roadblocks. The general premise is that there is some row in a ListView (whether it's generated by the adapter, or added as a header view) that contains an EditText widget and a Button. All I want to do is be able to use the jogball/arrows, to navigate the selector to individual items like normal, but when I get to a particular row -- even if I have to explicitly identify the row -- that has a focusable child, I want that child to take focus instead of indicating the position with the selector. I've tried many possibilities, and have so far had no luck. layout: <ListView android:id="@android:id/list" android:layout_height="fill_parent" android:layout_width="fill_parent" /> Header view: EditText view = new EditText(this); listView.addHeaderView(view, null, true); Assuming there are other items in the adapter, using the arrow keys will move the selection up/down in the list, as expected; but when getting to the header row, it is also displayed with the selector, and no way to focus into the EditText using the jogball. Note: tapping on the EditText will focus it at that point, however that relies on a touchscreen, which should not be a requirement. ListView apparently has two modes in this regard: 1. setItemsCanFocus(true): selector is never displayed, but the EditText can get focus when using the arrows. Focus search algorithm is hard to predict, and no visual feedback (on any rows: having focusable children or not) on which item is selected, both of which can give the user an unexpected experience. 2. setItemsCanFocus(false): selector is always drawn in non-touch-mode, and EditText can never get focus -- even if you tap on it. To make matters worse, calling editTextView.requestFocus() returns true, but in fact does not give the EditText focus. What I'm envisioning is basically a hybrid of 1 & 2, where rather than the list setting if all items are focusable or not, I want to set focusability for a single item in the list, so that the selector seamlessly transitions from selecting the entire row for non-focusable items, and traversing the focus tree for items that contain focusable children. Any takers?

    Read the article

  • There is no DoubleClick event for ListView control in .NET CF 3.5

    - by nmcy
    In my project, tree is a list of customers displayed in an ListView control, When user double clicks (or taps) on an item I should show the details of that customer, But there is no double click (or click event, mouse up and down events etc.) event in .NET CF 3.5 ListView control (we only have ItemActive and SelectedIndexChanged events) Is there anyone has figure out this problem?

    Read the article

  • Expandable listview Refreshing

    - by Sam97305421562
    Hi, I am using expandable listview i need to refresh as i am searching the list only for parent.I have searched for tutorial in which i can set visibility only for some parent but not all the expandable listview object . Thanks in advance.

    Read the article

  • Need help in using getScrollY() of ListView

    - by michael
    Hi, I have the following code which recording the scroll Y position in my ListView whenever my activity is paused. protected void onSaveInstanceState (Bundle outState) { super.onSaveInstanceState(outState); int scroll = mListView.getScrollY(); System.out.println (" scrollY" + scroll); } But regardless where I scroll my ListView vertically, the value of getScrollY() always return 0. Can anyone please help me? Thank you.

    Read the article

  • Why am I getting null object reference error when saving (OnItemUpdating event) the first edit item

    - by craigmoliver
    I'm getting the error "Object reference not set to an instance of an object." when trying to reference a HiddenField (lvEditProjectSteps_hdnStepStatusId for future reference) from the EditItem during the OnItemUpdating event after the Update event fires in a ListView. This only occurs on the FIRST item in the ListView. I checked the source and the HTML is being rendered properly. ANY insight is appreciated! Thanks in advance... Source error: var lvEditProjectSteps_hdnStepStatusId = (HiddenField) lvEditProjectSteps.EditItem.FindControl("lvEditProjectSteps_hdnStepStatusId"); Here's the aspx side of the ListView: <asp:ListView ID="lvEditProjectSteps" runat="server" OnItemDataBound="lvEditProjectSteps_OnItemDataBound" OnItemUpdating="lvEditProjectSteps_OnItemUpdating" DataSourceID="odsEditProjectStep" DataKeyNames="Id"> <LayoutTemplate> <table class="standard-box-style" style="width:800px"> <thead> <tr> <th>&nbsp;</th> <th>&nbsp;</th> <th>Created</th> <th>Updated</th> </tr> </thead> <tbody> <asp:PlaceHolder ID="itemPlaceHolder" runat="server" /> </tbody> </table> </LayoutTemplate> <ItemTemplate> <tr> <td style="width:50px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>> <asp:ImageButton ID="lvEditProjectSteps_btnEdit" runat="server" ImageUrl="~/admin/images/icons/edit.gif" AlternateText="Edit" SkinID="interfaceButton" CommandName="Edit" /> <asp:HiddenField ID="lvEditProjectSteps_hdnId" runat="server" Value='<%# Bind("Id")%>' /> <asp:HiddenField ID="lvEditProjectSteps_hdnStepStatusId" runat="server" Value='<%# Bind("StepStatusId")%>' /> <asp:HiddenField ID="lvEditProjectSteps_hdnStepStatusStepId" runat="server" Value='<%# Bind("StepStatus_StepId")%>' /> </td> <td style="width:30px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>><asp:Image ID="imgStatus" runat="server" /></td> <td style="width:75px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>><asp:Literal ID="litTsCreated" runat="server" /></td> <td style="width:75px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>><asp:Literal ID="litTsUpdated" runat="server" /></td> </tr> </ItemTemplate> <EditItemTemplate> <tr> <td style="width:50px"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>> <asp:ImageButton ID="lvEditProjectSteps_btnUpdate" runat="server" ImageUrl="~/admin/images/icons/save.png" AlternateText="Save" SkinID="interfaceButton" CommandName="Update" ValidationGroup="EditProjectStepsSave" /> <asp:ImageButton ID="lvEditProjectSteps_btnCancel" runat="server" ImageUrl="~/admin/images/icons/cancel.png" AlternateText="Cancel" SkinID="interfaceButton" CommandName="Cancel" /> <asp:HiddenField ID="lvEditProjectSteps_hdnId" runat="server" Value='<%# Bind("Id")%>' /> <asp:HiddenField ID="lvEditProjectSteps_hdnStepStatusId" runat="server" Value='<%# Bind("StepStatusId")%>' /> <asp:HiddenField ID="lvEditProjectSteps_hdnStepStatusStepId" runat="server" Value='<%# Bind("StepStatus_StepId")%>' /> </td> <td style="width:180px" colspan="3"<%# (Container.DisplayIndex % 2 == 0)?"":" class=\"row-alternating\"" %>> <div><strong>Status</strong></div> <div class="radiobuttonlist-status"> <asp:RadioButtonList ID="lvEditProjectSteps_rblStatus" runat="server" RepeatDirection="Horizontal" AutoPostBack="true" OnSelectedIndexChanged="lvEditProjectSteps_rblStatus_OnSelectedIndexChanged"> <asp:ListItem Value="1"><img src="/images/icon/project-status/1.png" alt="Error" /></asp:ListItem> <asp:ListItem Value="2"><img src="/images/icon/project-status/2.png" alt="In Progress" /></asp:ListItem> <asp:ListItem Value="3"><img src="/images/icon/project-status/3.png" alt="Complete" /></asp:ListItem> </asp:RadioButtonList> <asp:RequiredFieldValidator ID="valRequired_lvEditProjectSteps_rblStatus" runat="server" ControlToValidate="lvEditProjectSteps_rblStatus" SetFocusOnError="true" Display="Dynamic" ErrorMessage="<br />^ required ^" ValidationGroup="EditProjectStepsSave" /> </div> </td> </tr> </EditItemTemplate> </asp:ListView> And the code-behind: protected void lvEditProjectSteps_OnItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { var info = (ProjectStepInfo)DataBinder.GetDataItem(e.Item); // View Item var litTsCreated = (Literal)e.Item.FindControl("litTsCreated"); var litTsUpdated = (Literal)e.Item.FindControl("litTsUpdated"); var imgStatus = (Image) e.Item.FindControl("imgStatus"); if (litTsCreated != null) litTsCreated.Text = String.Format("{0:d}", info.TsCreated); if (litTsUpdated != null) litTsUpdated.Text = String.Format("{0:d}", info.TsCreated); if (imgStatus != null) imgStatus.ImageUrl = String.Format("/images/icon/project-status/{0}.png", info.StepStatus_StatusId); // Edit Item var lvEditProjectSteps_rblStatus = (RadioButtonList) e.Item.FindControl("lvEditProjectSteps_rblStatus"); if (lvEditProjectSteps_rblStatus != null) lvEditProjectSteps_rblStatus.SelectedValue = info.StepStatus_StatusId.ToString(); } } protected void lvEditProjectSteps_OnItemUpdating(object sender, ListViewUpdateEventArgs e) { if (IsValid) { var oController = new Controller(); var lvEditProjectSteps_hdnStepStatusId = (HiddenField) lvEditProjectSteps.EditItem.FindControl("lvEditProjectSteps_hdnStepStatusId"); var lvEditProjectSteps_hdnStepStatusStepId = (HiddenField) lvEditProjectSteps.EditItem.FindControl("lvEditProjectSteps_hdnStepStatusStepId"); var lvEditProjectSteps_rblStatus = (RadioButtonList) lvEditProjectSteps.EditItem.FindControl("lvEditProjectSteps_rblStatus"); var infoStepStatus = oController.StepStatus_SelectOne_StepId_StatusId(Convert.ToInt32(lvEditProjectSteps_hdnStepStatusStepId.Value), Convert.ToInt32(lvEditProjectSteps_rblStatus.SelectedValue)); if (lvEditProjectSteps_hdnStepStatusId != null) { e.NewValues["ProjectId"] = Convert.ToInt32(lvEditProjectSteps_hdnProjectId.Value); e.NewValues["StepStatusId"] = infoStepStatus.Id; } else { Response.Write("cancel"); e.Cancel = true; } } else { Response.Write("cancel, not valid"); e.Cancel = true; } } protected void lvEditProjectSteps_rblStatus_OnSelectedIndexChanged(object sender, EventArgs e) { var oController = new Controller(); var rbl = (RadioButtonList)sender; var lvEditProjectSteps_txtText = (TextBox) rbl.NamingContainer.FindControl("lvEditProjectSteps_txtText"); var lvEditProjectSteps_txtComment = (TextBox)rbl.NamingContainer.FindControl("lvEditProjectSteps_txtComment"); var lvEditProjectSteps_hdnStepStatusStepId = (HiddenField) rbl.NamingContainer.FindControl("lvEditProjectSteps_hdnStepStatusStepId"); if (!String.IsNullOrEmpty(lvEditProjectSteps_hdnStepStatusStepId.Value) && lvEditProjectSteps_txtText != null && lvEditProjectSteps_txtComment != null) { var infoStep = oController.Step_SelectOne(Convert.ToInt32(lvEditProjectSteps_hdnStepStatusStepId.Value)); var infoStepStatus = oController.StepStatus_SelectOne_StepId_StatusId(Convert.ToInt32(lvEditProjectSteps_hdnStepStatusStepId.Value), Convert.ToInt32(rbl.SelectedValue)); lvEditProjectSteps_txtText.Text = infoStep.Name; lvEditProjectSteps_txtComment.Text = infoStepStatus.Text; } }

    Read the article

  • Select in listview, to pass the index through to another form

    - by Luke
    I have a system where a listview is populated. I want to be able to select one of these files and press an edit button, which will then take the selected data into another form. I am trying to find a way to identify the selected item in the listview and take it to the next form. How can i achieve this? What code would I need to show? Thanks

    Read the article

  • android ListView question

    - by michael
    Hi, I have a ListView in my android application. If I flick up/down the ListView, which method will return my 'selected' element in my list View? How about if I use the track ball to navigate up/down my list view, which method will return the index of my selected element? Thank you.

    Read the article

  • Set PageIndex of DataPager

    - by Barbosa
    I have a ListView that I am paging with a DataPager. I would like to set the initial page of the pager on Page_Load. I have tried the DataPager.SetPageProperties method but it's not doing what I need. Here's how I'm calling this method: dataPager.SetPageProperties(3, dataPager.TotalRowCount, false); The line above trims the datasource to start at the third item and paging still starts at 1. This is not what I want. I want to keep the entire list of items and just jump to a specific page in the list. Is there another Property and/or method of a DataPager and/or ListView that I should use? Any help will be greatly appreciated. Thanks!

    Read the article

  • Android -- autoLink

    - by Ryan
    Is there any way to Linkify a specific TextView that is contained within a ListView? I tried using android:autoLink="all" but that didn't work. I was getting an out of context error. Important also to note: the ListView is my second view in the ViewFlipper. I have also tried: View mItemView = mAdapter.getView(2, null, null); TextView infoText = (TextView) mItemView.findViewById(R.id.rowText2); Linkify.addLinks(infoText, Linkify.ALL); Right after the adapter was bound to the ListView and the View was switched. No luck. Here is the stack trace: 06-03 21:19:25.180: ERROR/AndroidRuntime(1214): Uncaught handler: thread main exiting due to uncaught exception 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.app.ApplicationContext.startActivity(ApplicationContext.java:550) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.content.ContextWrapper.startActivity(ContextWrapper.java:248) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.text.style.URLSpan.onClick(URLSpan.java:62) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.text.method.LinkMovementMethod.onTouchEvent(LinkMovementMethod.java:216) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.widget.TextView.onTouchEvent(TextView.java:6560) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.View.dispatchTouchEvent(View.java:3709) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.app.Activity.dispatchTouchEvent(Activity.java:2061) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.os.Handler.dispatchMessage(Handler.java:99) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.os.Looper.loop(Looper.java:123) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at android.app.ActivityThread.main(ActivityThread.java:4363) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at java.lang.reflect.Method.invokeNative(Native Method) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at java.lang.reflect.Method.invoke(Method.java:521) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 06-03 21:19:25.219: ERROR/AndroidRuntime(1214): at dalvik.system.NativeStart.main(Native Method) Any Ideas? Thanks in advance!!!

    Read the article

  • Assign binding path at runtime in WPF DataTemplate

    - by Abiel
    I am writing a WPF program in C# in which I have a ListView for which the columns will be populated at runtime. I would like to use a custom DataTemplate for the GridViewColumn objects in the ListView. In the examples I have seen where the number of columns is fixed in advance, a custom DataTemplate is often created using something like the XAML below. <DataTemplate x:Key="someKey"> <TextBlock Text="{Binding Path=FirstName}" /> </DataTemplate> This DataTemplate could also later be assigned to GridViewColumn.CellTemplate in the code-behind by calling FindResource("someKey"). However, this alone is of no use to me, because in this example the Path element is fixed to FirstName. Really I need something where I can set the Path in code. It is my impression that something along these lines may be possible if XamlReader is used, but I'm not sure how in practice I would do this. Any solutions are greatly appreciated.

    Read the article

  • WPF Show Open TabItem Names in a List View

    - by mr justinator
    I'm trying to display a list of open tab names in a listview or listbox (recommendations?). Been going through the different type of binding options and I'm able to bind to a single tab name but it displays vertical instead of horizontal. Here is my XAML: <ListView DockPanel.Dock="Left" Height="352" Name="listView1" Width="132" ItemsSource="{Binding ElementName=RulesTab, Path=Name}" IsSynchronizedWithCurrentItem="True" FlowDirection="LeftToRight" HorizontalAlignment="Left" HorizontalContentAlignment="Left" DataContext="{Binding}"> Any pointers would be greatly appreciated as I'd like to be able to see a list of all the tabs open and then double click on one to bring the tab into focus. Many thanks!

    Read the article

  • Can I Number a GroupTemplate or ItemTemplate?

    - by Atomiton
    I would like to use a GroupTemplate to separate a list of items into groups. However, I need each Group to be numbered sequentially so I can link to them and implement some JS paging. I'm binding to an IEnumerable Here's some pseudo code. I would like the output to look like this: <a href="#group1">Go to Group 1<a> <a href="#group2">Go to Group 2<a> <a href="#group3">Go to Group 3<a> <ul id="group1"> <li>Item</li> <li>Item</li> <li>Item</li> </ul> <ul id="group2"> <li>Item</li> <li>Item</li> <li>Item</li> </ul> <ul id="group3"> <li>Item</li> <li>Item</li> <li>Item</li> </ul> Is this easy to do in a ListView, using GroupTemplate and ItemTemplate? <asp:ListView ID="lv" runat="server" GroupPlaceholderID="groupPlaceholder"> <LayoutTemplate> <asp:PlaceHolder ID="groupPlaceholder" runat="server"></asp:PlaceHolder> </LayoutTemplate> <GroupTemplate> <ul id="<!-- group-n goes here -->"> <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder> </ul> </GroupTemplate> <ItemTemplate> <li>Item</li> </ItemTemplate> </asp:ListView> I can get the number of groups to do the links at the top from the Datasource and basic math, but how do I get id="groupN" number into the template?

    Read the article

  • click feature in Qt

    - by Solitaire
    Hi, I just want to clarify, weather the feature is present or not in Qt. The scenario is like this, I have a list view with items, I want to place the icon to the listview when the item is selected. The selection I mean is, first time when I click item should be selected, next time if I click the same item then it should be selected. Please note It is not the double click. So is there any feature which handles this feature by default, any property or flag which I need to set to listview to behave like this or manual implementation Is required for this.

    Read the article

  • How to use two templates for ListViewItem using WPF

    - by Gregor
    Hi, I would like to have a ListView that would have have items similar to Microsoft Outlook inbox with items arranged by Conversations (see the attached photo). An item can either be a simple textblock containing the topic of the conversation (on the photo this are the blue lines) or it can contain email information specified by the ListView's header. It would be best if the items with conversation topics would be push buttons so that emails inside that conversation could be shown or hidden by pressing this button. Any ideas how can I achieve this? Do I specify two ListViewItem templates? If yes, how do I tell in the code which template to use for each item? Any help will be GREATLY appreciated!! Regards, Gregor

    Read the article

  • Best way to handle multiple getView calls from inside an Adapter

    - by Samuh
    I have a ListView with custom ArrayAdapter. Each of the row in this ListView has an icon and some text. These icons are downloaded in background,cached and then using a callback, substituted in their respective ImageViews. The logic to get a thumbnail from cache or download is triggered every time getView() runs. Now, according to Romain Guy: "there is absolutely no guarantee on the order in which getView() will be called nor how many times." I have seen this happen, for a row of size two getView() was being called six times! How do I change my code to avoid duplicate thumbnail-fetch-requests and also handle view recycling? Thanks.

    Read the article

  • How to traverse the item in the collection in a List or Observable collection?

    - by Ashish Ashu
    I have a collection that is binded to my Listview. I have provided options to user to "move up" "move down" the selected item in the list view. I have binded the selected item of the listview to my viewmodel, hence I get the item in the collection on which user want to do the operation. I have attached "move up" "move down" commands in my viewmodel. I want what is the best way to move up and down in the collection in the collection which is reflected in the list view. Please suggest.

    Read the article

  • C# - Hiding ListViewItem based on a filter

    - by fonix232
    I want to hide some items based on a text filter in a ListView. Basically the listview loads the items from a text file, and I don't want it to be read and/or written when the user searches the list. The search is done in a combobox's KeyDown event, but there is no "Visible" property of the ListViewItem. Is there any easy way to do this, WITHOUT re-reading the file? (as it is an XML file, and it could even contain thousands of items, it would be hard to search efficiently and even let the user use the application, as the search would take for minutes (mostly with the loading)).

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >