Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
364
UltraWebGrid.copy() fails
posted

Hi,

I have been trying to get the copy() function to work for my WebGrid, but it keeps returning false.  Here is my javascript code for capturing the context menu:

function ShowContextMenu(evt){

//Firefox passes event arg as parameter (evt). If that is null, we'll use window.event (Internet Explorer proprietary)

var e=evt?evt:window.event;

 

//Call show menu with menuID

//specify clientX and clientY to get more accurate positioning for this particular layout

igmenu_showMenu("<%=this.muContextMenu.ClientID %>",null,(e.clientX+document.documentElement.scrollLeft)+"px",(e.clientY+document.documentElement.scrollTop)+"px");

 

//Firefox (W3C) - cancel event

if(typeof(e.preventDefault)=="function")e.preventDefault();

//InternetExplorer (Proprietary) - cancel event

e.returnValue=false;

return false;

}

function ContextMenuItemClick(menuid,itemid)

{

//Grab a reference to the ContextMenuItem that was clicked on

var item=igmenu_getItemById(itemid);

var oGrid = igtbl_getGridById("ugContacts");

var nRows = oGrid.Rows.length;

if(item!=null){

//We'll use the text from the menuitem to decide which operation to perform

switch(item.getText()){case "Select All":

oGrid.selectRowRegion(oGrid.Rows.getRow(0), oGrid.Rows.getRow(nRows-1));

break;

case "Copy":

oGrid.copy();

break;

case "Export To Excel":

document.getElementById("wibExport2Excel").click();break;

}

}

}

function ugContacts_MouseUpHandler(gridName, id, button)

{

if(button!=2){

//Because the WebGrid consumes all mouse events, we need to add

//a listener to determine when a mouse click has occured so we can

//close the popup menu appropriately

igmenu_getMenuById("<%= this.muContextMenu.ClientID %>").dismiss();

}

}

The "Select All" and "Export to Excel" functions properly, but the copy returns a false when I capture it's return value. 

I have a WebGrid in a page, it is hierarchical, and I have CellClickActionDefault set to RowSelect.  Here is my UltraWebGrid setup:

<igtbl:UltraWebGrid ID="ugContacts" runat="server" Height="560px" Width="100%"

oninitializelayout="ugContacts_InitializeLayout"

OnDataBinding="ugContacts_DataBinding">

<Bands>

<igtbl:UltraGridBand>

<AddNewRow Visible="NotSet" View="NotSet"></AddNewRow>

</igtbl:UltraGridBand>

</Bands>

<displaylayout allowcolsizingdefault="Free" bordercollapsedefault="Separate"

name="UltraWebGrid1" rowheightdefault="-1px" selecttypecelldefault="Extended"

selecttypecoldefault="Extended" selecttyperowdefault="Extended" version="3.00"

viewtype="Hierarchical" CellPaddingDefault="5" ColWidthDefault="-1px" GridLinesDefault="None"

IndentationDefault="1" RowSelectorsDefault="No"

allowsortingdefault="OnClient" enableclientsiderenumbering="True"

enableinternalrowsmanagement="True" headerclickactiondefault="SortMulti"

sortcasesensitivedefault="False" CellClickActionDefault="RowSelect">

<framestyle backcolor="White" borderstyle="Solid" borderwidth="2px"

font-names="Microsoft Sans Serif" font-size="XX-Small" height="560px"

width="100%">

</framestyle>

<Images ImageDirectory="./ig_res/Default/images/">

<CollapseImage Url="igg_sortAsc.gif" />

<ExpandImage Url="igg_sortDesc.gif" />

</Images>

<RowAlternateStyleDefault Font-Names="Microsoft Sans Serif"

Font-Size="XX-Small" BackColor="#CCCCCC" BorderColor="#0144D0"

BorderStyle="None" BorderWidth="0px">

<Padding Left="3px" />

<BorderDetails ColorLeft="White" ColorTop="White" />

</RowAlternateStyleDefault>

<ClientSideEvents MouseUpHandler="ugContacts_MouseUpHandler" />

<pager>

<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">

<borderdetails colorleft="White" colortop="White" widthleft="1px"

widthtop="1px" />

</PagerStyle>

</pager>

<headerstyledefault backcolor="Silver" borderstyle="Solid" font-names="Microsoft Sans Serif"

font-size="XX-Small" Font-Bold="True">

<borderdetails colorleft="White" colortop="White" widthleft="1px"

widthtop="1px" />

</headerstyledefault>

<rowstyledefault backcolor="White" bordercolor="#0144D0" borderstyle="None"

borderwidth="0px" font-names="Microsoft Sans Serif" font-size="XX-Small">

<padding left="3px" />

<borderdetails colorleft="White" colortop="White" />

</rowstyledefault>

<SelectedRowStyleDefault BackColor="#9FBEEB">

</SelectedRowStyleDefault>

<GroupByBox Hidden="True">

</GroupByBox>

<addnewbox>

<boxstyle backcolor="LightGray" borderstyle="Solid" borderwidth="1px"

Font-Names="Microsoft Sans Serif" Font-Size="XX-Small">

<borderdetails colorleft="White" colortop="White" widthleft="1px"

widthtop="1px" />

</boxstyle>

</addnewbox>

<activationobject bordercolor="" borderwidth="0px" allowactivation="False"

borderstyle="None">

</activationobject>

<AddNewRowDefault>

<RowStyle Font-Names="Microsoft Sans Serif" Font-Size="XX-Small" />

</AddNewRowDefault>

</displaylayout>

</igtbl:UltraWebGrid>

Am I missing something?  Do I have a setting improperly set?  Or is this not possible with hierarchical grids?

I appreciate any assistance.

Mark