I've a RadGrid with EditFormType="WebUserControl" EditMode="PopUp" PopUpSettings-Modal="true".
UserControl initialization is done on the Page_Load event, under (_dataItem != null) condition, and instantiation under (_dataItem is IXPathNavigable) condition (DataSource is an XMLDataSource).
Further initialization of the userControl (some behavior params) is done on the RadGrid_ItemCreated event, when (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.DataItem != null).
The problem is that althougth PopUpSettings are Modal focus goes away of the popup (it doesn't happen on a Modal RadWindow, but only on RadGrid edition Popup)... It'd be a minor drawback (I've noted also that the Popup width is smaller than the declared width, so a 100% width draws a little content outside) but I haven't been able to set focus to the first control inside the UserControl.
May be one way to do that is through the PopUpShowing RadGrid client event, but the event is declared on the RadGrid page and I've not found a way to name a Control inside the UserControl of the Popup.
Moreover, there is an other problem with the modal popup: position isn't preserved between the UserControl postbacks.
As the UserControl does some "on change" computing I use the technique described on mantain focus between postbacks (adapted as mine works inside a UserControl), but of course I've unpplugged this hack when testing proves to avoid any lateral effect.
I've finally set focus on first control, setting its ClientID into the __LASTFOCUS hidden field described on the document mantain focus between postbacks, although focus still goes away to the disabled (cause of Modal mode) controls of the page using the TAB key. But I still don't know how to preserve popup position between postbacks.
There is an other problem also: a mose over disabled controls of the UserControl PopUp cause a javascript error even when code has no javascript event programmed.
UserControl initialization is done on the Page_Load event, under (_dataItem != null) condition, and instantiation under (_dataItem is IXPathNavigable) condition (DataSource is an XMLDataSource).
Further initialization of the userControl (some behavior params) is done on the RadGrid_ItemCreated event, when (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.DataItem != null).
The problem is that althougth PopUpSettings are Modal focus goes away of the popup (it doesn't happen on a Modal RadWindow, but only on RadGrid edition Popup)... It'd be a minor drawback (I've noted also that the Popup width is smaller than the declared width, so a 100% width draws a little content outside) but I haven't been able to set focus to the first control inside the UserControl.
May be one way to do that is through the PopUpShowing RadGrid client event, but the event is declared on the RadGrid page and I've not found a way to name a Control inside the UserControl of the Popup.
Moreover, there is an other problem with the modal popup: position isn't preserved between the UserControl postbacks.
As the UserControl does some "on change" computing I use the technique described on mantain focus between postbacks (adapted as mine works inside a UserControl), but of course I've unpplugged this hack when testing proves to avoid any lateral effect.
I've finally set focus on first control, setting its ClientID into the __LASTFOCUS hidden field described on the document mantain focus between postbacks, although focus still goes away to the disabled (cause of Modal mode) controls of the page using the TAB key. But I still don't know how to preserve popup position between postbacks.
There is an other problem also: a mose over disabled controls of the UserControl PopUp cause a javascript error even when code has no javascript event programmed.