iPad Listbox - is there a way to show all items ?http://forums.asp.net/t/1739142.aspx/1?iPad+Listbox+is+there+a+way+to+show+all+items+Wed, 16 Nov 2011 21:03:35 -050017391424680435http://forums.asp.net/p/1739142/4680435.aspx/1?iPad+Listbox+is+there+a+way+to+show+all+items+iPad Listbox - is there a way to show all items ? <p>Is there any way to force an iPad Listbox to show all items in the Listbox ?</p> <p>&nbsp;</p> <p>Im currently using 7 Listboxes side-by-side to display letters for a word game.</p> <p>Eg. Listbox1 displays A, B, C, listbox2 displays D, E, F etc. The idea being that the user can detect a hidden word in what is effectively a grid of letters. They then select one letter from each listbox to form the word which then gets processed.&nbsp; Each listbox is sized to show all 3 items.</p> <p>&nbsp;</p> <p>It works fine on PC/Mac browsers, but on iPad we have this problem:<br> <br> </p> <ol> <li>The listbox initially shows no items at all &amp; then when a listbox is selected, the items get shown in a dropdownlist, then finally only the selected item gets shown in the listbox.<br> <br> </li></ol> <p>I need normal listbox functionally which initially <b><span style="text-decoration:underline">shows all letters</span></b> (say for a 7 letter word the user needs to see a 3x7 grid of letters, &amp; user needs to be able to <b><span style="text-decoration:underline">select one item</span></b> from each column/Listbox.</p> <p>&nbsp;</p> <p>I currently have this code for iPad to downside text for each listbox:</p> <p>&nbsp;</p> <p>Dim strUserAgent As String = Request.UserAgent.ToString().ToLower()</p> <p>If Request.Browser.IsMobileDevice Then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp; If InStr(strUserAgent, &quot;ipad&quot;) Then</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Listbox1.Style(&quot;font-size&quot;) = &quot;6px&quot;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Listbox2.Style(&quot;font-size&quot;) = &quot;6px etc. . .</p> <p>&nbsp;&nbsp; End If</p> <p>End If</p> <p>&nbsp;</p> <p>&amp; also this in .css file:</p> <p>-webkit-appearance: listitem;</p> <p>&nbsp;</p> <p>Is there any code in code-behind or .css to force the iPad listbox to display items as described ?</p> <p>Or alternatively, is there another type of control which would give this functionality on iPad ?</p> <p>&nbsp;</p> <p>Any feedback much appreciated.</p> 2011-11-13T02:29:04-05:004683842http://forums.asp.net/p/1739142/4683842.aspx/1?Re+iPad+Listbox+is+there+a+way+to+show+all+items+Re: iPad Listbox - is there a way to show all items ? <p>Hi,</p> <p>Apple iPhone/iPod Touch/iPad display ListBox as Select control.</p> <p>If you want ListBox kind of UI, you need to create one using DIV and UL tags!</p> <p>Hope it helps u...</p> 2011-11-15T10:46:47-05:004685444http://forums.asp.net/p/1739142/4685444.aspx/1?Re+iPad+Listbox+is+there+a+way+to+show+all+items+Re: iPad Listbox - is there a way to show all items ? <p>many thanks roopeshreddy,</p> <p>i've had a search of the internet for possible solutions as you suggest - not sure where/how to get started.</p> <p>Are you able to point to any existing resources to get me started ?</p> <p>regards</p> <p>surver1953</p> 2011-11-16T06:29:33-05:004686030http://forums.asp.net/p/1739142/4686030.aspx/1?Re+iPad+Listbox+is+there+a+way+to+show+all+items+Re: iPad Listbox - is there a way to show all items ? <p>Hi,</p> <p>You can check the following code!</p> <pre class="prettyprint">&lt;script type=&quot;text/javascript&quot;&gt; var nCount = 0; var prevListItem = null; var curSelectedItem = null; function Insert() { var newElement = document.createElement(&quot;li&quot;); newElement.innerHTML = &quot;Option &quot; &#43;nCount ; newElement.setAttribute(&quot;onclick&quot;, &quot;FetchValue(this);&quot;); document.getElementById('list').appendChild(newElement); nCount&#43;&#43;; } function Delete() { try { if (curSelectedItem != null &amp;&amp; nCount &gt; 0) { document.getElementById('list').removeChild(curSelectedItem); nCount--; } } catch (e) { } } function FetchValue(listItem) { listItem.style.background = &quot;#FF00FF&quot;; document.getElementById('selectedValue').innerHTML = listItem.innerHTML; if (prevListItem != null &amp;&amp; prevListItem != listItem) prevListItem.style.background = &quot;#FFFFFF&quot;; curSelectedItem = listItem; prevListItem = listItem; } &lt;/script&gt; &lt;div style=&quot;border:1px solid #00FF00;width:150px;height:200px;margin:0px;padding:0px;overflow:auto;&quot;&gt; &lt;ul id=&quot;list&quot; style=&quot;list-style:none none inside;margin:0px;padding:0px; cursor:pointer; &quot; &gt; &lt;/ul&gt; &lt;/div&gt; &lt;div&gt; &lt;input type=&quot;button&quot; value=&quot;Insert&quot; onclick=&quot;Insert();&quot; /&gt; &lt;input type=&quot;button&quot; value=&quot;Delete&quot; onclick=&quot;Delete();&quot; /&gt; &lt;/div&gt; &lt;div&gt; Selected Item: &lt;span id=&quot;selectedValue&quot;&gt;&lt;/span&gt; &lt;/div&gt;</pre> <p>The above code shows how to dynamically add data to the custom listbox and delete it. You can also do that by adding static data to it!</p> <p>Hope it helps u...</p> 2011-11-16T11:55:00-05:004686712http://forums.asp.net/p/1739142/4686712.aspx/1?Re+iPad+Listbox+is+there+a+way+to+show+all+items+Re: iPad Listbox - is there a way to show all items ? <p>Many thanks roopeshreddy - i'll give that a try.</p> <p>Very much appreciated.</p> <p>surver1953</p> 2011-11-16T21:03:35-05:00