Thx Jarmo the reply.
But my html looks like the following below and ItemNumber is TEXTBOX!
I don't know why its returning Null then!
Its works with ASP.NET WebMatrix but gives the error with VStudio .Net!!!
<asp
ataGrid id="DataGridDisplay" Width="560px" runat="server"
OnItemCommand="EditRecord"
AutoGenerateColumns="False"
BackColor="#F9F9F9"
HeaderStyle-BackColor="#990000"
HeaderStyle-ForeColor="#FFFFFF"
HeaderStyle-Font-Bold="True"
HeaderStyle-HorizontalAlign="Center"
HeaderStyle-VerticalAlign="Top"
ItemStyle-VerticalAlign="Top"
ItemStyle-HorizontalAlign="Center">
<Columns>
<asp:TemplateColumn>
<HeaderTemplate>
No<br>
<asp:TextBox id="ItemNumber" runat="server"/>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox id="ItemNumber" runat="server"
Text='<%# Container.DataItem("ItemNumber") %>'
ReadOnly="True"/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderTemplate>
Type<br>
<asp
ropDownList id="ItemType" runat="server"
DataSource='<%# ItemTypes %>'/>
</HeaderTemplate>
<ItemTemplate>
<asp
ropDownList id="ItemType" runat="server"
DataSource='<%# ItemTypes %>'
SelectedIndex='<%# SetIndex(Container.DataItem("ItemType")) %>'/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderTemplate>
Supplier<br>
<asp:TextBox id="ItemSupplier" runat="server"/>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox id="ItemSupplier" runat="server"
Text='<%# Container.DataItem("ItemSupplier") %>'/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderTemplate>
Name<br>
<asp:TextBox id="ItemName" runat="server"/>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox id="ItemName" runat="server"
Text='<%# Container.DataItem("ItemName") %>'/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderTemplate>
Description<br>
<asp:TextBox id="ItemDescription" runat="server"
TextMode="MultiLine"
Cols="25"
Rows="2"/>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox id="ItemDescription" runat="server"
Text='<%# Container.DataItem("ItemDescription") %>'
TextMode="MultiLine"
Cols="25"
Rows="2"/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderTemplate>
Price<br>
<asp:TextBox id="ItemPrice" runat="server"
Text="0.00"/>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox id="ItemPrice" runat="server"
Text='<%# FormatNumber(Container.DataItem("ItemPrice"),2) %>'/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderTemplate>
Qty<br>
<asp:TextBox id="ItemQuantity" runat="server"
Text="0"/>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox id="ItemQuantity" runat="server"
Text='<%# Container.DataItem("ItemQuantity") %>'/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderTemplate>
<br>
<asp:Button Text="Add" runat="server"/>
</HeaderTemplate>
<ItemTemplate>
<asp:Button Text="Update" runat="server"/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderTemplate>
<br>
</HeaderTemplate>
<ItemTemplate>
<asp:Button Text="Delete" runat="server"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp
ataGrid>