Hi,
The Render method must be called after all modifications but you call it before combo's store binding
1. Move Render after DisplayCustomer calling
Public Sub det_tobbtnsave_Click(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)
Dim wucf1 As wuc_deteg001
'---- load usercontrol
Ext.Net.X.Call("destroyFromCache", def_pnlwuc01.ClientID)
wucf1 = LoadControl("wuc_deteg001.ascx")
wucf1.ID = "wuc_deteg001"
def_pnlwuc01.ContentControls.Add(wucf1)
Ext.Net.X.Call("putToCache", def_pnlwuc01.ClientID, wucf1.ControlsToDestroy)
'some data for combo
Dim Customers(1)() As String
Customers(0) = New String() {"1", "Smith"}
Customers(1) = New String() {"2", "Miller"}
'combo in page
det_Str_Customer.DataSource = Customers
det_Str_Customer.DataBind()
det_Cmb_CusId.Value = "1"
'display data in usercontrol
wucf1.Customers = Customers
wucf1.DisplayCustomer()
def_pnlwuc01.Render()
End Sub
2. Use the following DisplayCustomer (just use properties instead methods because control is dynamic)
Public Sub DisplayCustomer()
'text
ucde01_Txt_CusId.Text = "1"
ucde01_Txt_CusNo.Text = "No 1"
ucde01_Txt_CadName1.Text = "Company 1"
'combo with store
ucde01_Customer.DataSource = Customers
ucde01_Customer.DataBind()
ucde01_Cmb_CusId.SelectedItem.Value = "1"
'or
'ucde01_Cmb_CusId.Value="1"
End Sub
Sinced I used render instead of updatecontent I can not find the usercontrol with FindControl
I don't see in your sample where you call FindControl. I tried to find control after 'ContentControls.Add' and user control is found
def_pnlwuc01.ContentControls.Add(wucf1)
def_pnlwuc01.FindControl(wuc_deteg001) 'retrun result is not null