Google Brother Up

2008/01/10

A Typical GridView

Take the code below and replace ( by < and ) by > in MsWord.

(asp:GridView ID="dgdManageUsers" runat="server" AutoGenerateColumns="False"
AllowPaging="true" PagerStyle-HorizontalAlign="Right" PagerSettings-Mode="Numeric" PagerSettings-PageButtonCount="3"
OnPageIndexChanging="dgdManageUsers_PageIndexChanging" EmptyDataText="No records found" OnRowDeleting="dgdManageUsers_RowDeleting"
OnRowCommand="dgdManageUsers_RowCommand" )

(Columns)
(asp:TemplateField HeaderText="CategoryID" Visible="False")
(ItemTemplate)
(asp:Label ID="lblUserID" runat="server" Text='(%# Eval("UserId")%)' /)
(/ItemTemplate)
(/asp:TemplateField)

(asp:BoundField HeaderText="Full Name" DataField="FullName" /)

(asp:BoundField HeaderText="Email" DataField="Email" /)

(asp:BoundField HeaderText="Registration Date" DataField="RegistrationDate" /)

(asp:TemplateField HeaderText="Edit")
(ItemTemplate)
(asp:Button runat="server" ID="btnEdit" CommandName="Edit" CommandArgument='(%# Eval("UserId")%)' Text="Edit"/)
(/ItemTemplate)
(/asp:TemplateField)

(asp:TemplateField HeaderText="Delete")
(ItemTemplate)
(asp:Button runat="server" ID="btnDelete" CommandName="Delete" CommandArgument='(%# Eval("UserId")%)' Text="Delete"
OnClientClick="JavaScript:return confirm('Are you sure you want to delete ');" /)
(/ItemTemplate)
(/asp:TemplateField)

(asp:TemplateField)
(ItemTemplate)
(asp:TextBox runat="server" ID="txtEditBox" Visible="False" Text='(%# DataBinder.Eval(Container.DataItem,"Email") %)' /)
(/ItemTemplate)
(/asp:TemplateField)
(/Columns)
(PagerSettings PageButtonCount="3" /)
(PagerStyle HorizontalAlign="Right" /)

(/asp:GridView)

No comments:

Drop Down List

1. http://www.janetsystems.co.uk/Articles/NetArticles/tabid/74/itemid/161/modid/449/Default.aspx