Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 10th, 2009, 07:56 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Question Calendar not showing

I have a calendar pop up based upon image click button. It overlays a GridView.

At entry point, when user want to select a date (from - to) and click the calendar image button, the calendar does not show (at this point gridview is showing). After gridview is showing and user clicks the calendar image button, then calendar shows. I've been trying to figure out what is going on.

HTML Code:

HTML Code:
<%@PageLanguage="VB"MasterPageFile="~/MasterPage.master"AutoEventWireup="false"
CodeFile="LaborExceptionInqury.aspx.vb"Inherits="Default_aspx"Title="Vecellio Group Inc - AppNet - Job Reporting - Labor Exception Inquiry" %>
<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"runat="Server">
&nbsp;&nbsp;
<div>
<asp:PanelID="Panel1"runat="server"Height="510px"Style="left: 1px; position: relative;
top: -48px">
&nbsp;&nbsp;
<div>
<asp:PanelID="Panel2"runat="server"Height="33px"Style="border-right: gray thin solid;
border-top: gray thin solid; left: 0px; border-left: gray thin solid; border-bottom: gray thin solid;
position: relative; top: 57px; background-color: #ffffcc;"Width="949px">
<asp:LabelID="Label1"runat="server"Style="font-size: 25px; left: 267px; color: blue;
position: absolute; top: -37px"Text="J O B"></asp:Label>
<asp:LabelID="Label2"runat="server"Style="font-size: 25px; left: 338px; color: blue;
position: absolute; top: -38px"Text="R E P O R T I N G "Width="194px"></asp:Label>
&nbsp;
<asp:LabelID="Label4"runat="server"Style="font-size: 25px; left: 549px; color: blue;
position: absolute; top: -38px"Text="-"></asp:Label>
<asp:LabelID="Label5"runat="server"Style="font-size: 25px; left: 580px; color: blue;
position: absolute; top: -40px"Text="Labor Exception Inquiry"Width="252px"></asp:Label>
&nbsp;
&nbsp;&nbsp;
<asp:LabelID="Label7"runat="server"Height="19px"Style="font-size: 15px; left: -228px;
color: blue; position: absolute; top: -1px"Text="Date From/To"Width="88px"></asp:Label>
<asp:TextBoxID="TextBox1"runat="server"Style="left: 108px; position: absolute;
top: 3px; font-size: 12px; border-top-width: thin; border-left-width: thin; border-bottom-width: thin;
border-right-width: thin;"Width="99px"></asp:TextBox>
&nbsp;
<asp:TextBoxID="TextBox2"runat="server"Style="left: 365px; position: absolute;
top: 4px; font-size: 12px; border-top-width: thin; border-left-width: thin; border-bottom-width: thin;
border-right-width: thin;"Width="93px"></asp:TextBox>
<asp:ButtonID="button2"runat="server"Style="left: 884px; position: absolute; top: 4px;
color: blue; border-top-width: thin; border-left-width: thin; border-bottom-width: thin;
border-right-width: thin;"Text="Excel"Width="54px"/>
&nbsp;
<asp:ButtonID="Button1"runat="server"Style="left: 825px; position: absolute; top: 4px;
color: blue; border-top-width: thin; border-left-width: thin; border-bottom-width: thin;
border-right-width: thin;"Text="Go"Width="55px"/>
<asp:TextBoxID="TextBox3"runat="server"Style="border-top-width: thin; border-left-width: thin;
font-size: 12px; left: 568px; border-bottom-width: thin; position: absolute;
top: 4px; border-right-width: thin"Width="91px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;
<asp:LabelID="Label3"runat="server"Style="font-size: 15px; left: 8px; color: blue;
position: absolute; top: 5px"Text="Select Company"Width="99px"></asp:Label>
<asp:LabelID="Label8"runat="server"Style="font-size: 15px; left: 473px; color: blue;
position: absolute; top: 7px"Text="Date From / To"Width="95px"></asp:Label>
<asp:TextBoxID="TextBox4"runat="server"Style="border-top-width: thin; border-left-width: thin;
font-size: 12px; left: 692px; border-bottom-width: thin; position: absolute;
top: 5px; border-right-width: thin"Width="92px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;
<asp:ImageButtonID="ImageButton2"runat="server"Style="position: absolute; left: 790px; top: 5px;"Height="23px"ImageUrl="~/Icons/Calendar_Icon.png"Width="21px"/>
<asp:LabelID="Label6"runat="server"Style="font-size: 15px; left: 216px; color: blue;
position: absolute; top: 7px"Text="Name (or part of name)"Width="144px"></asp:Label></asp:Panel>
&nbsp;&nbsp;&nbsp;
<asp:ImageButtonID="ImageButton1"runat="server"Style="position: absolute; left: 667px; top: 83px;"Height="23px"ImageUrl="~/Icons/Calendar_Icon.png"Width="21px"/><div>
<asp:GridViewID="GridView1"runat="server"Style="z-index: 10; left: 0px; position: relative;
top: 40px; border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid;
border-bottom: gray thin solid; font-size: 12px; overflow: hidden; clip: rect(auto auto auto auto);"
Width="954px"AllowPaging="True"AllowSorting="True"Font-Size="Small"AutoGenerateColumns="False"
CellSpacing="2"HorizontalAlign="Left"BorderColor="LightGray"BorderStyle="None"
PageSize="14"OnSorting="GridView1_Sorting"OnRowCommand="GridView1_RowCommand"
EmptyDataText="N/A">
<Columns>
<asp:BoundFieldDataField="company"HeaderText="Company">
<ItemStyleHorizontalAlign="Center"Width="60px"/>
<HeaderStyleHorizontalAlign="Center"/>
</asp:BoundField>
<asp:BoundFieldDataField="employeeid"HeaderText="Employee ID"SortExpression="employeeid">
<ItemStyleHorizontalAlign="Left"Width="100px"Wrap="False"/>
</asp:BoundField>
<asp:BoundFieldDataField="employeename"HeaderText="Name"SortExpression="employeename">
<HeaderStyleHorizontalAlign="Center"/>
<ItemStyleHorizontalAlign="Left"Width="150px"/>
</asp:BoundField>
<asp:BoundFieldDataField="code"HeaderText="Code">
<ItemStyleHorizontalAlign="Center"Width="60px"/>
</asp:BoundField>
<asp:BoundFieldDataField="codedescription"HeaderText="Description">
<ItemStyleHorizontalAlign="Left"Width="150px"/>
</asp:BoundField>
<asp:BoundFieldDataField="workdate"HeaderText="Date"DataFormatString="{0:d}"HtmlEncode="False"SortExpression="workdate">
<ItemStyleHorizontalAlign="Center"Width="80px"/>
</asp:BoundField>
<asp:BoundFieldDataField="foremanname"HeaderText="Foreman"SortExpression="foremanname">
<ItemStyleHorizontalAlign="Left"Width="150px"/>
</asp:BoundField>
<asp:BoundFieldDataField="batchname"HeaderText="Batch Name">
<ItemStyleHorizontalAlign="Left"Width="200px"/>
</asp:BoundField>
</Columns>
<HeaderStyleBackColor="#FFC080"Height="35px"/>
<AlternatingRowStyleBackColor="#FFFFC0"/>
<SelectedRowStyleBackColor="#FF8080"/>
<EditRowStyleBackColor="#FF8080"/>
<RowStyleHeight="20px"/>
<PagerStyleBackColor="#E0E0E0"/>
</asp:GridView>
</div>
<asp:CalendarID="Calendar1"runat="server"Height="0px"Style="z-index: 100; border-right: blue thin solid;
border-top: blue thin solid; font-size: 10px; left: -354px; border-left: blue thin solid;
border-bottom: blue thin solid; position: relative; top: 37px"Width="184px"BackColor="White"
BorderColor="#999999"CellPadding="4"DayNameFormat="Shortest"Font-Names="Verdana"
Font-Size="8pt"ForeColor="Black">
<SelectedDayStyleForeColor="White"BackColor="#666666"Font-Bold="True"/>
<TodayDayStyleForeColor="Blue"BackColor="#CCCCCC"/>
<WeekendDayStyleForeColor="Red"BackColor="#FFFFCC"/>
<SelectorStyleBackColor="#CCCCCC"/>
<OtherMonthDayStyleForeColor="Gray"/>
<NextPrevStyleVerticalAlign="Bottom"/>
<DayHeaderStyleBackColor="#CCCCCC"Font-Bold="True"Font-Size="7pt"/>
<TitleStyleBackColor="#999999"BorderColor="Black"Font-Bold="True"/>
</asp:Calendar>
<div>
&nbsp;</div>
<div>
&nbsp;</div>
</div>
</asp:Panel>
</div>
&nbsp;&nbsp;
</asp:Content>
 
