Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Hi all,
 
I have some critical problem with edit item template of gridview.
 
My aspx code for the girdview is like
 
<asp:TemplateField HeaderText="T1" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <%-- <asp:Label ID="lblMonth1" Text='<%#Eval("Percentage1") %>' runat="server"></asp:Label>--%>
                        <asp:LinkButton ID="lblMonth1" Text='<%#Eval("Percentage1") %>' runat="server" OnClick="lblMonth_Click"></asp:LinkButton>
                        <asp:HiddenField ID="PeriodID1" runat="server" Value='<%#Eval("PeriodID1") %>' />
                        <asp:Label ID="date1" runat="server" Text='<%#Eval("date1","{0:d}") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox Width="70px" EnableCalendar="true" EnableShortDateCalendarString="true"
                            ID="datemonth1" CssClass="setting" runat="server" Text='<%#Eval("date1","{0:d}") %>'></asp:TextBox>
                        <ajaxToolkit:CalendarExtender ID="cal1" BehaviorID="bcal1" Enabled="true" PopupPosition="BottomRight"
                            TargetControlID="datemonth1" Format="dd/MM/yyyy" CssClass="font_strike" runat="server">
                        </ajaxToolkit:CalendarExtender>
                    </EditItemTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
                </asp:TemplateField>                              
                <asp:CommandField ShowDeleteButton="false" ShowEditButton="true" DeleteText="Verwijder"
                    ItemStyle-BorderColor="Black" ItemStyle-ForeColor="Blue" EditText="Bewerk" CancelText="Annuleer"
                    UpdateText="Update"></asp:CommandField>
            </Columns>
 

I have made 10 cloumns same as the one datemonth1 in the table.
So i have 10 edit item templates in my page and I have set the calender control and all settings in gridview rowdata bound event..
 
If anyone need the code i can paste it here..
 
The flow in my page is
 

1)in the mainscreenpanel it shows a table based on the selection in the dropdowns
2)in the main screen panel i am providing a link button which shows second scrin in which i am showing the above gridview
3)now the problem is on clicking the edit link in the above table it works as i want but when I am not clicking on cancel link or update link,and directly press back button it shows main screen
4)and then again if i am clicking on the link button it shows the tables edititems.
 
How can i solve it..?
can any one help me..?
Posted 22-Nov-12 20:57pm
Hiral21336

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,696
1 Sergey Alexandrovich Kryukov 6,675
2 CPallini 5,315
3 George Jonsson 3,584
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web01 | 2.8.140921.1 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100