Galleries - default to first item in list

I am working on a trade show app using Siena. I have a number of product galleries that load from excel, but I am having trouble getting the galleries to default to the first item in a selected list. Instead, if I select a new gallery, it starts on the last
position viewed by another gallery instead of starting clean on first item.
I thought it has something to do with DefaultVisibleIndex, but I have had no success. Any help would be greatly appreciated.
Rojon123

Hi Rojon,
In your dropdown list control, set Behavior>OnChange property to: UpdateContext({index:5});UpdateContext({index:1}). You're setting a context variable named index to 5 and then 1--basically cause its value to change every time the selection in the control
changes.
Now, set the DefaultVisibleIndex property of your gallery to: index
Thanks
Robin

Similar Messages

  • Defaulting a dropdown to the first item in the list

    I have two dropdowns in InfoPath 2010. The second dropdown gets populated depending on what the first dropdown is set to.
    Example: If the first is set to Florida, the second will display all the cities in Florida. If you set the first to Georgia, the second will change to a list of cities in Georgia.
    The problem is that it defaults to a blank line, I need the first item in the second dropdown to populate with the first item in the list.
    I've scoured the web but I can't seem to find a solution.
    Any solutions or workarounds?

    Hi,
    To achieve your requirement,  creating cascading dropdown fields with InfoPath.
    Please refer to the following blogs about creating cascade drop down in InfoPath form step by step:
    http://blogs.msdn.com/b/bharatgupta/archive/2013/03/07/create-cascading-dropdown-in-browser-enabled-infopath-form-using-infopath-2010.aspx
    For the issue that second dropdown defaults to a blank line, add a formatting rule to the first dropdown. Refer to the following articles:
    http://www.pointbeyond.com/2011/11/20/cascading-dropdowns-in-infopath-2010/
    http://msreddysharepoint.blogspot.in/2012/12/infopath-2013-web-browser-creating.html
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • Set Default Value of Multi-select list item

    I have a multi-select list item I want to default the value of to '%' (which is really '%null%') and have it selected. I tried setting default value of item, but it doesn't take '%null%'. I also tried a computation with a static of
    :P507_ITEM := '%null%'; How do you get the default value set and selected?

    Hi
    Shijesh is right, you need to change your null return value and use that return value as your default. Try and use something of the same datatype as your real return values if you plan to use '%' to display all as it will make your queries simpler. eg.
    Company A returns 1
    Company B return 2
    % returns 0
    Then your query would be...
    SELECT ...
    FROM ...
    WHERE company_id = DECODE(:P_COMPANY,1,1,2,2,0,company_id)
    Hope this makes sense.
    Cheers
    Ben

  • Powershell Iterate through webs and lists to get Document ID Value of first item

    After some some trial and error I came up with the follow script. But it's so slow! And seems to be missing my document centre - it has about 80000 items in it.
    Two questions: Can I make this quicker? and why can't it handle getting results from the document centre?
    $webs = (Get-SPSite "http://portal...." | Get-SPWeb -Limit all -ErrorAction SilentlyContinue)
    if($webs.count -ge 1 -OR $webs.count -eq $null)
    foreach($web in $webs)
    $lists = $web.Lists
    foreach($list in $lists)
    if ($list.BaseType -eq "DocumentLibrary" -OR $list.BaseType -eq "GenericList")
    $item = $list.Items[0]
    if (($item -ne $null) -and ($item["Document ID Value"] -ne $null))
    $finalstring = $item["Document ID Value"].ToString()
    write-output $finalstring | Out-File "C:\scripts\results.txt" -append
    $web.Dispose()

    I thought that pointing to items[0] would literally just grab the first item.
    So what do I do here? How can I use an spquery in my code? I'm confused in the order and the exact sytax I would use the spquery.
    Thanks for you help so far Alex.
    Edit: Amended my code, is this correct?
    Add-PSSnapin Microsoft.Sharepoint.PowerShell
    $webcount = 0
    $listcount = 0
    $itemcount = 0
    $itemid = ""
    $TimeStamp = Get-Date
    $Date = $TimeStamp.ToShortDateString()
    $Time = $TimeStamp.ToShortTimeString()
    $webs = (Get-SPSite "Http://portal..." | Get-SPWeb -Limit all -ErrorAction SilentlyContinue)
    $query = New-Object Microsoft.Sharepoint.SPQuery
    $query.Query = "<Where><IsNotNull><FieldRef Name='ID'/></IsNotNull></Where>,<OrderBy><FieldRef Name='_dlc_DocId' Ascending='True'/></OrderBy>"
    $query.ViewFields = "<FieldRef Name='_dlc_DocId'/>"
    if($webs.count -ge 1 -OR $webs.count -eq $null)
    foreach($web in $webs)
    $lists = $web.Lists
    foreach($list in $lists)
    if ($list.BaseType -eq "DocumentLibrary" -OR $list.BaseType -eq "GenericList")
    $listcount += 1
    $items = $list.GetItems($query)
    foreach ($item in $items)
    if ($item["_dlc_DocId"] -ne $null)
    $itemid = $item["_dlc_DocId"].ToString()
    if ($itemid -ne "")
    $itemcount += 1
    $finalstring = $Date + " ; " + $Time + " ; " + $web.url + " ; " + $list.title + " ; " + $itemid
    write-output $finalstring | Out-File "C:\scripts\results.txt" -append
    break
    $webcount += 1
    $web.Dispose()
    Write-Host "Amount of Webs checked:"$webcount
    Write-Host "Amount of Document Library Lists:"$listcount
    Write-Host "Amount of valid IDs:"$itemcount

  • Hide "more" button in a list view, only works for first item in the list

    I have the following code in a list view that outputs several dozen items in a web app.  The code only works for the first item, how can I make it loop through and execute the test for each item in the list view?  The {tag_hide more button} is a checkmark field that yields a numeric 1" if checked otherwise yields a numeric "0".
    <div id="more-option">
            <p class="right"><a href="{tag_itemurl_nolink}" class="btn btn-small btn-very-subtle">More &rarr;</a></p>
          </div>
          <div class="more-selection" style="display: none;">{tag_hide more button}</div>
          <script>
    if ($(".more-selection").text() == "1") {
        $("#more-option").hide();
    </script>

    What's the URL for the site where you are using this?  Offhand, it looks like it should work with your first example so you are either placing the script before those elements are loaded or you might try wrapping your current javascript inside the:
    $(document).ready(function() {
    --- your existing javascript here
    This make sure the code runs once all the html is loaded on the page.  Without seeing a URL and debugging with the js console in Chrome I can't give you a solid answer.
    But, I do know that you can probably do this with a lot less markup.  Once we figure out what the actual problem is I have a better solution mocked up for you on jsfiddle.
    When looking at my HTML code on jsfiddle, please realize I setup some dummy HTML and removed your tags and added actual values which would be output by your tags.  The main thing I did was remove the whole div.more-selection and instead, added a "data-is-selected" attribute on your div.more-option element.  Then, in my javascript for each div.my-option element on the page, we loop through them, find the value of that data attribute and hide that div if it's less than 1 (or 0).
    Here's the fiddle for you to look at:  http://jsfiddle.net/thetrickster/Mfmdu/
    You'll see in the end result that only two divs show up, both of those divs have data-is-selected="1".
    You can try pasting the javascript code near the closing </body> tag on your page and make sure to wrap my js inside a <script> tag, obviously.  My way is neater on the markup side.  If you can't get it to work it's likely a jquery conflict issue.  My version is using the $(document).ready() method to make sure all the code is loaded before it runs.
    Best,
    Chris

  • Is it possible to show first item in a Drop down list

    Is it possible to automatically display the first item in a drop down list ?
    The reason I ask is  ... I am generating pre-filled PDF forms using XML data files.
    Whenever there is a certain type of data I am populating a drop down list for the user to review.
    Currently, the user must click on the drop down to see if data is there regardless of whether there is no data at all or many data lines of data..
    I would like to make it clear to the user whether or not there is any data - right awa.y
    I have considered creating a display item next (like a check box or a text field ) next to the drop down and setting it to cindicate if there is data, etc -
    but i thougth that I would ask if the drop down could simply be set to automatically display the first item in the list (this is the preferred functionality)
    If this is not possible I can always create a check box and set it if there is any data as an  indicator for the user ..
    Thanks

    You can do this way..
    Place the code in Inititalize event with Java Script
    if(DropDownList1.rawValue == null)
        DropDownList1.selectedIndex = 0;
    You need to check if the Dropdown has a value selected from the previous save.. If not then set the selected item to 0th index. (which is 1st one in the dropdown values)..
    Thanks
    Srini

  • First item in dd list indented in IE

    Hello
    On a few pages of a redesign I am doing I have a few
    <dd><li> - In FireFox its fine but in IE it is
    indenting the first item in the list.
    Any suggestions on how to fix? I looked in all my CSS and Im
    not seeing anything.. ( should I look harder?)
    Here is a page of a good example
    http://www.michaelsondesign.com/roomNine/html/aboutUs/parent_involvement.htm
    thanks
    R

    On Tue, 18 Sep 2007 18:41:03 +0000 (UTC), "NeilPeartRocks"
    <[email protected]> wrote:
    >Hello
    > On a few pages of a redesign I am doing I have a few
    <dd>
    - In FireFox its
    >fine but in IE it is indenting the first item in the
    list.
    > Any suggestions on how to fix? I looked in all my CSS
    and Im not seeing
    >anything.. ( should I look harder?)
    > Here is a page of a good example
    >
    >
    http://www.michaelsondesign.com/roomNine/html/aboutUs/parent_involvement.htm
    >
    > thanks
    > R
    >
    Definition lists - at least as I read it don''t just have
    <dd>'s as
    you have:
    Definition lists have a <dt> to define the definition
    term and then
    the <dd) to describe the definttion description. so it
    would look like
    <dl>
    <dt>the term</dt
    <dd>definition description</dd>
    <dt>the term</dt
    <dd>definition description</dd>
    <dt>the term</dt
    <dd>definition description</dd>
    </dl>
    but to change the indent - you can change the margin with
    css:
    dd {margin-left: 5px; margin-top:5px; margin-bottom:18px; }
    ~Malcolm N....
    ~

  • How can i show the first item in the list as selected item

    Aslam o Alikum (Hi)
    Dear All
    How can i show the first item in the list as selected item when user click on the list. Right now when user click the list the list shows the last item in the list as selected or highlighted. Furthermore if the list item have large no of value and a scroll bar along with it then the list scroll to last item when user click it with mouse. I want that when user click the list item with mouse list should show the first item as highlighted.
    Take Care
    Allah Hafiz

    Hi!
    You can set list "initial value" using When-Create-Record trigger.
    I.g.
    :<Block_name>.<list_item_name> := Get_List_Element_Value('<Block_name>.<list_item_name>', 1);

  • Windows Phone 8.1 xaml, c# ComboBox does not display selection when first item is selected from full page list.

    I have 3 comboboxes on a xaml page and most of the time when I select the first item on the full page list displayed when the number of items are > 5, the screen returns to the combobox and the box is blank. The combobox.SelectedItem is valued but it
    does not display.  This does not happen every time and I have seen this using the emulator and my windows 8.1 phone.  If I select any other item in the list they always display but when I go back and select the first item the box is blank. 
    Does anyone know what I could be doing that is causing this?

    Thanks for your help.  When I run the code below and the page is displayed, I select an item from the page list and it displays fine and then I select the first item from the page list and I do not see that selected item in the box. 
    If I remove the SelectedIndex=0 it all works fine except I do not have an item selected for the initial display.  Below should show problem and should work copy/paste in universal blank app.
    ScrollViewer x:Name="scrollViewer1">
            <StackPanel x:Name="stackPanel1" Background="Transparent">
                <ComboBox x:Name="comboBoxTestTypes" Margin="20,117.75,0,465.25" SelectedValuePath="ItemDescription" Width="310" Height="Auto" FontSize="17"
           ItemsSource="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Center">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding ItemDescription}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
     </StackPanel>
        </ScrollViewer>
    public sealed partial class MainPage : Page
            public ObservableCollection<ItemDetail> itemDetail;
            public MainPage()
                this.InitializeComponent();
                this.NavigationCacheMode = NavigationCacheMode.Required;
                this.itemDetail = new ObservableCollection<ItemDetail>();
            protected override void OnNavigatedTo(NavigationEventArgs e)
                PageLoad();
            public class ItemDetail
                public string ItemDescription { get; set; }
                public string ItemName { get; set; }
            private async void PageLoad()
                await initializeTypes();
                var comboBoxTestTypesItemsSource = await GetTestTypes();
                comboBoxTestTypes.ItemsSource = comboBoxTestTypesItemsSource;
                comboBoxTestTypes.SelectedIndex = 0;
            private async Task initializeTypes()
                await addTestType("Item1");
                await addTestType("Item2");
                await addTestType("Item3");
                await addTestType("Item4");
                await addTestType("Item5");
                await addTestType("Item6");
            private async Task<ObservableCollection<ItemDetail>> GetTestTypes()
                //ObservableCollection<ItemDetail> list = new ObservableCollection<ItemDetail>();
                //Random rnd = new Random();
                //for (int i = 0; i < 50; i++)
                //    list.Add(new ItemDetail() { ItemDescription = "hello" + rnd.Next(0, 1001), ItemName = rnd.Next(0, 101).ToString() });
                await getSaveDataFileDataAsync("get");
                return itemDetail;
            private async Task addTestType(string description)
                int newIdAdd = 0;
                if (itemDetail != null && itemDetail.Count > 0)
                    newIdAdd = itemDetail.Max(mT => Convert.ToInt32(mT.ItemName)) + 1;
                var addTestType = new ItemDetail();
                addTestType.ItemName = newIdAdd.ToString();
                addTestType.ItemDescription = description;
                itemDetail.Add(addTestType);
                await getSaveDataFileDataAsync("save");
            private async Task getSaveDataFileDataAsync(string getSave)
                try
                    DataContractJsonSerializer jsonSerializer1 = null;
                    string dataFileName1 = "testFileName";
                    jsonSerializer1 = new DataContractJsonSerializer(typeof(ObservableCollection<ItemDetail>));
                    if (jsonSerializer1 != null && getSave == "get")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForReadAsync(dataFileName1))
                            itemDetail = (ObservableCollection<ItemDetail>)jsonSerializer1.ReadObject(stream1);
                    if (jsonSerializer1 != null && getSave == "save")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(dataFileName1, CreationCollisionOption.ReplaceExisting))
                                jsonSerializer1.WriteObject(stream1, itemDetail);
                catch

  • Drop down language list in Google translate only shows first item, HTML drop downs work OK and google translate works OK in SAMSUNG browser

    I have Firefox 18.0.2 for android running on a Samsung Galaxy Tab 2 7.0. The drop down list in Google translate (for translating complete web pages e.g. http://www.samtorrance.com/google-translate.htm ) only shows the first item (select language). Google translate works on Samsung's own browser, HTML drop down lists work OK in Firefox and Google translate on the same webpage works on desktop machine.

    Could you provide the snapshot.
    if your using ICS or JB
    press Menu + power button (or) <br>
    Volume down key + power button

  • Af:inputListOfValues sets value of first item in result set when using enter key or tab and component set to autosubmit=true

    I'm using JDev 11.1.1.6 and when I type a value into an af:inputListOfValues component and hit either the enter key or the tab key it will replace the value I entered with the first item in the LOV result set. If enter a value and just click out of the af:inputListOfValues component it works correctly. If I use the popup and search for a value it works correctly as well. I have a programmatic view object which contains a single transient attribute (this is the view object which is used to create the list of value component from) and then I have another entity based view object which defines one of its attributes as a list of value attribute. I tried using an entity based view object to create the LOV from and everything works as expected so I'm not sure if this is a bug when using programmatic view objects or if I need more code in the VOImpl. Also, it seems that after the first time of the value being replaced by the first value in the result set that it will work correctly as well. Below are some of the important code snippets.
    Also, it looks like it only doesn't work if the text entered in the af:inputListOfValues component would only have a single match returned in the result set. For instance given the result set in the code: Brad, Adam, Aaron, Fred, Charles, Charlie, Jimmy
    If we enter Cha, the component works as expected
    If we enter A, the component works as expected
    If we enter Jimmy, the component does not work as expected and returns the first value of the result set ie. Brad
    If we enter Fred, the component does not work as expected and returns the first value of the result set ie. Brad
    I also verified that I get the same behavior in JDev 11.1.1.7
    UsersVOImpl (Programmatic View Object with 1 transient attribute)
    import java.sql.ResultSet;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import oracle.adf.share.logging.ADFLogger;
    import oracle.jbo.JboException;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Wed Sep 18 15:59:44 CDT 2013
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class UsersVOImpl extends ViewObjectImpl {
        private static ADFLogger LOGGER = ADFLogger.createADFLogger(UsersVOImpl.class);
        private long hitCount = 0;
         * This is the default constructor (do not remove).
        public UsersVOImpl () {
         * executeQueryForCollection - overridden for custom java data source support.
        protected void executeQueryForCollection (Object qc, Object[] params, int noUserParams) {
             List<String> usersList = new ArrayList<String>();
             usersList.add("Brad");
             usersList.add("Adam");
             usersList.add("Aaron");
             usersList.add("Fred");
             usersList.add("Charles");
             usersList.add("Charlie");
             usersList.add("Jimmy");
             Iterator usersIterator = usersList.iterator();
             setUserDataForCollection(qc, usersIterator);
             hitCount = usersList.size();
             super.executeQueryForCollection(qc, params, noUserParams);
        } // end executeQueryForCollection
         * hasNextForCollection - overridden for custom java data source support.
        protected boolean hasNextForCollection (Object qc) {
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             if (usersListIterator.hasNext()) {
                 return true;
             } else {
                 setFetchCompleteForCollection(qc, true);
                 return false;
             } // end if
        } // end hasNextForCollection
         * createRowFromResultSet - overridden for custom java data source support.
        protected ViewRowImpl createRowFromResultSet (Object qc, ResultSet resultSet) {
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             String user = (String)usersListIterator.next();
             ViewRowImpl viewRowImpl = createNewRowForCollection(qc);
             try {
                 populateAttributeForRow(viewRowImpl, 0, user.toString());
             } catch (Exception e) {
                 LOGGER.severe("Error Initializing Data", e);
                 throw new JboException(e);
             } // end try/catch
             return viewRowImpl;
        } // end createRowFromResultSet
         * getQueryHitCount - overridden for custom java data source support.
        public long getQueryHitCount (ViewRowSetImpl viewRowSet) {
             return hitCount;
        } // end getQueryHitCount
        @Override
        protected void create () {
             getViewDef().setQuery(null);
             getViewDef().setSelectClause(null);
             setQuery(null);
        } // end create
        @Override
        protected void releaseUserDataForCollection (Object qc, Object rs) {
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             usersListIterator = null;
             super.releaseUserDataForCollection(qc, rs);
        } // end releaseUserDataForCollection
    } // end class
    <af:inputListOfValues id="userName" popupTitle="Search and Select: #{bindings.UserName.hints.label}" value="#{bindings.UserName.inputValue}"
                                                  label="#{bindings.UserName.hints.label}" model="#{bindings.UserName.listOfValuesModel}" required="#{bindings.UserName.hints.mandatory}"
                                                  columns="#{bindings.UserName.hints.displayWidth}" shortDesc="#{bindings.UserName.hints.tooltip}" autoSubmit="true"
                                                  searchDesc="#{bindings.UserName.hints.tooltip}"                                          
                                                  simple="true">
                              <f:validator binding="#{bindings.UserName.validator}"/>                      
    </af:inputListOfValues>

    I have found a solution to this issue. It seems that when using a programmatic view object which has a transient attribute as its primary key you need to override more methods in the ViewObjectImpl so that it knows how to locate the row related to the primary key when the view object records aren't in the cache. This is why it would work correctly sometimes but not all the time. Below are the additional methods you need to override. The logic you use in retrieveByKey would be on a view object by view object basis and would be different if you had a primary key which consisted of more than one attribute.
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i) {
        return retrieveByKey(viewRowSetImpl, null, key, i, false);
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, String string, Key key, int i, boolean b) {
        RowSetIterator usersRowSetIterator = this.createRowSet(null);
        Row[] userRows = usersRowSetIterator.getFilteredRows("UserId", key.getAttribute(this.getAttributeIndexOf("UserId")));
        usersRowSetIterator.closeRowSetIterator();
        return userRows;
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i, boolean b) {
        return retrieveByKey(viewRowSetImpl, null, key, i, b);

  • How to get first item of hashMap w/out knowing the key

    Hi
    can someone tell me if there is a way to get first item from a hashMap when you dont know what the key is. as the get method expects a defined 'key'
    reason I am asking this:
    I am using struts 2 UI <s:radio> tag. this tag takes a hashmap and creates radio maps. it has a 'value' attribute and if something is passed to this attribute then that radio button is checked by default. the list that contains radio buttons is created dynamically so i dont know what is actually in the hashMap key's. but i do know that key's are string.
    so just wondering if there is a way to get first item from a hashmap without knowing the key...

    thanks for the quick reply.
    posted in java forums because thought it was a java API/workaround question. gave a little history because i didnt want people to start questioning my use of HashMap for this purpose..
    anywhose..i've found a workaround.
    If someone has a similar problem:
    as the hashmap is being populated dynamically....set a String member of class to contain the first key thats being put in the hashmap. then have struts tag pick up that value.
    also, through your post and reading hashMap api...its usefull to know that hasMaps do not gurantee the order of elements in it. So now I am using a TreeMap.
    Thanks

  • Strange bug, items in list boxes disappearing

    First of all this is my first post here ever. If its a wrong forum, sorry.
    So ever since I installed Windows 8.1 here (fresh install), I have this strange bug were items in list boxes start disappearing when you open a window with them.
    It didn't bother me much but now its horrible when I wanted to switch my playback device... Or if you want to change IP settings on my network adapter.
    The thing is it all happens in a very short period of time so it took me a while to get screens of it and here they are:
    s9.postimg.org/dvqvulc5b/bug.gif
    s9.postimg.org/a0nhs0szj/bug2.gif
    I still can't upload images on this forum!
    That is real time of how it appears on my screen when I open those windows. You can see on the first image that the window is still appearing.
    I have searched for this problem but couldn't find anything.
    Lenovo Z510 Notebook

    try to use default Windows 8.1 theme
    try to check with different account
    try to check in safe mode
    try to find if there is any graphic driver update or any driver update, compare your version
    http://support.lenovo.com/en_HK/downloads/detail.page?DocID=DS037055
    try to update your windows
    monitor event viewer if there is any abnormal behavior
    try to check using PSR
    http://windows.microsoft.com/en-hk/windows7/how-do-i-use-problem-steps-recorder
    update your windows if there is any windows update

  • Default selected product in product list

    I have a list of products in a region from a dataset. I have
    a detailregion that shows the data from the selected item in that
    region.
    In the product list, I have the spry:select set to a CSS
    rule. When the region and detailregion are first displayed, the
    first item is selected and displayed by default. But, it's not
    using the spry:selected CSS rule until I actually make a selection.
    How can I make the default selected item initially show using
    the spry:selected rule?

    Ok, I'm using a spry:repeat to fill in table rows as a list
    of products. So, I used a spry:choose in the table, then in the
    <tr> tag used a spry:when ds_row == 0
    spry:selected="selected". Then a second <tr> with
    spry:default="default, without the selected part.

  • How scroll through a list of items in list box with code in C# winforms to create auto scrolling

    I am new to programming and I have been tasked to create a form to display information in list box controls on a big screen. The list boxes have to show all data by auto scrolling through all data row by row then start again at the top once it has displayed
    all data. Is there a way to do this automatically in code using a timer? I look all over the web and have not found any way to do this in win win forms. Is it possible?
    Thanks 

    Here's the c# code
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    namespace WindowsApplication13
    public partial class Form1 : Form
    System.Timers.Timer timer = new System.Timers.Timer();
    int position = 0;
    public delegate void delegateUpdateListbox();
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    timer.Interval = 1000;
    timer.Enabled = true;
    timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
    void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
    position += 1;
    if (position == listBox1.Items.Count)
    position = 0;
    delegateUpdateListbox deleg = new delegateUpdateListbox(updateListbox);
    this.Invoke(deleg);
    void updateListbox()
    listBox1.SelectedIndex = position;
    As long as the listbox's SelectionMode is set to "One" (the default), you don't have to do anything to un-select the previous item.
    For your secnd question, the code inside the timer checks whether the position is the same as the length of the contents of the listbox and resets its value to zero, so that the selection will go back to the first item in the list.

Maybe you are looking for

  • Photoshop error while extracting

    hi i have an issue with photoshop tried downloading tthe trial version three times wasting 960mb each time. i get an error msg ERROR EXTRACTING THE PRODUCT INSTALLER (ERROR 101) CHECK FOR AVAILIABLE DISK SPACE ON YOUR SYSTEM AND TRY DOWNLOADING AGAIN

  • XMLP-PROBLEM IN DISPLAYING TOTALS WHEN LINES HAVE MULTILINE DESCRIPTION.

    The Report Totals on documents does not appear at the bottom of the page when we have lines that have multi-line description. Actually we had restricted the length of each XML page to display 40 lines only. In case if we are not having details of 40

  • About generarte funds reservation

    Hi, expert    I want to use PSM-FM.   How to create funds reservation when create Purchase Requistion or Payment request? Thank for advanced. Best regard. Tony

  • Unable to locate my ipad on find my Iphone.

    I'm able to find my IPhone ,but not my IPad. I've spoken to Apple Support to resolve it, with no success. We've tried everything. I really don't want my son taking the IPad anywhere without being able to locate it if lost/stolen. The only difference

  • How to stop receiving from a mail account but still send from that account

    Hi I was wondering if anyone knew how set up a mail account that will send but not recieve. Basically, I would like it to stop going to the server and grabbing emails from this account, but I want to be able to send emails from this account. Is this