问题描述:
Datagrid有3列.其中前2列为绑定列,后一列为模板列,模板列中加了一个DropDownList.我现在需要实现每一行的DropDownList中的值都是通过该行前2列组合的值查询后的返回结果.
请问怎样实现?

解决方案 »

  1.   

    http://tb.blog.csdn.net/TrackBack.aspx?PostId=673225
      

  2.   

    很简单的模版列里加下拉框,然后<asp:DropDownList id=DropDownList1 runat="server" Width="159px" DataSource='<%#BindDropdownlist(DataBinder.Eval(Container.DataItem,"tid").ToString())%>' SelectedIndex='<%#FindIndex(DataBinder.Eval(Container.DataItem,"tid").ToString(),DataBinder.Eval(Container.DataItem,"cname").ToString())%>'>
    </asp:DropDownList></FONT>其中BindDropdownlist是写在服务器端的函数
      

  3.   

    我觉得应该写在
    ItemDataBound中.
      

  4.   

    在ItemDataBound中,怎样获得绑定列的值?