Add double-click event to the DataGrid unit line

zhaozj2021-02-16  61

9CBS - Document Center - .NET title to DataGrid cell line Add double-click event hbzxf (original) keyword DataGrid

Add Double-Click Event HBZXF (A Hao) now I need to do the function that I need to do when I click on the DataGrid a line, when you double-click this same line, pop up the delete dialog, what should I do? What about it. Since the problem is simple, it is no longer elaborated. Let me talk about how to double-click the event. Here you can use the DataGrid ItemDatabase, we can add the following code to the desired program that you can implement the double click. Detailed source follows: private void DataGrid1_ItemDataBound (object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem ) || (E.Item.SelectedItem)) {E.Item.attributes.add ("OnDBLClick", "JavaScript: Return Confirm ('OK Delete" E.Item.cells [1] .text "? ');");}} Is actually a tip skill

转载请注明原文地址:https://www.9cbs.com/read-18514.html

New Post(0)