or
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| AllowSorting="true" ShowGroupPanel="True" |
| OnNeedDataSource="RadGrid1_NeedDataSource" |
| AllowMultiRowSelection="false" |
| Skin="Vista" |
| > |
| <ClientSettings AllowDragToGroup="True" EnablePostBackOnRowClick="true"> |
| </ClientSettings> |
| <MasterTableView GroupLoadMode="Server" > |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="Group" /> |
| </GroupByFields> |
| <SelectFields> |
| <telerik:GridGroupByField FieldName="Group" /> |
| </SelectFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> |
| protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| DataTable tbl = new DataTable(); |
| DataColumn col = new DataColumn("ID"); |
| col.DataType = typeof(int); |
| tbl.Columns.Add(col); |
| col = new DataColumn("Name"); |
| col.DataType = typeof(string); |
| tbl.Columns.Add(col); |
| col = new DataColumn("Group"); |
| col.DataType = typeof(string); |
| tbl.Columns.Add(col); |
| int size = 15; |
| int maxLen = size.ToString().Length; |
| for (int i = 1; i <= size; i++) |
| { |
| tbl.Rows.Add(new object[] { i, "Name" + i.ToString("D" + maxLen), "Group" + i % 5 }); |
| } |
| RadGrid1.DataSource = tbl; |
| } |
| protected void Button1_Click(object sender, EventArgs e) |
| { |
| /*RadGrid1.Rebind();*/ |
| } |
I want to Copy the selected rows from one grid to another.
I used the following code but the data not getting bind in to the second grid.
Dim selItems As GridItemCollection = grdResult.SelectedItems
RADGrid1.DataSource = selItems
RADGrid1.DataBind()

Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)Dim DeleteId As Integer = item("id").TextDim DeleteImage As String = item("filnamn").TextIf File.Exists(Server.MapPath("~/bulletinboard/images/") & DeleteImage) = True Then File.Delete(Server.MapPath("~/bulletinboard/images/") & DeleteImage)End If