Unable to Change Panel Width

Last post 07-08-2009 12:26 AM by ramireddyindia. 1 replies.

Sort Posts:

  • Unable to Change Panel Width

    07-07-2009, 8:01 PM
    • Member
      19 point Member
    • propoo
    • Member since 08-31-2007, 10:32 PM
    • Posts 48

    Hey All,


    I have calendar control inside Panel and based on number of weeks in month I want to change height and width of Panel at runtime


    <asp:Panel ID="Pnl1" runat=server BackImageUrl="cal.jpg">
                                                <asp:Panel runat="server" ID="PnlCalender"  CssClass="MainCalenderin"  BackColor="white">
                                                                      <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
                                                <ContentTemplate>
                                                <asp:Calendar ID="Calendar1" runat="server" BackColor="White" OnDayRender="CalendarDRender" Caption="<strong>ISEN Calendar</strong>" TitleStyle-BackColor=white SelectedDayStyle-ForeColor=black CellPadding="2" CellSpacing=1 OnSelectionChanged="Calendar1_SelectionChanged"  SelectedDayStyle-BackColor="White" TitleStyle-Font-Bold=true BorderColor=white OnVisibleMonthChanged="Calendar1_VisibleMonthChanged">
                                                    <SelectedDayStyle BackColor="White" ForeColor="Black" />
                                                    <TitleStyle BackColor="White" Font-Bold="True" />
                                                </asp:Calendar>
                                                </ContentTemplate>
                                                </asp:UpdatePanel>
                                                <table align=center>
                                                <tr>
                                                <td>
                                                <img src="1.gif"/> <span>1</span>
                                                </td>
                                                <td>
                                                <img src="2.gif"/> <span>2</span>
                                                </td>
                                                <td>
                                                <img src="3.gif"/> <span>3</span>
                                                </td>
                                                </tr>
                                                </table>                                           
                                                </asp:Panel>
                                                </asp:Panel>
                                            <cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="PnlCalender" Corners="All" Radius="12" BorderColor=gray/>


    When Calendar loads for first time for this  month below mentioned code works and height & width becomes 250 by 250 and I am calling same  code on Calendar1.visiblemonthchanged event but it does not working which means height & width remains same 250 by 250


          If Weeks.Count = 4 Then
                PnlCalender.Width = 100
                PnlCalender.Height = 100         
            ElseIf arrWeeks.Count = 5 Then
                PnlCalender.Width = 250
                PnlCalender.Height = 250
            ElseIf arrWeeks.Count = 6 Then
                PnlCalender.Width = 270
                PnlCalender.Height = 270
            End If

      Any idea? Thanks!!!!!

  • Re: Unable to Change Panel Width

    07-08-2009, 12:26 AM
    Answer

    I think panel width and height are chaning but they are not reflecting. set border=1 for that panel, then i think u can observe panel size is increasing. and also remember that increasing panel size won't increase your calendar control size. 

    Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
Page 1 of 1 (2 items)