You have to create a Usercontrol. Let's say you need to have a Text box in your grid. Then just add a text box to your Usercontrol and in HTML view you can edit it as shown below... (Other than a Textbox I have add a CompareValidator to check the data type of the Text box.)
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyUserCont.ascx.cs" Inherits="TestApp_MyUserCont" %>
ID="CompareValidator1" runat="server" Display="Dynamic" Type="Currency" Operator="DataTypeCheck"
ErrorMessage="*" ControlToValidate="txtQty">
In the code Text='<%# Bind("Quantity") %>' take care of Binding data to the Text property of the Textbox. "Quantity" is the Column name of my data table (gridview data source).
Next is to create your Dynamic column as follows...
TemplateField tmpQty = new TemplateField();
tmpQty.HeaderText = "Quantity";
tmpQty.ItemTemplate = LoadTemplate("../TestApp/MyUserCont.ascx");
tmpQty.Visible = true;
gvTransaction.Columns.Add(tmpQty);
Hope this will make things easier than the earlier method. But there are some limitations. So as I mentioned earlier you have to identify which method is suitable according to your requirement.