Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
telerik RadListview中的复选框_Listview_Telerik_Radlistview - Fatal编程技术网

telerik RadListview中的复选框

telerik RadListview中的复选框,listview,telerik,radlistview,Listview,Telerik,Radlistview,我对这个很陌生,所以请容忍我 我正在使用Telrik的RadListView,并试图在InsertItemTemplate中使用复选框,但我似乎无法检索选中的值。我注意到的第一件事是,当我尝试写入我的asp:checkbox id时,intellesense将无法识别它,因此我使用FindControl,但是我在telerik演示()中看到他们通过名称访问复选框。 不管怎样,这就是我正在做的。如您所见,我想评估复选框,并根据触发Insert时是否选中它来执行某些操作 谢谢你的帮助 名单 <

我对这个很陌生,所以请容忍我

我正在使用Telrik的RadListView,并试图在InsertItemTemplate中使用复选框,但我似乎无法检索选中的值。我注意到的第一件事是,当我尝试写入我的asp:checkbox id时,intellesense将无法识别它,因此我使用FindControl,但是我在telerik演示()中看到他们通过名称访问复选框。 不管怎样,这就是我正在做的。如您所见,我想评估复选框,并根据触发Insert时是否选中它来执行某些操作

谢谢你的帮助

名单

<telerik:RadListView ID="IslandManagerList" runat="server" ItemPlaceholderID="IslandListContainer"
       DataSourceID="dbIslandEditManager" AllowPaging="True" InsertItemPosition="FirstItem" OnNeedDataSource="IslandManagerList_NeedDataSource" DataKeyNames="ItemId">
       <LayoutTemplate>
       <section style="display: table; margin: 0px auto; width: auto;">
        <telerik:RadDataPager ID="IslandManagerListPager" Skin="pj-Pager" EnableEmbeddedSkins="false"
            runat="server" PagedControlID="IslandManagerList" PageSize="15">
            <Fields>
                <telerik:RadDataPagerButtonField FieldType="Prev" />
                <telerik:RadDataPagerButtonField FieldType="Numeric" />
                <telerik:RadDataPagerButtonField FieldType="Next" />
            </Fields>
        </telerik:RadDataPager>
        </section>
        <asp:Button ID="btnInitInsert" class="ui-like-button" runat="server" Text="Add an Island" OnClick="btnInitInsert_Click" />
           <section>
               <asp:PlaceHolder ID="IslandListContainer" runat="server"></asp:PlaceHolder>
           </section>
       </LayoutTemplate>
       <ItemTemplate>
           <section class="listview-item">
               <section style="float: left; margin: 10px;">
                   <div style='width: 150px; height: 93px; background-color: #f7f7f7;'>
                   <p class="notice" style='position: absolute; z-index: 0; width: 120px; top: 35px;
                       left: 18px;'>
                       no image
                   </p>
                   <a href="/myislands/viewer?albumid=<%#Eval("ItemId")%>"><%#Eval("AlbumLogoSource")%></a></div>
               </section>
               <section style="float: left; width: 80%;">
                   <h3 style="margin: 10px 10px 5px 10px">
                       <a href="/myislands/viewer?albumid=<%#Eval("ItemId")%>"><%#Eval("Title")%></a>&nbsp;&nbsp;&nbsp;</h3>
                   <p style="font: 14px/20px tahoma; margin: 0px 10px 0px 10px;">
                       <%#Eval("Description")%></p>
               </section>
               <section class="photomanager-command-btns">
                   <asp:Button ID="editIsland" class="ui-like-button" runat="server" CommandName="Edit" Text="Edit" CausesValidation="false" />
                    <div class="ui-like-button" style="display:inline-block"><a id="uploadLink" href="/islands/tabid/917/ctl/upload/mid/1762/Default.aspx?aid=<%#Eval("ItemId")%>">Upload</a></div>
                    <div class="ui-like-button" style="display:inline-block"><a id="shareLink" href="/islanders?island=<%#Eval("ItemId")%>">Connect Friends</a></div> 
               </section>
           </section>
       </ItemTemplate>
       <EditItemTemplate>
       <section class="listview-item">
               <section style="float: left; margin: 10px;">
                   <div style='width: 150px; height: 93px; background-color: #f7f7f7;'>
                   <p class="notice" style='position: absolute; z-index: 0; width: 120px; top: 35px;
                       left: 18px;'>
                       no image
                   </p>
                   <a href="/myislands/viewer?albumid=<%#Eval("ItemId")%>"><%#Eval("AlbumLogoSource")%></a></div>
               </section>
               <section style="position: relative; float: left; font: 14px/20px tahoma;margin: 10px 10px 10px 10px;">
            <div style="overflow:hidden">
                <div style="width: 75px; float: left; margin: 10px 10px 5px 10px">
                    title:</div>
                <div style="float: left">
                    <asp:TextBox class="photomanager-edit-field" ID="updateTitle" runat="server" Text='<%# Bind("Title")%>'></asp:TextBox></div>
            </div>
            <div style="overflow:hidden">
                <div style="width: 75px; float: left; margin: 0px 10px 10px 10px;">
                    about:
                </div>
                <div style="float: left">
                    <asp:TextBox class="photomanager-edit-field" ID="updateDescription" TextMode="MultiLine"
                        Columns="5" Rows="4" runat="server" Text='<%#Bind("Description")%>'></asp:TextBox></div>
            </div>
        </section>
        <div style="position: absolute; bottom: 10px; right: 20px;">
            <asp:Button Style="float: left" class="ui-like-button" ID="saveIslandUpdate" runat="server"
                CommandName="Update" Text="Save" />
            <asp:Button Style="float: left" class="ui-like-button" ID="cancelIslandUpdate" runat="server"
                CommandName="Cancel" Text="Cancel" CausesValidation="false" />
        </div>
       </section>
       </EditItemTemplate>
       <InsertItemTemplate>
           <section class="listview-item">
               <section style="position: relative; float: left; font: 14px/20px tahoma; margin: 10px 10px 10px 10px;">
                   <div style="overflow: hidden">
                       <div style="width: 125px; float: left; margin: 10px 10px 5px 10px">
                           <h3>
                               Island Name:</h3>
                       </div>
                       <div style="float: left">
                           <asp:TextBox class="photomanager-edit-field" ID="tbTitle" runat="server" Text='<%# Bind("Title")%>'></asp:TextBox></div>
                       <asp:RequiredFieldValidator ID="rvTitle" runat="server" ControlToValidate="tbTitle"
                           ErrorMessage="Please give your Island a name" Display="Dynamic" />
                   </div>
                   <div style="overflow: hidden">
                       <div style="width: 125px; float: left; margin: 0px 10px 10px 10px;">
                           <h3>
                               About:</h3>
                       </div>
                       <div style="float: left">
                           <asp:TextBox class="photomanager-edit-field" ID="tbDescription" TextMode="MultiLine"
                               Columns="5" Rows="4" runat="server" Text='<%#Bind("Description")%>'></asp:TextBox>
                           <asp:RequiredFieldValidator ID="rvDescription" runat="server" ControlToValidate="tbDescription"
                               ErrorMessage="Please enter a little something about your Island" Display="Dynamic" />
                       </div>
                   </div>
               </section>
               <section style="position: relative; float: left; font: 14px/20px tahoma; margin: 10px 10px 10px 10px;">
                   <asp:CheckBox ID="makeIslandPublic" runat="server" CssClass="ui-like-button tooltip-item"
                       Checked="false" Text="Make this Island Viewable to the Public" /><div style="display: inline-block;
                           cursor: pointer;" class="tooltip-item">
                           <img src="images/icon_help_32px.gif" /></div>
                   <div class="show-tooltip" style="width: 250px;">
                       A public Island can be viewed by anyone. Use a public island when you want to show
                       of your works to the community and gain reputation to compete in fun contests</div>
               </section>
               <div style="position: absolute; bottom: 10px; right: 20px;">
                   <asp:Button ID="btnPerformInsert" class="ui-like-button" runat="server" Text="Add"
                       CommandName="PerformInsert" />
                   <asp:Button ID="BtnCancel" class="ui-like-button" runat="server" Text="Cancel" CommandName="Cancel"
                       CausesValidation="false" />
               </div>
           </section>
       </InsertItemTemplate>
   </telerik:RadListView>


