i have composite control which is very simple it has text-box and a link-button and when the user clicks on the link-button it displays the div and inside the div i have a data-grid control, in other words it works like a multi-column combo-box.
here is my question:
i drag and drop my control(my composite control) from the toolbar and underneath i have textbox and in the design time i dont see the textbox or any other control, it bascially hides... what do i have to do in order for other control to be visible?
example
<cc1:MultiColumnComboBox ID="MultiColumnComboBox1" runat="server">
<asp:TextBox ID="TextBox8" runat="server"/> <br>
<asp:Label ID="Label1" runat="server" Text="Label"/>
i dont see the textbox and label.....what im missing?
here is my source code:
// composite control starts...
1 protected override void RenderContents(System.Web.
UI.HtmlTex
tWriter writer)
2 {
3 EnsureChildControls();
4 AddAttributesToRender(writ
er);
5 writer.AddAttribute(HtmlTe
xtWriterAt
tribute.Ce
llpadding,
"0");
6 writer.AddAttribute(HtmlTe
xtWriterAt
tribute.Ce
llspacing,
"0");
7 writer.AddAttribute("onmou
seleave", string.Format("onLostFocus
(\'{0}\',\
'{1}\');",
DivId, GetCtrlsToHideIds()));
8 writer.RenderBeginTag(Html
TextWriter
Tag.Table)
;
9
10 writer.RenderBeginTag(Html
TextWriter
Tag.Tr);
11 writer.RenderBeginTag(Html
TextWriter
Tag.Td);
12 txtData.RenderControl(writ
er);
13 btnDownArrow.RenderControl
(writer);
14 //if (this.ViewState["Validator
Enabled"] != null && (bool)this.ViewState["Vali
datorEnabl
ed"] == true)
15 //{
16 // writer.Write(" ");
17 // rfData.RenderControl(write
r);
18 //}
19 writer.RenderEndTag(); //'Td
20 writer.RenderEndTag(); //'Tr
21
22 writer.RenderBeginTag(Html
TextWriter
Tag.Tr);
23 writer.RenderBeginTag(Html
TextWriter
Tag.Td);
24
25 Unit width;
26 Unit heigth;
27
28 if (this.ViewState["ComboBoxL
istWidth"]
== null)
29 {
30 width = new Unit(200); //'default width of the combo box in pixles
31 }
32 else
33 {
34 width = (Unit)this.ViewState["Comb
oBoxListWi
dth"];
35 }
36
37 if (this.ViewState["ComboBoxL
istHeight"
] == null)
38 {
39 heigth = new Unit(200); //'default width of the combo box in pixles
40 }
41 else
42 {
43 heigth = (Unit)this.ViewState["Comb
oBoxListHe
ight"];
44 }
45
46
47 writer.Write("<div style=\'Z-INDEX:100;BACKGR
OUND:White
;POSITION:
absolute;display:none;widt
h:" + width.ToString() + ";" + "height:" + heigth.ToString() + ";" + DivCSS + "\' id=" + DivId + ">"); // '" onmouseleave=" & String.Format("onLostFocus
('{0}','{1
}');>", DivId, GetCtrlsToHideIds))
48
49 dgSearch.RenderControl(wri
ter);
50 writer.Write("</div>");
51 writer.RenderEndTag(); //'Td
52 writer.RenderEndTag(); //'Tr
53
54 writer.RenderEndTag(); // Table
1 private string DivId
2 {
3 get
4 {
5 return "div" + this.ClientID;
6 }
7 }
private string DivCSS {
get {
System.Text.StringBuilder css = new System.Text.StringBuilder(
);
string xScrolling;
object yScrolling;
css.Append("BORDER-RIGHT: black 0px solid;");
css.Append("BORDER-TOP: black 0px solid;");
css.Append("BORDER-BOTTOM:
black 0px solid;");
css.Append("BORDER-LEFT: black 0px solid;");
if (this.ViewState("Horizonta
lScrolling
") == null || !(this.ViewState("Horizont
alScrollin
g"))) {
xScrolling = "none";
} else {
xScrolling = "auto";
}
if (this.ViewState("VerticalS
crolling")
== null || !(this.ViewState("Vertical
Scrolling"
))) {
yScrolling = "none";
} else {
yScrolling = "auto";
}
css.AppendFormat("overflow
-x:{0};", xScrolling);
css.AppendFormat("overflow
-y:{0};", yScrolling);
return css.ToString;
}
}
if you see my above code, i make sure that i have style DISPLAY:NONE
writer.Write("<div style=\'Z-INDEX:100;BACKGR
OUND:White
;POSITION:
absolute; display:none; width:" + width.ToString() + ";" + "height:" + heigth.ToString() + ";" + DivCSS + "\' id=" + DivId + ">");
thanks looking forward to see the solution.