The checked things in the Grid has to be shown in te CheckBoxList.
In one click on the button everything what has been checked in the grid has to be shown on the CHeckboxlist2.
I made something but its not completed, what do I have to do next?
<asp:Panel runat="server" ID="pnlSource">
<telerik:RadGrid ID="ChangedList" runat="server" AutoGenerateColumns="false" OnPageIndexChanged="ChangedList_PageIndexChanged" OnNeedDataSource="ChangedList_NeedDataSource" GridLines="None" AllowPaging="true" RenderMode="Lightweight" PageSize="5" AllowSorting="True">
<MasterTableView ClientDataKeyNames="Logging_ID" backcolor="PaleGreen" ForeColor="black" BorderStyle="Solid" BorderColor="Green" AlternatingItemStyle-BackColor="MediumSeaGreen" PagerStyle-BackColor ="LawnGreen" HeaderStyle-ForeColor="green" HeaderStyle-BorderColor="Crimson">
<Columns>
<telerik:GridCheckBoxColumn UniqueName="GridCheckBoxColumn" DataField="IsTrue">
</telerik:GridCheckBoxColumn>
<telerik:GridBoundColumn DataField="ModuleName" HeaderText="Naam" UniqueName="ModuleName" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AssemblyVersion" HeaderText="Versie" UniqueName="AssemblyVersion" ReadOnly="true">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true" >
<Selecting AllowRowSelect="True" />
</ClientSettings>
</telerik:RadGrid>
<br />
<div class="col-md-1" >
<asp:Button ID="ButtonALL" runat="server" Text="Update" OnClick="ButtonALL_OnClick" />
</div>
<asp:Panel runat="server" ID ="pnlSourceNoItems">
<%-- // <asp:Label runat="server" Text="Er zijn geen wijzigingen geconstateerd"/>--%>
</asp:Panel>
</div>
</div>
<div class="col-md-1">
<h3>==></h3><asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_OnClick" meta:resourcekey="btnUpdateResource1" />
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-6">
<h3>Websites</h3>
</div>
<div class="col-md-6">
<asp:DropDownList runat="server" id="ddWebserver" AutoPostBack="True" OnSelectedIndexChanged="ddWebserver_OnSelectedIndexChanged"/>
</div>
</div>
<div style="border: black; border-width: 1px; border-style: solid; overflow: scroll; height:300px">
<asp:Panel runat="server" ID="pnlTarget">
<asp:CheckBoxList ID="CheckBoxList2" runat="server" meta:resourcekey="CheckBoxList2Resource1">
</asp:CheckBoxList>
</asp:Panel>
<asp:Panel runat="server" ID="pnlNoItems">
<asp:Label runat="server" Text="Er zijn geen webs waar de update kan worden toegepast" />
</asp:Panel>
</div>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
protected void ButtonALL_OnClick(object sender, EventArgs e)
{
ButtonALL.BackColor = System.Drawing.Color.PaleGreen;
ButtonALL.BorderColor = System.Drawing.Color.Green;
ButtonALL.ForeColor = System.Drawing.Color.Black;
if (ButtonALL.Text == "Update")
{
ButtonALL.Text = "Updated";
}
else
{
ButtonALL.Text = "Update";
}
{
foreach (GridItem item in ChangedList.MasterTableView.Items)
{
GridDataItem dataitem = (GridDataItem)item;
TableCell cell = dataitem["GridCheckBoxColumn"];
CheckBox checkBox = (CheckBox)cell.Controls[0];
if (checkBox.Checked)
{
string value = dataitem.GetDataKeyValue("Logging_ID").ToString(); //Access the checked row using DataKeyNames
}
}
}
}