[RESOLVED] Panel cannot display inline

my application let user to input time-off by exact time or am/pm.

as to hide/show the timeselector and am/pm radio button, i had use two separate panel.

but there is a problem of timeselector that cannot display inline. (when chose Exact time, the timeselector will display in other line).

 

 

<asp:Panel ID="panel_from_date" runat="server"  style="display:inline;">
<cc1:datetextbox id="tb_from_date" runat="server" borderstyle="Solid" width="75px" CausesValidation="True"></cc1:datetextbox>
&nbsp;
<cc1:datepicker id="DatePicker1" runat="server" controltopick="ctl00$CPH1$tb_from_date" meta:resourcekey="DatePickerResource"></cc1:datepicker>
</asp:Panel>

<asp:Panel ID="panel_from_hr" runat="server"  style="display:inline;">
<MKB:TimeSelector ID="TimeSelector_from_time" runat="server" DisplaySeconds="False" MinuteIncrement="1" AmPm="PM" BorderColor="Silver" Date="" Hour="0" Minute="0" Second="0" SelectedTimeFormat="Twelve"></MKB:TimeSelector>
</asp:Panel>
            
<asp:Panel ID="panel_from_am_pm" runat="server" Visible="False" style="display:inline;">
<asp:RadioButton ID="rb_from_am" runat="server" Checked="True" GroupName="from_am_pm" />
<asp:Localize runat="server" ID="text_from_am" Text="am" meta:resourcekey="text_am" />
<asp:RadioButton ID="rb_from_pm" runat="server" GroupName="from_am_pm" />
<asp:Localize runat="server" ID="text_from_pm" Text="pm" meta:resourcekey="text_pm" />
</asp:Panel>

 

How can i solve this problem ? thanks

Joe

All you have to do is place your controls into Tables. or use css. But generally CSS is used in defining page templates. So You can prefer using Table for your controls inside the page.

Please use appropriate widths or use css in below sample.

also please refer W3Schools - HTML Tables

<asp:Table runat="server" ID="TableControls">
    <asp:TableRow>
        <asp:TableCell>
            <asp:Label runat="server" id="Label1" Text="Time-off Format" />
        </asp:TableCell>
        <asp:TableCell>
            Radio Button for Exact Time.
        </asp:TableCell>
        <asp:TableCell>
            Radio Button for AMPM
        </asp:TableCell>
    </asp:TableRow>


    <asp:TableRow>
        <asp:TableCell Width="">
            From date & Time label
        </asp:TableCell>
        <asp:TableCell Width="">
            TextBox
        </asp:TableCell>
        <asp:TableCell Width="">
            Radio Button for AM
            Radio Button for PM
        </asp:TableCell>
    </asp:TableRow>

    <asp:TableRow>
        <asp:TableCell Width="">
            To date & Time label
        </asp:TableCell>
        <asp:TableCell Width="">
            TextBox
        </asp:TableCell>
        <asp:TableCell Width="">
            Radio Button for AM
            Radio Button for PM
        </asp:TableCell>
    </asp:TableRow>

    <asp:TableRow>
        <asp:TableCell Width="">
                    
        </asp:TableCell>
        <asp:TableCell Width="">
            Calclate button
        </asp:TableCell Width="">
        <asp:TableCell Width="">
        </asp:TableCell>
    </asp:TableRow>

    Other Rows comes here.
    Other Rows comes here.
    Other Rows comes here.

</asp:Table>

<asp:Table runat="server" ID="TableFooterSaveClearSubmit">
    <asp:TableRow>
        <asp:TableCell>
            save button
        </asp:TableCell>
        <asp:TableCell>
            clear button
        </asp:TableCell>
        <asp:TableCell>
            submit button
        </asp:TableCell>
    </asp:TableRow>
</asp:Table>

 

You can't use "style=" in a <ASP:Panel>.  You could try using a CssClass, but I don't know if that would work.

You could put your panels inside table cells, if you are willing to go the table layout route.

Given how few controls you're putting inside your panels, I think I might just skip the panels and hide the individual controls.

Try changing the Layout property of RadioButtonList from Table to Flow.

fyi, actually style property works for asp:Panel.

shahed.kazi

fyi, actually style property works for asp:Panel.

If you say so, but it isn't listed here: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.panel_members(v=VS.90).aspx

WombatEd

You can't use "style=" in a <ASP:Panel>

style property works for asp:panel. I've just tested.

<asp:Panel ID="Panel1" style="background-color:Gray;color:White" runat="server">
                SomeText inside Panel
            </asp:Panel>

Style Property is listed in http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.panel_members%28v=VS.90%29.aspx

Style Property is defined in WebControl class, so It must be there in every asp web control.

    public class WebControl : Control, IAttributeAccessor
    {
        .............
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        [WebSysDescription("WebControl_Style")]
        public CssStyleCollection Style { get; }
        .............
     }

 

thank you all.

i used table cell which solved my problem.

 

Joe

thoughts on "[RESOLVED] Panel cannot display inline"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>