0

[Utilizing Visual Studio, ASP.NET, C#, and IE8]

I have a pretty standard gridview inside an update panel. Scriptmanager on MasterPage. UpdatePanel is set to UpdateMode: Always.

However, I have it now fairly smooth where my Add to SQL database and databind functions are smooth and you simply see a new row added to the gridview. When I [Delete], the row is quickly deleted and the input submission Table underneith the gridview moves up automatically to fill in the now missing row.

The view essentially stays in the same place during all these functions and makes for a smooth operation.

However, when using the Gridview>Edit Columns>CommandField>Edit, Update, Cancel buttons on the GridView, the page seems to shuffle about 10 rows up when you click [Edit]. Then when you hit [Cancel] it drops you like 5 rows down. Same with [Update]. It makes editing each submission a task of just finding your place again and again.

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="asdfasdf" Width="1200px" DataKeyNames="pk_id" CellPadding="4" 
    ForeColor="#333333" GridLines="None">
    <RowStyle BackColor="#EFF3FB" />
<Columns>
    <asp:CommandField ButtonType="Button" ShowEditButton="True">
        <HeaderStyle Width="5%" />
    </asp:CommandField>
    <asp:BoundField DataField="question" HeaderText="Question" 
        SortExpression="question" >
        <HeaderStyle Width="35%" />
    </asp:BoundField>
    <asp:BoundField DataField="answer_A" HeaderText="Choice A" 
        SortExpression="answer_A" >
        <HeaderStyle Width="10%" />
    </asp:BoundField>
    <asp:BoundField DataField="answer_B" HeaderText="Choice B" 
        SortExpression="answer_B" >
        <HeaderStyle Width="10%" />
    </asp:BoundField>
    <asp:BoundField DataField="answer_C" HeaderText="Choice C" 
        SortExpression="answer_C" >
        <HeaderStyle Width="10%" />
    </asp:BoundField>
    <asp:BoundField DataField="answer_D" HeaderText="Choice D" 
        SortExpression="answer_D" >
        <HeaderStyle Width="10%" />
    </asp:BoundField>
    <asp:BoundField DataField="answer_E" HeaderText="Choice E" 
        SortExpression="answer_E" >
        <HeaderStyle Width="10%" />
    </asp:BoundField>
    <asp:BoundField DataField="correct_answer" HeaderText="Answer" 
        SortExpression="correct_answer" >
        <HeaderStyle Width="5%" />
    </asp:BoundField>
    <asp:CommandField ButtonType="Button" ShowDeleteButton="True">
        <HeaderStyle Width="5%" />
    </asp:CommandField>
</Columns>
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerTemplate>
        asd
    </PagerTemplate>
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <EditRowStyle BackColor="#2461BF" />
    <AlternatingRowStyle BackColor="White" />

Palmer
  • 78
  • 13
  • Does this happen in all browsers or only IE8? By this I mean is the visual effect as jarring in other browsers or only IE? – Full Time Skeleton Jun 19 '13 at 11:16
  • @FullTimeSkeleton I wish I could try other browsers, but sadly this company only allows IE8. :\ – Palmer Jun 19 '13 at 11:21
  • Might not be worth it in this instance but for future reference a service like http://www.browserstack.com/ might be worth checking out. Presume this is for an intranet? – Full Time Skeleton Jun 19 '13 at 11:22
  • @FullTimeSkeleton Yes, intranet. And it's more or less just bothers me that it's there, more than being a real issue. I'll favorite that link though! – Palmer Jun 19 '13 at 11:27
  • I've found gridviews are bulky (code wise) and so I tend to use a repeater combined with Jquery Datatables. Once you hook up datatables and see how quick they are you won't go back to Gridviews. If your dataset is huge (20,000+) then you may need to use ajax, but this is an intranet so should be quick. Worth checking out datatables, for the amount of work involved in setting them up the rewards are huge. – Full Time Skeleton Jun 19 '13 at 11:31

0 Answers0