Calendar Control Wrapped in an Update Panel with a PopupControl Extender inside a Bulk Edit Grid View

Last post 11-13-2007 1:05 AM by mahens. 3 replies.

Sort Posts:

  • Calendar Control Wrapped in an Update Panel with a PopupControl Extender inside a Bulk Edit Grid View

    01-25-2007, 10:39 AM
    • Loading...
    • apollolax123
    • Joined on 09-29-2006, 2:54 PM
    • Florida, USA
    • Posts 91

    I have a Grid View that allows mulitple updates with one click (a bulk edit if you will). The 3 problem fields are date fields. I have a calendar control tied to a popupControlExtender wrapped in an update panel which is in a panel control. If i want to change the dates on the last row in the Grid View it works fine; however if I try to edit any other dates in the grid view it returns a blank text box. If I click the textbox again the Calendar still hold the value of the date, but just does not display the date.

    Here is the GridView Code from my .aspx page:

    <

    asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource3" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" GridLines="Horizontal">

    <Columns>

    <asp:TemplateField HeaderText="ItemNo" InsertVisible="False" SortExpression="ItemNo">

    <EditItemTemplate>

    <asp:Label ID="Label1" runat="server" Text='<%# Eval("ItemNo") %>'></asp:Label>

    </EditItemTemplate>

    <ItemTemplate>

    <asp:Label ID="Label1" runat="server" Text='<%# Bind("ItemNo") %>'></asp:Label>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="Action By" SortExpression="Name">

    <EditItemTemplate>

    <asp:Label ID="Label2" runat="server" Text='<%# Eval("Name") %>'></asp:Label>

    </EditItemTemplate>

    <ItemTemplate>

    <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="SDSEmpID" DataTextField="Name"

    DataValueField="EmployeeID" SelectedValue='<%# Bind("ActionBy") %>'>

    </asp:DropDownList><asp:SqlDataSource ID="SDSEmpID" runat="server" ConnectionString="<%$ ConnectionStrings:EmployeesConnectionString %>"

    SelectCommand="SELECT EmployeeID, LastName + ', ' + FirstName AS Name FROM dbo.Employees WHERE (Active = '1') ORDER BY LastName">

    </asp:SqlDataSource>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="Description" SortExpression="Description">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>

    </EditItemTemplate>

    <ItemTemplate>

    <asp:TextBox ID="TextBox5" runat="server" Height="48px" MaxLength="1000" Text='<%# Bind("Description") %>'

    TextMode="MultiLine" Width="232px"></asp:TextBox>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="Assigned" SortExpression="Assigned">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Assigned") %>'></asp:TextBox>

    </EditItemTemplate>

    <ItemTemplate>

    &nbsp;<asp:TextBox ID="txtAssigned" runat="server" Text='<%# Bind("Assigned", "{0:d}") %>'

    Width="72px"></asp:TextBox><br />

    <asp:Panel ID="pnlAssigned" runat="server" BackColor="White" Height="50px"

    Width="125px">

    <atlas:UpdatePanel ID="UpdatePanel4" runat="server">

    <ContentTemplate>

     

    <asp:Calendar ID="CalAssigned" runat="server" OnSelectionChanged="CalAssigned_SelectionChanged" BackColor="#E2C382" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px">

    <SelectedDayStyle BackColor="Black" ForeColor="White" />

    <TodayDayStyle BackColor="White" Font-Bold="True" Font-Italic="True" ForeColor="#0000C0" />

    <WeekendDayStyle BackColor="#E0E0E0" Font-Strikeout="False" ForeColor="Gray" />

    <NextPrevStyle BackColor="Black" Font-Bold="True" ForeColor="White" />

    <DayHeaderStyle BackColor="Black" ForeColor="White" />

    <TitleStyle BackColor="Black" Font-Bold="True" ForeColor="White" />

    </asp:Calendar>

     

    <cc1:PopupControlExtender ID="PopupControlExtender1" runat="server">

    <cc1:PopupControlProperties TargetControlID="txtAssigned" PopupControlID="PnlAssigned" Position="Bottom" CommitProperty="value"/>

    </cc1:PopupControlExtender>

    </ContentTemplate>

    </atlas:UpdatePanel>

    &nbsp;&nbsp;</asp:Panel>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="DoneOn" SortExpression="DoneOn">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("DoneOn") %>'></asp:TextBox>

    </EditItemTemplate>

    <ItemTemplate>

    &nbsp;<asp:TextBox ID="txtDoneOn" runat="server" Text='<%# Bind("DoneOn", "{0:d}") %>'

    Width="72px"></asp:TextBox><br />

    <asp:Panel ID="pnlDoneOn" runat="server" Height="50px" Width="125px">

    <atlas:UpdatePanel ID="UpdatePanel5" runat="server">

    <ContentTemplate>

     

    <asp:Calendar ID="CalDoneOn" runat="server" OnSelectionChanged="CalDoneOn_SelectionChanged" BackColor="#E2C382" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px">

    <SelectedDayStyle BackColor="Black" ForeColor="White" />

    <TodayDayStyle BackColor="White" Font-Bold="True" Font-Italic="True" ForeColor="#0000C0" />

    <WeekendDayStyle BackColor="#E0E0E0" Font-Strikeout="False" ForeColor="Gray" />

    <NextPrevStyle BackColor="Black" Font-Bold="True" ForeColor="White" />

    <DayHeaderStyle BackColor="Black" ForeColor="White" />

    <TitleStyle BackColor="Black" Font-Bold="True" ForeColor="White" />

    </asp:Calendar>

     

    <cc1:PopupControlExtender ID="PopupControlExtender2" runat="server">

    <cc1:PopupControlProperties TargetControlID="txtDoneOn" PopupControlID="pnlDoneOn" position="Bottom" CommitProperty="value" />

    </cc1:PopupControlExtender>

    </ContentTemplate>

    </atlas:UpdatePanel>

     

    </asp:Panel>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="DueDate" SortExpression="DueDate">

    <EditItemTemplate>

    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("DueDate") %>'></asp:TextBox>

    </EditItemTemplate>

    <ItemTemplate>

    &nbsp;<asp:TextBox ID="txtDueDate" runat="server" Text='<%# Bind("DueDate", "{0:d}") %>'

    Width="72px"></asp:TextBox><br />

    <asp:Panel ID="pnlDueDate" runat="server" Height="50px" Width="125px">

    <atlas:UpdatePanel ID="UpdatePanel6" runat="server">

    <ContentTemplate>

    <asp:Calendar ID="CalDueDate" runat="server" OnSelectionChanged="CalDueDate_SelectionChanged" BackColor="#E2C382" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px">

    <SelectedDayStyle BackColor="Black" ForeColor="White" />

    <TodayDayStyle BackColor="White" Font-Bold="True" Font-Italic="True" ForeColor="#0000C0" />

    <WeekendDayStyle BackColor="#E0E0E0" Font-Strikeout="False" ForeColor="Gray" />

    <NextPrevStyle BackColor="Black" Font-Bold="True" ForeColor="White" />

    <DayHeaderStyle BackColor="Black" ForeColor="White" />

    <TitleStyle BackColor="Black" Font-Bold="True" ForeColor="White" />

    </asp:Calendar>

    <cc1:PopupControlExtender ID="PopupControlExtender3" runat="server">

    <cc1:PopupControlProperties TargetControlID="txtDueDate" PopupControlID="pnlDueDate" Position="Bottom" CommitProperty="value" />

    </cc1:PopupControlExtender>

    </ContentTemplate>

    </atlas:UpdatePanel>

    </asp:Panel>

    </ItemTemplate>

    </asp:TemplateField>

    <asp:TemplateField HeaderText="Status" SortExpression="Status">

    <EditItemTemplate>

    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Status") %>' />

    </EditItemTemplate>

    <ItemTemplate>

    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Status") %>' Text="Status " TextAlign="Left" />

    </ItemTemplate>

    </asp:TemplateField>

    <asp:BoundField DataField="ProjNum" HeaderText="ProjNum" SortExpression="ProjNum" />

    <asp:BoundField DataField="Discipline" HeaderText="Discipline" SortExpression="Discipline" />

    </Columns>

    <RowStyle HorizontalAlign="Left" VerticalAlign="Top" />

    <HeaderStyle BackColor="#E2C382" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />

    </asp:GridView>

     The codebehind file I am using to call the date from the Calendar Control to the Textbox is <CalendarID>_SelectionChanged:

    PopupControlExtender1.Commit(CalAssigned.SelectedDate.ToShortDateString)

    //////My syntax is the same for all 3 calendar controls associated with the PopupControlExtender.

     I am coding in VB.NET.

     

    ANy help would be much appreciated. Thanks

    If you get an answer to your question, please mark it as 'Answer' Smile


    www.lymanlax.com | www.possumslax.com
  • Re: Calendar Control Wrapped in an Update Panel with a PopupControl Extender inside a Bulk Edit Grid View

    04-03-2007, 2:05 PM
    • Loading...
    • toy
    • Joined on 12-13-2006, 3:42 PM
    • Posts 99
    i actually have the similar problem which i posted a few weeks ago
    where only the last row was updating

    so id like to hear someones opinion on this as well

    thanks for posting

    just a girl coder
  • Re: Calendar Control Wrapped in an Update Panel with a PopupControl Extender inside a Bulk Edit Grid View

    10-03-2007, 7:17 AM
    Answer
    • Loading...
    • apollolax123
    • Joined on 09-29-2006, 2:54 PM
    • Florida, USA
    • Posts 91

    I found out the problem...or so I think I have. If you upgrade to the newest version of AJAX it seems that they have fixed the problem of associating textboxes with the Calendar Extender Control. I have been reading in CodePlex about how they are trying to associate multiple textboxes with one Calendar Extender Control, which would decrease page load time if you have multiple date fields or have them inside a gridview with multiple rows.

    They say this issue is being worked on but for now it is stable enough for a new release. If you are still having this problem download the new AJAX toolkit copy over the new .dll into your Bin folder and add your controls to the toolbox and you should be set.

     Smile

    If you get an answer to your question, please mark it as 'Answer' Smile


    www.lymanlax.com | www.possumslax.com
  • Re: Calendar Control Wrapped in an Update Panel with a PopupControl Extender inside a Bulk Edit Grid View

    11-13-2007, 1:05 AM
    • Loading...
    • mahens
    • Joined on 11-17-2006, 1:04 AM
    • Posts 113

     Hi,

     

    Iam facing problem with calendar extender control.i am having a Gridview which show 800 records..I implemented paging where each page shows 100 records.I am having text box as a item template where user is going to enter date .for entering date i used calendar extender control, but it takes too much  time for page loading sometimes i get error saying that Browser is unable to respond since busy with scripting.  Please tell me a solution for these kind of things

     

    With regards,

    Mahender 

Page 1 of 1 (4 items)
Microsoft Communities
Page view counter