protected void Page_Load(object sender, System.EventArgs e)
    {
        IslandManagerGrid.Visible = buttonToggleGridView.Checked;
        IslandManagerList.Visible = buttonToggleListView.Checked;

    }

    protected void IslandManagerGridDataSource_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {
        e.Command.Parameters["@AlbumOwner"].Value = base.UserId;
    }
    protected void btnInitInsert_Click(object sender, System.EventArgs e)
    {
        IslandManagerList.ShowInsertItem();
        IslandManagerList.FindControl("btnInitInsert").Visible = false;

    }

    protected void IslandManagerGridDataSource_Inserting(object sender, SqlDataSourceCommandEventArgs e)
    {

        CheckBox PublicChecked = (CheckBox)IslandManagerList.FindControl("makeIslandPublic");
        var isPublicChecked = PublicChecked.Checked;
        if (isPublicChecked == true)
        {
            e.Command.Parameters["@ViewRoles"].Value = "All Users";
        }
        else
        {
            e.Command.Parameters["@ViewRoles"].Value = "Administrators";
        }
        e.Command.Parameters["@CreatedByUser"].Value = base.UserId;
        e.Command.Parameters["@Owner"].Value = base.UserId;
    }

    #endregion

没有图像

标题: 关于: 岛名: 关于: 任何人都可以看到公共岛屿。当您想展示时,请使用公共岛 将您的作品提交给社区,并在有趣的比赛中赢得声誉 受保护的无效页面加载(对象发送方,System.EventArgs e) { IslandManagerGrid.Visible=按钮切换到GridView.Checked; IslandManagerList.Visible=buttonogglelistview.Checked; } 受保护的无效IslandManagerGridDataSource_正在选择(对象发送方、SqlDataSourcesSelectingEventArgs e) { e、 Command.Parameters[“@AlbumOwner”].Value=base.UserId; } 受保护的无效btnInitInsert\u单击(对象发送者,System.EventArgs e) { IslandManagerList.ShowInsertItem(); IslandManagerList.FindControl(“btnInitInsert”).Visible=false; } 受保护的无效IslandManagerGridDataSource_插入(对象发送方,SqlDataSourceCommandEventArgs e) { 复选框PublicChecked=(复选框)IslandManagerList.FindControl(“makeIslandPublic”); var isPublicChecked=PublicChecked.Checked; 如果(isPublicChecked==true) { e、 Command.Parameters[“@ViewRoles”].Value=“所有用户”; } 其他的 { e、 Command.Parameters[“@ViewRoles”].Value=“Administrators”; } e、 Command.Parameters[“@CreatedByUser”].Value=base.UserId; e、 Command.Parameters[“@Owner”].Value=base.UserId; } #端区
我认为您应该在每个项目中找到控件,而不是ListView, 可能是可能是

CheckBox PublicChecked = (CheckBox)currentItemFromList.FindControl("makeIslandPublic");