Sep 29, 2017, 8:12 AM
Load items in combobox from codebehind
Hello,
I try to load items in the combobox from codebehind but it doesnt work. Combobox is not expanding when I click the trigger.
Here is my code:
I try to load items in the combobox from codebehind but it doesnt work. Combobox is not expanding when I click the trigger.
Here is my code:
var callDM = function (){
#{DirectMethods}.fillComboDates();
}
<ext:ComboBox runat="server" ID="cmbFormatFFC" DataIndex="DateFormat" FieldLabel="Date Format" Width="400" ForceSelection="true" EmptyText="Select date format...">
<Listeners>
<BoxReady Fn="callDM()" /> //tried also BeforeRender but no luck
</Listeners>
</ext:Combobox>
and the direct method in code behind:[DirectMethod]
public void fillComboDates()
{
cmbFormatFFC.Items.Insert(0, new Ext.Net.ListItem(DateTime.Now.ToString("d/M/yyyy"), "d/M/yyyy"));
cmbFormatFFC.Items.Insert(1, new Ext.Net.ListItem(DateTime.Now.ToString("dd-MMM-yyyy"), "dd-MMM-yyyy"));
}