天啊,可以正常浏览,<ItemTemplate>是正确的,但点击编辑按钮时(<EditItemTemplate>),却发生了下面这个错误,救命啊,急啊!!!!!!!!!
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误: 
行 45:  public  int GetPriceIndex(string PriceName)
行 46:  {
行 47:  if (PriceIndex[PriceName] != null)
行 48:  return (int)PriceIndex[PriceName];
行 49:  else
 源文件: c:\wk\webapplicationcsharp\webform1.aspx.cs    行: 47 ASPX文件<asp:TemplateColumn HeaderText="金额单位">
<ItemTemplate>

<asp:DropDownList id="Dropdownlist2" runat="server" SelectedIndex='<%# GetPriceIndex(DataBinder.Eval(Container.DataItem, "price_type").ToString()) %>'>
<asp:ListItem Value="0">人民币</asp:ListItem>
<asp:ListItem Value="1">美元</asp:ListItem>
<asp:ListItem Value="2">港币</asp:ListItem>
</asp:DropDownList> </FONT>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList id="Dropdownlist1" runat="server" SelectedIndex='<%# GetPriceIndex(DataBinder.Eval(Container.DataItem, "price_type").ToString()) %>'>
<asp:ListItem Value="0">人民币</asp:ListItem>
<asp:ListItem Value="1">美元</asp:ListItem>
<asp:ListItem Value="2">港币</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>CS文件:public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;
public Hashtable PriceIndex;

private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面

if (!IsPostBack)
{ PriceIndex = new Hashtable();
PriceIndex["0"] = 0;
PriceIndex["1"] = 1;
PriceIndex["2"] = 2;
BindGridToSource();


}

}
public  int GetPriceIndex(string PriceName)
{
if (PriceIndex[PriceName] != null)
return (int)PriceIndex[PriceName];
else
return 0;
}