Hi,
I have a RadGrid it was created in design time and also this grid have a detail. But the problem is when I want to see the detail, the HeaderText of the master table is not visible.
How can I fix it?
I have a RadGrid it was created in design time and also this grid have a detail. But the problem is when I want to see the detail, the HeaderText of the master table is not visible.
How can I fix it?
| private void GenerarGrilla() |
| { |
| List<string> dataKeyNamesList = new List<string>(); |
| radgridResultados.AutoGenerateColumns = false; |
| radgridResultados.Visible = true; |
| foreach (ConfiguracionUI.Campo campo in form.Grilla.Campos) |
| { |
| GridBoundColumn boundColumn; |
| boundColumn = new GridBoundColumn(); |
| boundColumn.DataField = campo.Key; |
| boundColumn.HeaderText = campo.Name; |
| boundColumn.Visible = campo.Visible; |
| radgridResultados.MasterTableView.Columns.Add(boundColumn); |
| if (campo.IsdataKey == true) |
| dataKeyNamesList.Add(campo.Key); |
| } |
| string[] dataKeyNames = new string[dataKeyNamesList.Count]; |
| dataKeyNamesList.CopyTo(dataKeyNames); |
| radgridResultados.MasterTableView.DataKeyNames = dataKeyNames; |
| radgridResultados.AllowSorting = false; |
| radgridResultados.AutoGenerateColumns = false; |
| } |
| private void GenerarDetalle(GridTableView tableViewOrders) |
| { |
| radgridResultados.MasterTableView.DetailTables.Add(tableViewOrders); |
| foreach (ConfiguracionUI.Campo campoDetalle in form.Grilla.Detalle) |
| { |
| GridBoundColumn boundColumn; |
| GridHyperLinkColumn linkImagen; |
| if (campoDetalle.ColumnType != null) |
| { |
| linkImagen = new GridHyperLinkColumn(); |
| //linkImagen.DataNavigateUrlFields = campoDetalle.Key; |
| linkImagen.HeaderText = campoDetalle.Name; |
| linkImagen.Text = "Ver Imagen"; |
| linkImagen.NavigateUrl = "javascript:ShowMessage('imagen.aspx?&C={0}&R={1}&P={2}&I=True')"; |
| tableViewOrders.Columns.Add(linkImagen); |
| } |
| else |
| { |
| boundColumn = new GridBoundColumn(); |
| boundColumn.DataField = campoDetalle.Key; |
| boundColumn.HeaderText = campoDetalle.Name; |
| tableViewOrders.Columns.Add(boundColumn); |
| } |
| } |
| } |