Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id" DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None" AllowSorting="True">
- <AlternatingRowStyle BackColor="White" />
- <Columns>
- <asp:CommandField ShowEditButton="True" />
- <asp:TemplateField HeaderText="id" InsertVisible="False" SortExpression="id">
- <EditItemTemplate>
- <asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label>
- </EditItemTemplate>
- <ItemTemplate>
- <asp:Label ID="Label1" runat="server" Text='<%# Bind("id") %>'></asp:Label>
- </ItemTemplate>
- </asp:TemplateField>
- <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
- <asp:BoundField DataField="E-mail" HeaderText="E-mail" SortExpression="E-mail" />
- </Columns>
- <EditRowStyle BackColor="#2461BF" />
- <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
- <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
- <PagerStyle ForeColor="White" HorizontalAlign="Center" BackColor="#2461BF" />
- <RowStyle BackColor="#EFF3FB" />
- <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
- <SortedAscendingCellStyle BackColor="#F5F7FB" />
- <SortedAscendingHeaderStyle BackColor="#6D95E1" />
- <SortedDescendingCellStyle BackColor="#E9EBEF" />
- <SortedDescendingHeaderStyle BackColor="#4870BE" />
- </asp:GridView>
- <asp:SqlDataSource ID="SqlDataSource2" runat="server"
- ConnectionString="<%$ ConnectionStrings:demoConnectionString4 %>"
- SelectCommand="SELECT * FROM [de]"
- UpdateCommand="UPDATE [de] SET [Name]=@Name, [E-mail]=@column1 WHERE [id]=@id">
- <UpdateParameters>
- <asp:Parameter Name="id" Type="Int32" />
- <asp:Parameter Name="Name" Type="String"/>
- <asp:Parameter Name="column1" Type="String"/>
- </UpdateParameters>
- </asp:SqlDataSource>
Add Comment
Please, Sign In to add comment