DataGrid template column TEXTBOX focus corresponding keyboard event

xiaoxiao2021-03-05  27

First join the template column in DataGrid:

In page_load event: 'Give DataGrid binding data ... dataGrid1.datasource = dst DataGrid1.dataBind () Dim Txt As TextBox Dim i as integer for i = 0 to DataGrid1.items. Count - 1 txt = DataGrid1.items (i) .FindControl ("TextBox1") txt.attributes.add ("onkeyDown", "if (event.keycode == 13) Event.Keycode = 9") Next TextBox's focus is TabIndex joined in the template column, each click Enter, the focus of TextBox changes according to the tab order

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

New Post(0)