I am adding a table of detail in each row that appears, add it to programming. The problem is, when you expand the line, you see all the tables in detail all items.
'What may be missing?
this is my code for add a table of detail in each row:
'What may be missing?
this is my code for add a table of detail in each row:
DataTable datTabDatosDetalle =
new
DataTable();
if
(ViewState[
"OrdCompraProdDetallesSub"
+ IdOrdenCompra + Skucode] ==
null
)
{
datTabDatosDetalle = CCSMovimientoProductos.BuscarProdDetOrdenCompra_CEDIS(IdOrdenCompra, Skucode).Tables[0];
ViewState.Add(
"OrdCompraProdDetallesSub"
+ IdOrdenCompra + Skucode, datTabDatosDetalle);
}
else
datTabDatosDetalle = (DataTable)ViewState[
"OrdCompraProdDetallesSub"
+ IdOrdenCompra + Skucode];
Telerik.Web.UI.GridTableView detailTable =
new
Telerik.Web.UI.GridTableView(radGriOrdComDetalles);
radGriOrdComDetalles.MasterTableView.DetailTables.Add(detailTable);
detailTable.Name =
"tabDetail"
+ IdOrdenCompra + Skucode;
detailTable.DataKeyNames =
new
string
[] {
"Id"
,
"prodSkucode"
};
detailTable.EnableViewState =
true
;
detailTable.NoDetailRecordsText =
"Sin registros."
;
detailTable.Caption =
"Detalle del producto Sku "
+ Skucode;
detailTable.EditMode = Telerik.Web.UI.GridEditMode.InPlace;
foreach
(DataColumn dc
in
datTabDatosDetalle.Columns)
{
Telerik.Web.UI.GridBoundColumn campo =
new
Telerik.Web.UI.GridBoundColumn();
detailTable.Columns.Add(campo);
campo.UniqueName =
"col"
+ dc.ColumnName;
campo.HeaderText =
"[ "
+ dc.ColumnName +
" ]"
;
campo.HeaderStyle.Font.Bold =
true
;
campo.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
campo.DataField = dc.ColumnName;
if
(dc.ColumnName ==
"Id"
)
campo.Visible =
false
;
if
(dc.ColumnName ==
"prodSkucode"
)
campo.Visible =
false
;
if
(dc.ColumnName ==
"Talla"
)
campo.ReadOnly =
true
;
}
Telerik.Web.UI.GridEditCommandColumn campoEdit =
new
Telerik.Web.UI.GridEditCommandColumn();
campoEdit.UniqueName =
"colEdit"
;
campoEdit.ButtonType = Telerik.Web.UI.GridButtonColumnType.ImageButton;
campoEdit.EditText =
"Editar"
;
campoEdit.UpdateText =
"Actualizar"
;
campoEdit.CancelText =
"Cancelar"
;
detailTable.Columns.Add(campoEdit);
detailTable.DataSource = datTabDatosDetalle;
detailTable.Rebind();
radGriOrdComDetalles.Rebind();