[BUG] Can't select first element of the listview control due to bug of datacontrol class

Last post 08-08-2006 5:49 PM by Luis Abreu. 10 replies.

Sort Posts:

  • [BUG] Can't select first element of the listview control due to bug of datacontrol class

    04-17-2006, 2:19 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello guys.

    i've found a bug on the way the dataIndex is initialized in the datacontrol javascript class. by default, it's set to 0 and , in my opinion, it should be set to -1. due to this, if i build a simple listview and set the selecteditemcssclass, i won't be able to see the selected item on the list because set_dataIndex method won't update the selected item since it starts by comparing the value passed to the function with the current selected value which, by default is set to -1.

    so, i'd suggest that the initial value of the dataIndex should be set to -1.

    thanks.

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-05-2006, 10:49 AM
    • Member
      205 point Member
    • aldwis
    • Member since 07-11-2006, 2:16 PM
    • Posts 53
    Hey guys!
    I've got the same problem when using July CTP,
    I've tried serveral ways to set the default value of listView's dataIndex property,
    the property were set succeed but the control not render correctly with selectedItemCssClass.
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-05-2006, 11:42 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello.

    yep. the bug is still there. btw, how are you selecting the element? doesn't it event work when you click on a row (that should automatically select the element)?

     

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-06-2006, 8:10 AM
    • Member
      205 point Member
    • aldwis
    • Member since 07-11-2006, 2:16 PM
    • Posts 53
    Hi Luis, hi all,

    I've got these two problems:
    The first one is the selected row won't render properly when the ListView loaded data and first time render them.

    If I code like this:
    1    <application>
    2 <load>
    3 <setProperty target="listView1" property="dataIndex" value="1" />
    4 </load>
    5 </application>
    or:
    1    <dataSource id="dataSource" serviceURL="AnyDataService.asmx" autoLoad="true">
    2 <dataAvailable>
    3 <setProperty target="listView1" property="dataIndex" value="1" />
    4 </dataAvailable>
    5 </dataSource>
    then the property was set properly, but the users can't see the selected row with the selectedItemCssClass styled.

    When the ListView is rendered, users can't select the second row becouse it's is already selected, but they can't firstly select other rows and then select the second row, and it will rendered correctly. So it seems have some problem.

    And if I code like this:
    1    <listView id="listView1" itemTemplateParentElementId="AnyElement" selectedItemCssClass="Selected">
    2 ...
    3 </listView>
    it shouldn't work at all.

    The second qustion is, I need the value of dataIndex available to set to "-1" too,
    for example, I need mutiple ListViews to control one ItemView, only the last row being selected in all lists will rendered with the selectedItemCssClass style, all other ListViews' dataIndex property set to "-1".
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-06-2006, 8:17 AM
    • Member
      205 point Member
    • aldwis
    • Member since 07-11-2006, 2:16 PM
    • Posts 53
    I see I can't edit my post, so I correct the third part of code here:
    1    <listView id="listView1"  dataIndex="3" itemTemplateParentElementId="AnyElement" selectedItemCssClass="Selected">
    2 ...
    3 </listView>
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-06-2006, 8:22 AM
    • Member
      205 point Member
    • aldwis
    • Member since 07-11-2006, 2:16 PM
    • Posts 53
    ooop, sorry, another error in my post Stick out tongue:

    When the ListView is rendered, users can't select the second row becouse it's is already selected, but they can firstly select other rows and then select the second row, and it will rendered correctly. So it seems have some problem.
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-06-2006, 1:35 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello.

    well, that's the problem i've been talking about...btw, i think that you can change this by modifying one or two lines on the atlas files (though this is far from good since you'll have to change it again when a new version is released).

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-07-2006, 10:37 AM
    • Member
      205 point Member
    • aldwis
    • Member since 07-11-2006, 2:16 PM
    • Posts 53
    Thanks!

    Yep, I think maybe I'd better use UpdatePanel with Server Controls currently...
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-08-2006, 1:06 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hell no :D

    what do you really need? to select an item dinamically and make the list render it correctly? i'm currently on vacations, but if you tell me what you0re after, then i may take a look at it when i return...

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-08-2006, 3:43 PM
    • Member
      205 point Member
    • aldwis
    • Member since 07-11-2006, 2:16 PM
    • Posts 53
    Thanks Luis!

    What I need is my second question, to control one ItemView with mutiple ListViews, so I need available to set thier dataIndex to "-1", hmmm... I think it's similar to your question~:"P

    BTW, have a nice vacation!
  • Re: [BUG] Can't select first element of the listview control due to bug of datacontrol class

    08-08-2006, 5:49 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello.

    well, i'll try to find a simple workaround (no promises though...).

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
Page 1 of 1 (11 items)