GridView

 <asp:GridView ID="RegGrid" runat="server" Width="100%" AllowPaging="True" AllowSorting="True" RowStyle-HorizontalAlign="Center"
            AutoGenerateColumns="False" AutoGenerateEditButton="True" OnRowCancelingEdit="RegGrid_RowCancelingEdit"
            OnRowEditing="RegGrid_RowEditing"  OnRowDeleting="RegGrid_RowDeleting"
            OnRowUpdating="RegGrid_RowUpdating" OnRowCommand="RegGrid_RowCommand" DataKeyNames="Username"
            OnPageIndexChanging="RegGrid_PageIndexChanging" PageSize="30">
            <RowStyle HorizontalAlign="Center"></RowStyle>
            <Columns>
                <asp:TemplateField HeaderText="Name">
                    <ItemTemplate>
                        <asp:LinkButton ID="NameLinkBtn" Text='<%#Eval("Name")%>' CommandName="Name" CommandArgument='<%#Eval("UserName") %>'
                            runat="server">
                        </asp:LinkButton>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="x" Text='<%#Eval("Name")%>' runat="server"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="User Type">
               <EditItemTemplate>
                <asp:DropDownList ID="UserDrpList" DataSource='<%# PopulateUserDrpList()%>' DataTextField="UserType" DataValueField="UserType" runat="server" SelectedValue='<%#Eval("UserType") %>'>
                </asp:DropDownList>
                <asp:Button ID="Userbtn" Text="Click" runat="server" Visible="false"/>
                </EditItemTemplate>
                 <ItemTemplate><span><%#Eval("UserType")%></span>
                </ItemTemplate>
               
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Country">
                    <EditItemTemplate>
                        <asp:DropDownList ID="Countrygridlist" DataSource='<%# PopulateCountrygridlist() %>' SelectedValue='<%#Eval("Country") %>'
                            DataValueField="Country" DataTextField="Country" runat="server">
                        </asp:DropDownList>
                        <asp:Button ID="Countrybtn" Text="Click" Visible="false" runat="server" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <span>
                            <%#Eval("Country") %>
                        </span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="State">
                    <EditItemTemplate>
                        <asp:DropDownList ID="Stategridlist" DataSource='<%# PopulateStategridlist() %>' SelectedValue='<%#Eval("State") %>'
                            runat="server" DataValueField="State" DataTextField="State">
                        </asp:DropDownList>
                        <asp:Button ID="Statebtn" Text="Click" Visible="false" runat="server" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <span>
                            <%#Eval ("State") %></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Address" HeaderText="Address" />
                <asp:BoundField DataField="Contactno" HeaderText="Contact No" />
                <asp:BoundField DataField="Username" HeaderText="UserName" ReadOnly="true" />
                <%--<asp:ButtonField ButtonType="Link" HeaderText="Username" CommandName="UserName" Text="Username"
                    CausesValidation="false" DataTextField="username" />--%>
            <asp:BoundField DataField="Password" HeaderText="Password" />
                <asp:TemplateField HeaderText="DOB">
               
                    <EditItemTemplate>
                        <asp:DropDownList ID="dobyrddl"  DataSource='<%# ddlYearFill()%>' runat ="server">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dobmonthdll" DataSource='<%# ddlMonthFill()%>' runat ="server">
                        </asp:DropDownList>
                        <asp:DropDownList ID="dobdaydll"  DataSource='<%# ddlDayFill() %>' runat ="server">
                        </asp:DropDownList>
                       
                    </EditItemTemplate>
                    <ItemTemplate>
                        <span>
                            <%#Eval("DOB") %></span>
                    </ItemTemplate>
                   <%-- <HeaderStyle Width="500px" />
                    <ItemStyle Width="500px" />--%>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Gender">
                    <EditItemTemplate>
                        <asp:DropDownList ID="Genderddl" DataSource='<%# PopulateGenderddl() %>' SelectedValue='<%#Eval("Gender")%>'
                            DataValueField="Gender" DataTextField="Gender" runat="server">
                            <%--<asp:ListItem>Male</asp:ListItem>
                    <asp:ListItem>Female</asp:ListItem>--%>
                        </asp:DropDownList>
                        <asp:Button ID="GenBtn" Text="Click" Visible="false" runat="server" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <span>
                            <%#Eval("Gender") %></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Date Of Reg">
                    <EditItemTemplate>
                    <asp:DropDownList ID="RegYrddl" runat="server" DataSource='<%# RegYrddlFill() %>'>
                    </asp:DropDownList>
                    <asp:DropDownList ID="RegMnthddl" runat="server" DataSource='<%# RegMnthddlFill() %>'>
                    </asp:DropDownList>
                    <asp:DropDownList ID="RegDayddl" runat="server" DataSource='<%# RegDayddlFill() %>'>
                    </asp:DropDownList>
                        <%--<asp:TextBox ID="Text1" runat="server"></asp:TextBox>
                        <asp:Calendar ID="DateCalender" runat="server" OnSelectionChanged="DateCalender_OnSelectionChanged">
                        </asp:Calendar>--%>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <span>
                            <%#Eval("DateofReg") %></span>
                    </ItemTemplate>
                   <%-- <HeaderStyle Width="100px" />--%>
                </asp:TemplateField>
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>