I'm trying to adapt the drag and drop grid sample (with pending orders and shipped orders) to my particular situation and am having some difficulty.
I can't the correct syntax for how to reference each grid's clientid since it is in a user control. I'm trying as follows:
uc2_RadGrid1.ClientID
But that is not correct. What is the correct syntax in the javascript below for correctly grabbing a reference to a grid's clientID when it is inside a user control?
Thx!
In my situation, I have each grid in a different user control along with some other items on the screen. My two user controls each have a RadGri1 grid in them, and they are defined in the page as:
and the script block taken from the sample is:
I can't the correct syntax for how to reference each grid's clientid since it is in a user control. I'm trying as follows:
uc2_RadGrid1.ClientID
But that is not correct. What is the correct syntax in the javascript below for correctly grabbing a reference to a grid's clientID when it is inside a user control?
Thx!
In my situation, I have each grid in a different user control along with some other items on the screen. My two user controls each have a RadGri1 grid in them, and they are defined in the page as:
| <%@ Register src="ContactGrid.ascx" tagname="ContactGrid" tagprefix="uc2" %> |
| <%@ Register src="ContactSelected.ascx" tagname="ContactSelected" tagprefix="uc4" %> |
and the script block taken from the sample is:
| <telerik:RadScriptBlock runat="server" ID="scriptBlock"> |
| <script type="text/javascript"> |
| <!-- |
| function onRowDropping(sender, args) |
| { |
| if (sender.get_id() == "<%=uc2_RadGrid1.ClientID %>") |
| { |
| var node = args.get_destinationHtmlElement(); |
| if(!isChildOf('<%=uc4_RadGrid1.ClientID %>', node) && !isChildOf('<%=uc2_RadGrid1.ClientID %>', node) ) |
| { |
| args.set_cancel(true); |
| } |
| } |
| else |
| { |
| var node = args.get_destinationHtmlElement(); |
| if(!isChildOf('trashCan', node)) |
| { |
| args.set_cancel(true); |
| } |
| else |
| { |
| if (confirm("Are you sure you want to delete this selection?")) |
| args.set_destinationHtmlElement($get('trashCan')); |
| else |
| args.set_cancel(true); |
| } |
| } |
| } |
| function isChildOf(parentId, element) |
| { |
| while(element) |
| { |
| if (element.id && element.id.indexOf(parentId) > -1) |
| { |
| return true; |
| } |
| element = element.parentNode; |
| } |
| return false; |
| } |
| --> |
| </script> |
| </telerik:RadScriptBlock> |