Original: Examples of cell references in Gride (non-typical)

xiaoxiao2021-03-06  42

Today, I want to share a day from DataGride's experience and everyone: 1. The benefits of template: Use the model column to be able to enable our own control, can be converted to the temptation of the VS and convert the column into analog column, at this time You can add it, otherwise it will be wrong; 2. Use the default button column: Use the default button column to facilitate the trigger of the event, whether delete or choose, the process of triggered events can be written by us, According to this: ----------------------------------- -------------------------------------------------- ----------------- Private Sub DataGrid1_ItemCommand (ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand DataGrid1.EditItemIndex = e.Item .Itemindex bin_dd () End Sub

Private Sub DataGrid1_DeleteCommand (ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand Response.Redirect ( "HotelSearchIntl.aspx? Key =" Server.HtmlDecode (e.Item.Cells.Item (1) .Text) .replace ("&", ")) End Sub ------------------------------ -------------------------------------------------- ------------------------------------ The above is not difficult to see, we can run your own in the default event. Procedure 3, reference to cells: --------------------------------------- -------------------------------------------------- ------------------------- Private sub DataGrid1_itemmand (Byval E as system.web.ui.webcontrols.DataGridCommandEventAndargs) Handles DataGrid1. ItemCommand DataGrid1.edititeMindex = E.Item.ItemIndex bin_dd () end SUB

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

New Post(0)