我知道用javascript,那怎么用呢?怎么获取是否有选中?

解决方案 »

  1.   

    你要写在datagrid的 datagrid_ItemDataBound  里面
      

  2.   


    用这人试试
    Checked='<%# DataBinder.Eval(Container.DataItem, "yourbool") %>'
    Sub dgPopularFAQs_ItemDataBound(sender as Object, e as DataGridItemEventArgs)
        If e.Item.ItemType <> ListItemType.Header AND e.Item.ItemType <> ListItemType.Footer then
         Dim deleteButton as LinkButton = e.Item.Cells(0).Controls(0)       deleteButton.Attributes("onclick") = "javascript:return confirm('Are you sure you want to delete FAQ #" & _
                        DataBinder.Eval(e.Item.DataItem, "FAQID") & "?')"    
        End If
      End Sub
      

  3.   

    你要在什么时候弹出提示呢?当用户改变CheckBox的Checked为true的时候? 还是当选择完后,使用一个 Button来执行DEL操作的时候?
      

  4.   

    用户提交的时候,遍历datagird,若有选中的项目,再显示.
      

  5.   

    to lese9:是选择完后使用button来执行confirm。
    ---------------------------------------------------
    在cs文件中怎么取javascript的confirm返回的值。谢谢!
      

  6.   

    先多谢大家的帮助还有,小弟初学,还有好多不懂RowChanged(object sender, System.EventArgs e)
    需要加到InitializeComponent中吗?
    如何从sender中获取checkbox在datagrid的行数??
    我想datagrid中的其它控件响应checkbox!!!
      

  7.   

    kao 贴错了,太没面子了
    麻烦大家看看
    http://expert.csdn.net/Expert/topic/1741/1741892.xml?temp=.1678888