humour
Programmer
- Nov 24, 2003
- 87
I noticed that when I place a UserControl on a webform
like so:
<uc1:uCalendar ID="UCalendarIncidentDate" runat="server" />
The TabIndex property isn't available? Why?
To get around this problem I have contained the uCalendar control - which is really 3 controls, a TextBox,Button, and the MS Calendar) I contain the UC in a panel (because it does have a tabindex) like so:
<asp
position: absolute; top: 238px" Width="208px" TabIndex="73" >
<uc1:uCalendar="UCalendarIncidentDate"runat="server" />
</asp
On the UC I have public methods to set the TABINDEX on the 3 controls it houses. However I am not getting the Tab Order behaviour I expect.
example:
Textbox1(Tabindex 10)
PanelA.ucA(Tabindex 20)
uca.Textbox(22)
uca.Calendar(23)
uca.Button(24)
TextBox2
PanelB.ucB(TabIndex 30)
ucb.Textbox(32)
ucb.Calendar(33)
ucb.Button(34)
The Tab Behaviour I actually observe is as follows:
Textbox1 - PanelA, PanelB, TextBox2
What I want is
TextBox1 - uca.Textbox - uca.Calendar uca.Button
then
TextBox2 - ucb.Textbox - ucb.Calendar ucb.Button
My Questions:
a) How Can I achieve an Explicit Tab order on a form that uses the same User Control iterated 4 times.
a.2) Is there a way to get User Controls and their sub controls to have A TABIndex, Z-Order and Left, Top attributes that normal server controls have??
b) Is there something I should use instead of a Panel? Maybe a Div tag? If so am I better of with a server DIV control or an HTML control - maybe a table?
c) I use GridLayout because I want to Explicitly set and organize my controls in a predictable way and because I prefer the way my Calendar which appears and dissapears as a result of choosing a date Overlays the controls underneath it (Z-Order). In FlowLayout the suddenly appearing Calendar Control PUSHES controls underneath it - resulting in a jerky screen motion.
d) Can someone give me a good reason (other than browser unpredictability - which is not my issue as to why I should switch to Flow-View? I am not against it I just had a hard time getting my controls organized and having the behaviours I wanted in Flow-View.
Sorry for all the questions, hopefully someone or many people can take a stab at them.
Kindest Regards,