Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tabla normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} This is a Page_load method that I use in my custom control,I want to add two editTemplates, in the same grid and in two differents bands.
I couldn't add the templates using the same method that infragistics examples shows. When I add both template in the way showed below only the parent band displays the template, and the child band lets you update but not with the assigned template. The webgrid is located inside a webusercontrol...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim rowTemplate As New UserControlMe.Page.LoadTemplate("ProvinciaTemplate.ascx").InstantiateIn(rowTemplate)Me.UWGCustom.Bands(0).RowEditItem.Controls.Add(rowTemplate) Dim rowTemplate2 As New UserControlPage.LoadTemplate("CiudadTemplate.ascx").InstantiateIn(rowTemplate2)Me.UWGCustom.Bands(1).RowEditItem = New RowEditItem(Nothing)Me.UWGCustom.Bands(1).RowEditItem.Controls.Add(rowTemplate2)
Dim rowTemplate As New UserControl
Me.Page.LoadTemplate("ProvinciaTemplate.ascx").InstantiateIn(rowTemplate)
Me.UWGCustom.Bands(0).RowEditItem.Controls.Add(rowTemplate)
Dim rowTemplate2 As New UserControl
Page.LoadTemplate("CiudadTemplate.ascx").InstantiateIn(rowTemplate2)
Me.UWGCustom.Bands(1).RowEditItem = New RowEditItem(Nothing)
Me.UWGCustom.Bands(1).RowEditItem.Controls.Add(rowTemplate2)
End Sub
TIA!
Daniel
Hello Daniel,
This could be a page lifecylce issue - at the moment of adding the template in Page_Load it may be too late in the page lifycle (e.g. the second band is already expanded). Can you please try moving the code in OnInit instead of OnLoad? Also you can experiment moving the code in the InitializeLayout event of the grid.
Please, let me know how it goes.