Jan 08, 2013, 1:49 PM
[CLOSED] How to make server control with 2 DateField inside(display issue) showing only 1 DateField
Hi,
I'm trying to make server control which will contains 2 DateField inside of it.
But only 1 DateField is display for now.
Here's sample:
aspx
Thanks,
ViDom
I'm trying to make server control which will contains 2 DateField inside of it.
But only 1 DateField is display for now.
Here's sample:
aspx
<%@ Page Language="C#" %>
<%@ Register TagPrefix="ext" Namespace="Ext.Net" Assembly="Ext.Net, Version=1.5.0.0, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87" %>
<%@ Register TagPrefix="uc" Namespace="Ext1._6Test.controls" Assembly="Ext1.6Test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
</head>
<body>
<ext:ResourceManager runat="server"/>
<ext:Viewport runat="server">
<Items>
<ext:Panel runat="server" Layout="Fit">
<Items>
<ext:NumberField runat="server" ID="number" FieldLabel="Number"></ext:NumberField>
<ext:ComboBox runat="server" ID="combo" FieldLabel="Combo"></ext:ComboBox>
<uc:FromToControl runat="server" ID="fromTo"/>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
</body>
</html>
Controlpublic class FromToControl : Ext.Net.CompositeField
{
private Ext.Net.DateField DateField1;
private Ext.Net.DateField DateField2;
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
DateField1 = new Ext.Net.DateField() { ID = this.ID + "datefield1", Flex = 1, Vtype = "daterange", Cls = "searchDatePickerLeft", CtCls = "searchDatePicker", Format = "dd-MM-yyyy" };
Ext.Net.ConfigItem configItem1 = new ConfigItem("endDateField", "DateField2", ParameterMode.Value);
DateField1.CustomConfig.Add(configItem1);
DateField1.Listeners.AfterRender.Handler = "this.label.addClass('searchLabel');";
DateField2 = new Ext.Net.DateField() { ID = this.ID + "datefield2", Flex = 2, Cls = "searchDatePickerLeft", CtCls = "searchDatePicker", Vtype = "daterange", Format = "dd-MM-yyyy", FieldLabel = "From" };
Ext.Net.ConfigItem configItem2 = new ConfigItem("startDateField", "DateField1", ParameterMode.Value);
DateField2.CustomConfig.Add(configItem2);
this.LayoutConfig.Align = HBoxAlign.Middle;
this.Items.Add(DateField1);
this.Items.Add(DateField2);
}
}
how should I do to make it work properly? I need to display 2 DatePicker inline. It's for advance search feature.Thanks,
ViDom
Last edited by Daniil; Jan 09, 2013 at 3:53 PM.
Reason: [CLOSED]