[Mono-bugs] [Bug 552535] New: Listview InsertItemTemplate doesn't show with InsertItemPosition = InsertItemPosition.FirstItem;

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Nov 4 10:44:45 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=552535


           Summary: Listview InsertItemTemplate doesn't show with
                    InsertItemPosition = InsertItemPosition.FirstItem;
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86
               URL: http://www.507records.net
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: guinness57 at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:
Listview InsertItemTemplate doesn't show when executing 
myListView.InsertItemPosition = InsertItemPosition.FirstItem;

Steps to reproduce the problem:
1. create a listview with a link to show insertitemtemplate on click

<asp:LinkButton runat="server" ID="btnNew" OnClick="btnNew_Click" Text="Add
news"></asp:LinkButton>
            <asp:ListView ID="gridNews" runat="server"
DataSourceID="datasourceNews" DataKeyNames="id"
                OnItemEditing="gridNews_ItemEditing"
OnItemInserting="gridNews_ItemInserting"
                OnItemCanceling="gridNews_ItemCanceling"
OnItemInserted="gridNews_ItemInserted"
                ItemPlaceholderID="placeholder"
OnItemDataBound="gridNews_ItemDataBound">
                <LayoutTemplate>
                    <table width="100%">
                        <tr runat="server" id="placeholder">
                        </tr>
                    </table>
                </LayoutTemplate>
                <ItemSeparatorTemplate>
                    <tr>
                        <td align="center" style="text-align: center;">
                            ---------------------------------
                        </td>
                    </tr>
                </ItemSeparatorTemplate>
                <InsertItemTemplate>
                    <tr>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        titre :
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server"
ID="TBTitre" CssClass="underlined" Text='<%# Bind("titre") %>'></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        texte :
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server" ID="TBtext"
Columns="80" Rows="8" TextMode="MultiLine"
                                            Text='<%# Bind("texte")
%>'></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        image:
                                    </td>
                                    <td>
                                        <asp:DropDownList runat="server"
ID="dropdownlistImage">
                                            <asp:ListItem Value=""
Text=""></asp:ListItem>
                                            <asp:ListItem Value="507_newsjpg"
Text="site"></asp:ListItem>
                                            <asp:ListItem
Value="artiste_news.jpg" Text="artiste"></asp:ListItem>
                                            <asp:ListItem
Value="concert_news.jpg" Text="concert"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        artiste:
                                    </td>
                                    <td>
                                        <asp:DropDownList runat="server"
ID="dropdownlistArtiste" AppendDataBoundItems="true"
                                            DataSourceID="datasourceArtiste"
DataTextField="nom" DataValueField="id">
                                            <asp:ListItem Text=""
Value="0"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Button runat="server" ID="btnSave"
Text='insérer' CommandName="Insert"></asp:Button>
                                    </td>
                                    <td>
                                        <asp:Button runat="server"
ID="btnCancel" Text='annuler' CommandName="Cancel"></asp:Button>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    </table> </td> </tr>
                </InsertItemTemplate>
                <EditItemTemplate>
                    <tr>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        titre :
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server"
ID="TBTitre" CssClass="underlined" Text='<%# Bind("titre") %>'></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        texte :
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server" ID="TBtext"
Columns="80" Rows="8" TextMode="MultiLine"
                                            Text='<%# Bind("texte")
%>'></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        image:
                                    </td>
                                    <td>
                                        <asp:DropDownList runat="server"
ID="dropdownlistImage" SelectedValue='<%# Bind("image") %>'>
                                            <asp:ListItem Value=""
Text=""></asp:ListItem>
                                            <asp:ListItem Value="507_newsjpg"
Text="site"></asp:ListItem>
                                            <asp:ListItem
Value="artiste_news.jpg" Text="artiste"></asp:ListItem>
                                            <asp:ListItem
Value="concert_news.jpg" Text="concert"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        artiste:
                                    </td>
                                    <td>
                                        <asp:DropDownList runat="server"
ID="dropdownlistArtiste" AppendDataBoundItems="true"
                                            DataSourceID="datasourceArtiste"
DataTextField="nom" DataValueField="id" SelectedValue='<%# Bind("artisteid")
%>'>
                                            <asp:ListItem Text=""
Value="0"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Button runat="server"
ID="TextBoxModif" Text='modifier' CommandName="Update">
                                        </asp:Button>
                                    </td>
                                    <td>
                                        <asp:Button runat="server" ID="Button1"
Text='annuler' CommandName="Cancel"></asp:Button>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </EditItemTemplate>
                <ItemTemplate>
                    <tr>
                        <td class="paragraphblock">
                            <asp:Image runat="server" ID="imgNews"
CssClass="imgNews" ImageUrl='<%# "../images/" + Eval("image") %>' />
                            <asp:Label runat="server" ID="labelTitre"
CssClass="underlined" Text='<%# Eval("titre") %>'></asp:Label><br />
                            <asp:Label runat="server" ID="labeltext" Text='<%#
Eval("texte") %>'></asp:Label><br />
                            <div runat="server" id="divAdmin">
                                <asp:LinkButton runat="server" ID="lnkEdit"
Text="editer" CommandName="edit" CommandArgument='<%# Eval("id")
%>'></asp:LinkButton>
                                -
                                <asp:LinkButton runat="server" ID="lnkSuppr"
Text="supprimer" CommandName="Delete"
                                    CommandArgument='<%# Eval("id") %>'
OnClientClick="javascript: return confirm('Are you sure ?')"></asp:LinkButton>
                            </div>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>


codebehind onclick: 

        protected void btnNew_Click(object sender, EventArgs e)
        {
            gridNews.EditIndex = -1;
            ((LinkButton)sender).Visible = false;
            gridNews.InsertItemPosition = InsertItemPosition.FirstItem;
        }



Actual Results:

- the link hides but the insertitemtemplate will not be shown


Expected Results:

- the link hides and the insertitemtemplate appears after postback

How often does this happen? 

 - always

Additional Information:
OS : Debian Lenny

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list