|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by einnox in Active Server Pages (ASP), Dynamic HTML (DHTML), Macromedia Homesite
I have a gridview, it allow sorting ang paging, it has a check box where i detect the the unique id, all works fine, except when the gridview was sort, and i edit the particular record which is checked, wrong data appeared because the previeous data retrieve, it doesnt update the datakeyname which the checkbox holds so wrong data display.
Please help me with this matter, all of my pages use this technique and i have a dealine right now.
Thanks in advance.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
|
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="ID"
EnableViewState="False" GridLines="Horizontal"
Style="position: relative; top: 0px; left: 5px; height: 153px; width: 718px;"
onpageindexchanging="GridView1_PageIndexChanging" AllowSorting="True"
onsorting="GridView1_Sorting" EmptyDataText="No Record Found.">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<RowStyle BackColor="#CCCCCC" ForeColor="#4A3C8C" />
<Columns>
<asp:TemplateField><HeaderTemplate><input ID="chkAll" runat="server"
onclick="javascript:SelectAllCheckboxes(this);" type="checkbox"/></HeaderTemplate><ItemTemplate><asp:CheckBox ID="PageID" runat="server" /></ItemTemplate><ControlStyle Width="50px" /><ItemStyle HorizontalAlign="Center" Width="20px" /></asp:TemplateField>
<asp:BoundField DataField="Name" SortExpression="Name" HeaderText="Name"><HeaderStyle HorizontalAlign="Left" /></asp:BoundField>
<asp:BoundField DataField="TempName" SortExpression="TempName" HeaderText="Template"><HeaderStyle HorizontalAlign="Left" /></asp:BoundField>
<%--<asp:BoundField DataField="CatName" SortExpression="CatName" HeaderText="Category"><HeaderStyle HorizontalAlign="Left" /></asp:BoundField>--%>
<asp:BoundField DataField="CouName" SortExpression="CouName" HeaderText="Country"><HeaderStyle HorizontalAlign="Left" /></asp:BoundField>
<asp:TemplateField HeaderText="Status" SortExpression="Status"><ItemTemplate><asp:Image ID="imgButton" runat="server" ImageUrl='<%# (string) FormatImageUrl( (string) Eval("Status")) %>' Width="20" Height="20"></asp:Image></ItemTemplate></asp:TemplateField>
<asp:BoundField DataField="Author" SortExpression="Author" HeaderText="Author"><HeaderStyle HorizontalAlign="Left" /></asp:BoundField>
<asp:BoundField DataField="Description" SortExpression="Description" HeaderText="Description"><HeaderStyle HorizontalAlign="Left" /></asp:BoundField>
</Columns>
<PagerStyle BackColor="Gray" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<HeaderStyle BackColor="#666666" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
</asp:GridView>
|
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625