Old February 10th, 2009, 09:02 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Show your codebehind...

Show the code of what happens when the user clicks the imagebutton?

should be something like

Code:
    Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click

        Calendar1.Visible = True

    End Sub
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old February 11th, 2009, 10:46 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Code behind:

Code:
 
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Calendar1.Visible = False
Dim mySelectedImageButton As String
mySelectedImageButton = Session("SelectedImageButton")
If mySelectedImageButton = "Button1" Then
TextBox3.Text = Calendar1.SelectedDate
Else
If mySelectedImageButton = "Button2" Then
TextBox4.Text = Calendar1.SelectedDate
End If
End If
End Sub
 
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Calendar1.Visible = True
Session("SelectedImageButton") = "Button1"
End Sub
 
Protected Sub ImageButton2_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton2.Click
Calendar1.Visible = True
Session("SelectedImageButton") = "Button2"
End Sub
 
Old February 11th, 2009, 11:54 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default It's a style issue...

It's an issue with your positioning and possibly your z-index.

Remove the positioning from the calendar and you'll see it display (behind your query bar)

so play with the style to get it. it's not your codebehind
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old February 11th, 2009, 12:28 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Jason,

Think I found it. I changed the position to be absolute (instead of relative) and it worked. I think the relative position was tied to the position of the GridVoew. Makes sense? Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
subforms are not showing up bjcountry Access 2 March 22nd, 2008 08:39 AM
images not showing in IE Adam H-W CSS Cascading Style Sheets 3 March 20th, 2008 07:02 AM
Calendar like calendar in AJAX in ASP.NET h@ckerz ASP.NET 2.0 Professional 0 February 19th, 2008 12:56 AM
FCKeditor not showing dofield BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 November 24th, 2007 05:20 AM
Showing Forms drachx General .NET 4 October 12th, 2004 12:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.