I am successfully setting focus in grids that are not Master/Detail using:
and in the ItemDataBound event
My problem is that in a Master/Detail grid the databinding is in grid_DetailTableDataBind and I can't figure out how to get the e.Item values in order to check if it is an EditForm and IsInEditMode in order to set focus.
Any help appreciated, thanks,
Declan
| function focusDelivery(item) { |
| document.getElementById(item).focus(); |
| document.getElementById(item).scrollIntoView(); |
| } |
and in the ItemDataBound event
| If (TypeOf (e.Item) Is GridEditFormItem) AndAlso e.Item.IsInEditMode Then |
| Dim box As TextBox = e.Item.FindControl("ContactName") |
| grdDelivery.ClientSettings.ClientEvents.OnRowCreated = String.Format("focusDelivery('{0}')", box.ClientID) |
| End If |
My problem is that in a Master/Detail grid the databinding is in grid_DetailTableDataBind and I can't figure out how to get the e.Item values in order to check if it is an EditForm and IsInEditMode in order to set focus.
| If (TypeOf (e.Item) Is GridEditFormItem) AndAlso e.Item.IsInEditMode Then |
Any help appreciated, thanks,
Declan