abidmix
abidmix

Reputation: 1748

ASP.Net wizard Control breaks in ie10

I have this following code snippet for an asp.net wizard control embedded inside a datagridview footer which is working perfectly according to my needs.It still renders correctly in Firefox, Chrome and opera but on upgrading to IE 10 the whole wizard is distorted.

Most of our clients are IE fanatics.Sad.

Image Links in IE and FireFox

My mark up for the template field where the wizard resides

<asp:TemplateField HeaderText="ISCID">
                    <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" SortExpression="ISCID" Text='<%# Eval("ISCID") %>' ReadOnly="true" />
                    </ItemTemplate>

                    <FooterTemplate>
                        <asp:Panel runat="server" ID="FooterMessagePanel1" Style="text-align: center" Wrap="False">
                       <asp:Label runat="server" ID="LabelFooterMessage1" Text="Click the + button to initiate a new transfer" />
                        </asp:Panel>

                        <asp:Panel runat="server" ID="TransferWizardPanel" Style="display: none" Width="100%" Wrap="False">

                            <asp:Wizard ID="TransferWizard" DisplayCancelButton="true" runat="server" HeaderText="Share transfer Wizard"
                                HeaderStyle-Font-Size="Larger"
                                HeaderStyle-CssClass="CaptionLabelGVsm"
                                OnFinishButtonClick="TransferWizard_FinishButtonClick"
                                OnCancelButtonClick="TransferWizard_CancelButtonClick"
                                OnActiveStepChanged="TransferWizard_ActiveStepChanged"
                                StepNextButtonType="Image"
                                StepNextButtonImageUrl="~/images/Next16.png"
                                StepPreviousButtonType="Image"
                                StepPreviousButtonImageUrl="~/images/Previous16.png"
                                CancelButtonType="Image"
                                CancelButtonImageUrl="~/images/Cancel16.png"
                                ActiveStepIndex="0" Width="100%">

                                <SideBarTemplate>
                                    <asp:DataList ID="SideBarList" runat="server" OnItemDataBound="SideBarList_ItemDataBound" HorizontalAlign="Justify" RepeatDirection="Horizontal">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="SideBarButton" ForeColor="Black" runat="server" CssClass="MenuBar"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:DataList>

                                    </tr><tr>
                                </SideBarTemplate>
                                <StartNavigationTemplate>
                                    <asp:Panel ID="panStart" runat="server">
                                        <asp:ImageButton runat="server" ID="imgStart" ImageUrl="~/images/Next16.png"
                                            CommandName="MoveNext" />
                                        <asp:ImageButton ID="startCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="~/images/Edit_UndoHS.png" OnClientClick="return confirm('Are you sure you want to cancel');" />
                                    </asp:Panel>
                                </StartNavigationTemplate>
                                <StepNavigationTemplate>

                                    <asp:ImageButton ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious" ImageUrl="~/images/Previous16.png" />
                                    <asp:ImageButton ID="StepNextButton" runat="server" CausesValidation="true" CommandName="MoveNext" ImageUrl="~/images/Next16.png" />
                                    <asp:ImageButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="~/images/Edit_UndoHS.png" />
                                </StepNavigationTemplate>
                                <FinishNavigationTemplate>
                                    <asp:ImageButton ID="FinishButton" runat="server" CausesValidation="False" CommandName="MoveComplete" ImageUrl="~/images/Finish16.png" />

                                </FinishNavigationTemplate>

                                <WizardSteps>
                                    <asp:WizardStep ID="WizardStep1" runat="server" Title="Transferor Details">
                                        <asp:Panel runat="server" ID="TransferFromAllotmentsPanel" Style="display: none">
                                            <table class="TableControlGV" style="width: 100%">
                                                <tr>
                                                    <td class="LabelColumnGV" style="text-align: left">Class</td>

                                                    <td class="DescColumnGV">
                                                        <asp:TextBox ID="AllotClassGVDDList" Width="100%" runat="server" CssClass="classInput" ReadOnly="False" />
                                                          <asp:RequiredFieldValidator ID="RequiredFieldValidatorAllotClass" runat="server" ControlToValidate="AllotClassGVDDList" Text="" InitialValue=""
                                                            Display="Dynamic" ErrorMessage="Enter share class"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>

                                            <table class="TableControlGV" style="width: 100%">
                                            <tr>
                                                <td colspan="6" class="CaptionLabelGVsm" style="text-align: left">Avalaible Certificates</td>
                                            </tr>
                                            <tr>
                                                <td style="width: 100%">

                                                    <asp:GridView ID="TrnsfreeWizardGridView" runat="server" AutoGenerateColumns="False" DataKeyNames="ISCID,ClassCode"
                                                        CssClass="grid" Width="100%" OnRowEditing="TrnsfreeWizardGridView_RowEditing"
                                                        EnableModelValidation="True" ShowFooter="False">
                                                        <RowStyle CssClass="GridViewRow" />
                                                        <SelectedRowStyle CssClass="GridViewRowSelected" />
                                                        <EditRowStyle BackColor="Azure" />
                                                        <EditRowStyle CssClass="GridViewRowEdit" />
                                                        <AlternatingRowStyle CssClass="GridViewRowAlt" />
                                                        <Columns>



                                                        </Columns>

                                                        <EmptyDataTemplate>



                                                        </EmptyDataTemplate>

                                                        <FooterStyle CssClass="CaptionLabelGVsm" />

                                                    </asp:GridView>
                                                </td>
                                            </tr>
                                        </table>

                                        </asp:Panel>
                                    </asp:WizardStep>
                                    <asp:WizardStep ID="WizadStep2" runat="server" Title="Transfer Details">

                                        <asp:Panel ID="NewTransferPanel" runat="server" Style="display: block" Width="100%">

                                        </asp:Panel>

                                    </asp:WizardStep>

                                    <asp:WizardStep ID="WizardStep3" runat="server" Title="Transfer Summary" OnActivate="WizardStep2_Activate">

                                        <asp:Panel ID="TransferSummaryPanel" runat="server">


                                            <asp:GridView ID="GridViewSummary" runat="server" AutoGenerateColumns="False" CssClass="grid">
                                                <Columns>
                                                    <asp:BoundField HeaderText="Date" DataField="TransDate" />
                                                    <asp:BoundField HeaderText="Transferor" DataField="Transferor" />
                                                    <asp:BoundField HeaderText="Transferee" DataField="Transferee" />
                                                    <asp:BoundField HeaderText="Class" DataField="ShareClass" />
                                                    <asp:BoundField HeaderText="OldCertNo" DataField="OldCertNumber" />
                                                    <asp:BoundField HeaderText="NewCertNo" DataField="NewCertNumber" />
                                                    <asp:BoundField HeaderText="Amount" DataField="Amount" />
                                                    <asp:BoundField HeaderText="Shares" DataField="Shares" />
                                                </Columns>
                                            </asp:GridView>
                                        </asp:Panel>

                                    </asp:WizardStep>

                                    <asp:WizardStep ID="WizardStep4" runat="server" Title="Transfer Complete">
                                        <asp:Panel ID="PanelComplete" runat="server" Style="display: block">

                                            <asp:Label ID="LabelMessage" runat="server" Text="Share transfer completed successfully<br>Click Finish to exit wizard or new to add a new transfer"></asp:Label>
                                            <asp:ImageButton ID="ButtonNew" runat="server" Text="New Transfer" OnClick="ButtonNew_Click" ImageUrl="~/images/add.png" />

                                        </asp:Panel>

                                    </asp:WizardStep>

                                </WizardSteps>
                            </asp:Wizard>

                        </asp:Panel>
                    </FooterTemplate>


                </asp:TemplateField>

I have been trying for hours to correct this problem but all my attempts have been thwarted by the stubborn IE10.Please help to stop myself banging my head against the wall.The unusual tr open and close tag in the sidebar template is a hack (got on this forum) to force the sidebar menu run horizontally and does not seem to be the root of the rendering issue.

Thanks in advance

Upvotes: 0

Views: 1069

Answers (1)

abidmix
abidmix

Reputation: 1748

Eureka!!!!.I figured out that IE10 was failing to override the initial width set on the row created event.By putting this code snippet in the row data-bound event of the datagridview,

If e.Row.RowType = DataControlRowType.Footer Then
         If Request.Browser.Type = "IE7" Then
                    e.Row.Cells(1).Width = 800
                    e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
         End if
End if

my problems were solved. Strange how IE10 browser type is detected as IE7 in Visual Studio 2012.

Upvotes: 1

Related Questions