|
Rank: Advanced Member Groups: Member
Joined: 6/9/2007 Posts: 98
|
Hello, I want use a Contextmenu in on a treeview and a grid that are located in dialogbox. When i remove the dialog tag, then works the Contextmenu fine, but it doesnt work in the dialog. Is that a bug or is my code buggie? Thanks for a solution. Philipp Sample Page:
Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Testseite.aspx.cs" Inherits="Testseite" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<script type="text/javascript" language="javascript">
function showSelectDialog() {
// eo_GetObject('dlgBrowseServer').show(true);
return false;
}
function endEditGrid() {
eo_GetObject('gridDialogUploadDateien').editItem(-1,true);
}
function beginEditTree() {
eo_GetObject('treeDialogUploadVerzeichnis').getSelectedNode().beginEdit('');
}
</script>
<body>
<form id="form1" runat="server">
<br />
<eo:Dialog ID="dlgBrowseServer" runat="server" BackColor="White" CloseButtonUrl="00020312"
ControlSkinID="None" HeaderHtml="Dialog Title" Height="420px"
Width="725px" ClientSideOnAccept="setSelectedPath"
ShowButton="cmdDialogImageShow" IsModal="False" InitialState="Visible">
<FooterTemplate>
<button name="acceptDialog" onclick="setSelectedPath();" value="OK">
OK</button>
<button name="closeDialog" onclick="eo_GetObject('dlgBrowseServer').cancel();" value="Schliessen">
Schliessen</button>
</FooterTemplate>
<HeaderStyleActive CssText="background-image:url('00020311');color:black;font-family:'trebuchet ms';font-size:10pt;font-weight:bold;padding-bottom:5px;padding-left:8px;padding-right:3px;padding-top:0px;" />
<BorderImages BottomBorder="00020305" BottomLeftCorner="00020304" BottomRightCorner="00020306"
LeftBorder="00020303" RightBorder="00020307" TopBorder="00020310" TopLeftCorner="00020301"
TopLeftCornerBottom="00020302" TopRightCorner="00020309" TopRightCornerBottom="00020308" />
<FooterStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
<ContentTemplate>
<table style="width: auto;">
<tr>
<td style="width: 220px; vertical-align: top;">
<eo:TreeView ID="treeDialogUploadVerzeichnis" runat="server" ControlSkinID="None" Height="254px" Width="220px"
ClientSideOnItemClick="" RaisesServerEvent="True" AllowEdit="True" OnItemRenamed="treeDialogUploadVerzeichnis_ItemRenamed"
ClientSideOnContextMenu="">
<LookNodes>
<eo:TreeNode CollapsedImageUrl="00030301" DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;color:Gray;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;"
ExpandedImageUrl="00030302" ImageUrl="00030301" ItemID="_Default" NormalStyle-CssText="PADDING-RIGHT: 1px; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; COLOR: black; BORDER-TOP-STYLE: none; PADDING-TOP: 1px; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; BORDER-BOTTOM-STYLE: none"
SelectedStyle-CssText="background-color:#316ac5;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:White;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;">
</eo:TreeNode>
</LookNodes>
<TopGroup Style-CssText="border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:2px;padding-left:2px;padding-right:2px;padding-top:2px;">
</TopGroup>
</eo:TreeView>
</td>
<td style="vertical-align: top;">
<eo:Grid ID="gridDialogUploadDateien" runat="server" BorderColor="#828790"
BorderWidth="1px" ClientSideOnItemSelected="endEditGrid"
ColumnHeaderAscImage="00050204" ColumnHeaderDescImage="00050205" ColumnHeaderDividerImage="00050203"
ColumnHeaderHeight="24" FixedColumnCount="1" Font-Bold="False" Font-Italic="False"
Font-Names="Tahoma" Font-Overline="False" Font-Size="8pt" Font-Strikeout="False"
Font-Underline="False" GridLineColor="240, 240, 240" GridLines="Both" Height="258px"
ItemHeight="16" PageSize="10" Width="480px" ClientSideOnItemCommand="" LoadingHTML="Lade Daten..."
OnItemChanged="gridDialogUploadDateien_ItemChanged">
<FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<ItemStyles>
<eo:GridItemStyleSet>
<ItemStyle CssText="background-color: white" />
<ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" />
<SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" />
<CellStyle CssText="padding-left:8px;padding-top:2px;" />
</eo:GridItemStyleSet>
</ItemStyles>
<ColumnTemplates>
<eo:TextBoxColumn>
<TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
</eo:TextBoxColumn>
<eo:DateTimeColumn>
<DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="FirstLetter"
DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
TitleRightArrowImageUrl="DefaultSubMenuIcon">
<TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
<SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
<CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
<TitleArrowStyle CssText="cursor:hand" />
<DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
<MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
<TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
<OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
<DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
</DatePicker>
</eo:DateTimeColumn>
<eo:MaskedEditColumn>
<MaskedEdit ControlSkinID="None" TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
</MaskedEdit>
</eo:MaskedEditColumn>
</ColumnTemplates>
<ContentPaneStyle CssText="" />
<ColumnHeaderHoverStyle CssText="background-image:url('00050202');padding-left:8px;padding-top:4px;" />
<Columns>
<eo:RowNumberColumn Width="50">
</eo:RowNumberColumn>
<eo:TextBoxColumn AllowSort="True" DataField="File" HeaderText="File" Width="250">
</eo:TextBoxColumn>
<eo:StaticColumn AllowSort="True" DataField="Size" HeaderText="Size" Text="">
</eo:StaticColumn>
<eo:StaticColumn AllowSort="True" DataField="Extension" HeaderText="Extension" Width="80">
</eo:StaticColumn>
</Columns>
<ColumnHeaderStyle CssText="background-image:url('00050201');padding-left:8px;padding-top:4px;" />
</eo:Grid>
</td>
</tr>
<tr>
<td colspan="2">
<eo:ContextMenu ID="contextDialogUploadMenuTree" runat="server" ContextControlID="treeDialogUploadVerzeichnis"
ControlSkinID="None" Width="200px" CheckIconUrl="OfficeCheckIcon" OnItemClick="contextDialogUploadMenuTree_ItemClick"
RaisesServerEvent="True" ClientSideOnItemClick="">
<LookItems>
<eo:MenuItem HoverStyle-CssText="background-color:#c1d2ee;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:0px;"
ItemID="_TopLevelItem" NormalStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:5px;padding-right:5px;padding-top:1px;"
DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:5px;padding-right:5px;padding-top:1px;color:lightgrey"
Height="24" SelectedStyle-CssText="background-color:white;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:0px;">
<SubMenu ItemSpacing="3" Style-CssText="background-color:#fcfcf9;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;"
CollapseEffect-Duration="150" CollapseEffect-Type="Fade" ExpandEffect-Duration="150"
ExpandEffect-Type="Fade" LeftIconCellWidth="25" SideImage="OfficeXPSideBar">
</SubMenu>
</eo:MenuItem>
<eo:MenuItem IsSeparator="True" ItemID="_Separator" NormalStyle-CssText="background-color:#c5c2b8;height:1px;margin-left:30px;width:1px;">
</eo:MenuItem>
<eo:MenuItem HoverStyle-CssText="background-color:#c1d2ee;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:1px;padding-right:4px;padding-top:0px;"
ItemID="_Default" NormalStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:5px;padding-top:1px;"
DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:5px;padding-top:1px;color:lightgrey"
Height="24" SelectedStyle-CssText="background-color:white;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:1px;padding-right:4px;padding-top:0px;"
Text-Padding-Right="30">
<SubMenu ItemSpacing="3" Style-CssText="background-color:#fcfcf9;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;"
CollapseEffect-Duration="150" CollapseEffect-Type="Fade" ExpandEffect-Duration="150"
ExpandEffect-Type="Fade" LeftIconCellWidth="25" SideImage="OfficeXPSideBar">
</SubMenu>
</eo:MenuItem>
</LookItems>
<TopGroup Orientation="Vertical">
<Items>
<eo:MenuItem Text-Html="Neues Verzeichnis" Value="newdir">
</eo:MenuItem>
<eo:MenuItem IsSeparator="True">
</eo:MenuItem>
<eo:MenuItem ItemID="renamedir" RaisesServerEvent="False" Text-Html="Verzeichnis umbenennen"
OnClickScript="eo_GetObject('treeDialogUploadVerzeichnis').getSelectedNode().beginEdit('')">
</eo:MenuItem>
<eo:MenuItem Text-Html="Verzeichnis löschen" Value="removedir">
</eo:MenuItem>
</Items>
</TopGroup>
</eo:ContextMenu>
<eo:ContextMenu ID="contextDialogUploadMenuFiles" runat="server" CheckIconUrl="OfficeCheckIcon"
ContextControlID="gridDialogUploadDateien" ControlSkinID="None" Width="200px"
OnItemClick="contextDialogUploadMenuFiles_ItemClick" RaisesServerEvent="True">
<LookItems>
<eo:MenuItem DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:5px;padding-right:5px;padding-top:1px;color:lightgrey"
Height="24" HoverStyle-CssText="background-color:#c1d2ee;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:0px;"
ItemID="_TopLevelItem" NormalStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:5px;padding-right:5px;padding-top:1px;"
SelectedStyle-CssText="background-color:white;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:0px;">
<SubMenu CollapseEffect-Duration="150" CollapseEffect-Type="Fade" ExpandEffect-Duration="150"
ExpandEffect-Type="Fade" ItemSpacing="3" LeftIconCellWidth="25" SideImage="OfficeXPSideBar"
Style-CssText="background-color:#fcfcf9;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;">
</SubMenu>
</eo:MenuItem>
<eo:MenuItem IsSeparator="True" ItemID="_Separator" NormalStyle-CssText="background-color:#c5c2b8;height:1px;margin-left:30px;width:1px;">
</eo:MenuItem>
<eo:MenuItem DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:5px;padding-top:1px;color:lightgrey"
Height="24" HoverStyle-CssText="background-color:#c1d2ee;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:1px;padding-right:4px;padding-top:0px;"
ItemID="_Default" NormalStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:5px;padding-top:1px;"
SelectedStyle-CssText="background-color:white;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:1px;padding-right:4px;padding-top:0px;"
Text-Padding-Right="30">
<SubMenu CollapseEffect-Duration="150" CollapseEffect-Type="Fade" ExpandEffect-Duration="150"
ExpandEffect-Type="Fade" ItemSpacing="3" LeftIconCellWidth="25" SideImage="OfficeXPSideBar"
Style-CssText="background-color:#fcfcf9;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;">
</SubMenu>
</eo:MenuItem>
</LookItems>
<TopGroup Orientation="Vertical">
<Items>
<eo:MenuItem OnClickScript="eo_GetObject('gridDialogUploadDateien').editItem(eo_GetObject('gridDialogUploadDateien').getSelectedItem().getIndex(),true);"
RaisesServerEvent="False" Text-Html="Datei umbenennen">
</eo:MenuItem>
<eo:MenuItem Text-Html="Datei löschen" Value="removefile">
</eo:MenuItem>
</Items>
</TopGroup>
</eo:ContextMenu>
Neue Datei:<br />
<eo:AJAXUploader ID="uploadDialogUploadFile" runat="server" AutoPostBack="True" FinalFileList=""
ProgressBarSkin="Windows_Vista" ProgressTextFormat="Uploading...{transferred} bytes von {total} bytes ({percentage}%) done."
Width="100%" OnFileUploaded="uploadDialogUploadFile_FileUploaded">
<LayoutTemplate>
<table border="0" cellpadding="2" cellspacing="0" style="width: 100%">
<tr>
<td>
<asp:PlaceHolder ID="InputPlaceHolder" runat="server">Input Box Place Holder </asp:PlaceHolder>
</td>
</tr>
<tr>
<td align="right">
<asp:Button ID="UploadButton" runat="server" Text="Upload" />
<asp:Button ID="CancelButton" runat="server" Text="Cancel" />
</td>
</tr>
<tr>
<td>
<eo:ProgressBar ID="ProgressBar" runat="server" ControlSkinID="Windows_XP" />
</td>
</tr>
<tr>
<td>
<asp:PlaceHolder ID="ProgressTextPlaceHolder" runat="server">Progress Text Place Holder</asp:PlaceHolder>
</td>
</tr>
<tr>
<td align="right">
</td>
</tr>
</table>
</LayoutTemplate>
</eo:AJAXUploader>
<br />
</td>
</tr>
</table>
</ContentTemplate>
<ContentStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
</eo:Dialog>
</form>
</body>
</html>
Code: C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.IO;
public partial class Testseite : System.Web.UI.Page
{
private const string rootpath = "Public\\Demo";
private const string firstdir = "\\Image";
protected void Page_Load(object sender, EventArgs e)
{
uploadDialogUploadFile.TempFileLocation = Server.MapPath(rootpath + "\\Temp");
loadTree(false);
}
private void loadSubDirs(string dir, ref int id, int parent, DataTable table)
{
id++;
if (parent == 0)
{
table.Rows.Add(new Object[] { id, null, Path.GetFileName(dir).ToString() });
}
else
{
table.Rows.Add(new Object[] { id, parent, Path.GetFileName(dir).ToString() });
}
parent = id;
string[] subdirs = Directory.GetDirectories(dir);
foreach (string subdir in subdirs)
{
loadSubDirs(subdir, ref id, parent, table);
}
}
private string getPath(EO.Web.TreeNode e)
{
string path = "";
if (e.ParentNode.Text != null)
{
path = getPath(e.ParentNode);
}
return path + "\\" + e.Text;
}
private void loadFiles(string path)
{
FileInfo oFile;
string script = "<script language=\"JavaScript\">\n" +
"function setSelectedPath() {\n" +
"document.getElementById('eo_editor_insertimage_url').value = '" + path.Replace("\\", "\\\\") + "\\\\' + eo_GetObject('gridDialogUploadDateien').getSelectedItem().getCell(1).getValue(); \n } \n" +
"</script>\n";
// "document.getElementById('Text1').value = document.getElementById('TextBox1').value + '\\' + eo_GetObject('Grid1').getSelectedItem().getCell(1).getValue();";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "setSelectedPath", script);
DataTable table = new DataTable();
table.Columns.Add(new DataColumn("File"));
table.Columns.Add(new DataColumn("Size"));
table.Columns.Add(new DataColumn("Extension"));
foreach (string file in Directory.GetFiles(Server.MapPath(rootpath + path)))
{
oFile = new FileInfo(file);
table.Rows.Add(new Object[] { Path.GetFileName(file), oFile.Length, Path.GetExtension(file) });
}
gridDialogUploadDateien.DataSource = table;
gridDialogUploadDateien.DataBind();
}
protected void callbackpanelEditImage_Execute(object sender, EO.Web.CallbackEventArgs e)
{
string path = getPath(treeDialogUploadVerzeichnis.SelectedNode);
uploadDialogUploadFile.FinalFileLocation = Server.MapPath(rootpath + path);
loadFiles(path);
// dlgBrowseServer.InitialState = EO.Web.DialogState.Visible;
}
private void loadTree(bool force)
{
bool selectRoot = false;
if (treeDialogUploadVerzeichnis.Nodes.Count == 0 | force == true)
{
if (treeDialogUploadVerzeichnis.Nodes.Count == 0) { selectRoot = true; }
treeDialogUploadVerzeichnis.Nodes.Clear();
DataTable table = new DataTable();
table.Columns.Add(new DataColumn("ID"));
table.Columns.Add(new DataColumn("ParentID"));
table.Columns.Add(new DataColumn("Text"));
int id = 0;
loadSubDirs(Server.MapPath(rootpath + firstdir), ref id, 0, table);
DataSet set = new DataSet();
set.Tables.Add(table);
set.Relations.Add(table.Columns[0], table.Columns[1]);
set.Relations[0].Nested = true;
treeDialogUploadVerzeichnis.DataSource = set;
treeDialogUploadVerzeichnis.DataFields = "Text";
treeDialogUploadVerzeichnis.DataBind();
treeDialogUploadVerzeichnis.Nodes[0].Expanded = true;
if (selectRoot == true) { treeDialogUploadVerzeichnis.Nodes[0].Selected = true; }
loadFiles("\\Image");
uploadDialogUploadFile.FinalFileLocation = Server.MapPath(rootpath + firstdir);
}
}
protected void treeDialogUploadVerzeichnis_ItemRenamed(object sender, EO.Web.TreeNodeRenameEventArgs e)
{
if (e.Node.Text != e.OldText)
{
string path = Server.MapPath(rootpath + getPath(treeDialogUploadVerzeichnis.SelectedNode));
if (Directory.Exists(Directory.GetParent(path) + "\\" + e.OldText))
{
Directory.Move(Directory.GetParent(path) + "\\" + e.OldText, path);
}
loadTree(true);
}
}
protected void gridDialogUploadDateien_ItemChanged(object sender, EO.Web.GridItemEventArgs e)
{
}
protected void uploadDialogUploadFile_FileUploaded(object sender, EventArgs e)
{
loadFiles(getPath(treeDialogUploadVerzeichnis.SelectedNode));
}
protected void contextDialogUploadMenuFiles_ItemClick(object sender, EO.Web.NavigationItemEventArgs e)
{
if (e.MenuItem.Value == "removefile")
{
if (gridDialogUploadDateien.SelectedItemIndex != -1)
{
string path = Server.MapPath(rootpath + getPath(treeDialogUploadVerzeichnis.SelectedNode));
string file = gridDialogUploadDateien.Items[gridDialogUploadDateien.SelectedItemIndex].Cells[1].Value.ToString();
if (path != "" && file != "")
{
File.Delete(path + "\\" + file);
}
loadFiles(getPath(treeDialogUploadVerzeichnis.SelectedNode));
}
}
}
protected void contextDialogUploadMenuTree_ItemClick(object sender, EO.Web.NavigationItemEventArgs e)
{
string path = Server.MapPath(rootpath + getPath(treeDialogUploadVerzeichnis.SelectedNode));
if (e.MenuItem.Value == "newdir")
{
int i = 0;
string newDirName = "\\Neuer Ordner";
while (Directory.Exists(path + newDirName) == true)
{
i++;
newDirName = "\\Neuer Ordner " + i.ToString();
}
Directory.CreateDirectory(path + newDirName);
string pathvar = treeDialogUploadVerzeichnis.SelectedNode.Path;
loadTree(true);
treeDialogUploadVerzeichnis.FindItem(pathvar).Selected = true;
treeDialogUploadVerzeichnis.SelectedNode.ExpandPath();
}
if (e.MenuItem.Value == "removedir")
{
Directory.Delete(path, true);
string pathvar = treeDialogUploadVerzeichnis.SelectedNode.ParentNode.Path;
loadTree(true);
treeDialogUploadVerzeichnis.FindItem(pathvar).Selected = true;
treeDialogUploadVerzeichnis.SelectedNode.ExpandPath();
// treeDialogUploadVerzeichnis.SelectedNode.ParentNode.Expanded = false;
}
}
}
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, Try the following: 1. Clear the context menu's ContextControlID property; 2. Add the following JavaScript code into the page:
Code: JavaScript
function show_contextmenu(e)
{
eo_ShowContextMenu(e, "ContextMenu1");
}
3. Set the TreeView's ClientSideOnContextMenu to "show_contextmenu"; That should work. Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 6/9/2007 Posts: 98
|
Hi, Your solution works only for the treeview component. In the grid does your solution not works. I have create a testpage for you. So you can test the issue.
Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Testseite.aspx.cs" Inherits="Testseite" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function show_contextmenu(e)
{
eo_ShowContextMenu(e, "ContextMenu1");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="cmdDialogLinkShow" runat="server" Text="Button" />
<br />
<br />
<eo:Dialog ID="Dialog1" runat="server" AllowResize="True"
CloseButtonUrl="00020440" ContentHtml="" ControlSkinID="None"
HeaderHtml="<div style="padding-top:5px">Dialog Title</div>"
HeaderImageHeight="27" HeaderImageUrl="00020441" Height="216px" MinHeight="100"
MinWidth="150" Width="320px" ShowButton="cmdDialogLinkShow">
<HeaderStyleActive CssText="background-image:url(00020442);color:#444444;font-family:'trebuchet ms';font-size:10pt;font-weight:bold;padding-bottom:7px;padding-left:8px;padding-right:0px;padding-top:0px;" />
<BorderImages BottomBorder="00020409,00020429"
BottomLeftCorner="00020408,00020428" BottomRightCorner="00020410,00020430"
LeftBorder="00020406,00020426" RightBorder="00020407,00020427"
TopBorder="00020402,00020422" TopLeftCorner="00020401,00020421"
TopLeftCornerBottom="00020404,00020424" TopRightCorner="00020403,00020423"
TopRightCornerBottom="00020405,00020425" />
<FooterStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
<ContentTemplate>
<eo:Grid ID="Grid1" runat="server" BorderColor="#C7D1DF" BorderWidth="1px"
ColumnHeaderAscImage="00050303" ColumnHeaderDescImage="00050304"
ColumnHeaderDividerImage="00050302" FixedColumnCount="1" Font-Bold="False"
Font-Italic="False" Font-Names="Verdana" Font-Overline="False" Font-Size="9pt"
Font-Strikeout="False" Font-Underline="False" GridLineColor="199, 209, 223"
GridLines="Both" Height="200px" ItemHeight="19" Width="380px"
ClientSideOnContextMenu="show_contextmenu">
<FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<ItemStyles>
<eo:GridItemStyleSet>
<ItemStyle CssText="background-color: white" />
<ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" />
<SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" />
<CellStyle CssText="padding-left:8px;padding-top:2px; color:#336699;" />
</eo:GridItemStyleSet>
</ItemStyles>
<ColumnTemplates>
<eo:TextBoxColumn>
<TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
</eo:TextBoxColumn>
<eo:DateTimeColumn>
<DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19"
DayHeaderFormat="FirstLetter" DisabledDates="" OtherMonthDayVisible="True"
SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
TitleRightArrowImageUrl="DefaultSubMenuIcon">
<TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
<SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
<CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
<TitleArrowStyle CssText="cursor:hand" />
<DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
<MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
<TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
<OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
<DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
</DatePicker>
</eo:DateTimeColumn>
<eo:MaskedEditColumn>
<MaskedEdit ControlSkinID="None"
TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
</MaskedEdit>
</eo:MaskedEditColumn>
</ColumnTemplates>
<Columns>
<eo:RowNumberColumn>
</eo:RowNumberColumn>
<eo:StaticColumn HeaderText="Header" Text="Cell">
</eo:StaticColumn>
<eo:StaticColumn HeaderText="Header" Text="Cell">
</eo:StaticColumn>
</Columns>
<ColumnHeaderStyle CssText="background-image:url('00050301');padding-left:8px;padding-top:2px;font-weight: bold;color:white;" />
</eo:Grid>
<br />
<eo:ContextMenu ID="ContextMenu1" runat="server" CheckIconUrl="OfficeCheckIcon"
ControlSkinID="None" Width="200px">
<LookItems>
<eo:MenuItem DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:5px;padding-right:5px;padding-top:1px;color:lightgrey"
Height="24"
HoverStyle-CssText="background-color:#c1d2ee;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:0px;"
ItemID="_TopLevelItem"
NormalStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:5px;padding-right:5px;padding-top:1px;"
SelectedStyle-CssText="background-color:white;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:0px;">
<SubMenu CollapseEffect-Type="GlideTopToBottom"
ExpandEffect-Type="GlideTopToBottom" ItemSpacing="3" LeftIconCellWidth="25"
SideImage="Office2003SideBar"
Style-CssText="background-color:#fcfcf9;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;">
</SubMenu>
</eo:MenuItem>
<eo:MenuItem IsSeparator="True" ItemID="_Separator"
NormalStyle-CssText="background-color:#c5c2b8;height:1px;margin-left:30px;width:1px;">
</eo:MenuItem>
<eo:MenuItem DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:5px;padding-top:1px;color:lightgrey"
Height="24"
HoverStyle-CssText="background-color:#c1d2ee;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:1px;padding-right:4px;padding-top:0px;"
ItemID="_Default"
NormalStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:5px;padding-top:1px;"
SelectedStyle-CssText="background-color:white;border-bottom-color:#316ac5;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#316ac5;border-left-style:solid;border-left-width:1px;border-right-color:#316ac5;border-right-style:solid;border-right-width:1px;border-top-color:#316ac5;border-top-style:solid;border-top-width:1px;padding-left:1px;padding-right:4px;padding-top:0px;"
Text-Padding-Right="30">
<SubMenu CollapseEffect-Type="GlideTopToBottom"
ExpandEffect-Type="GlideTopToBottom" ItemSpacing="3" LeftIconCellWidth="25"
SideImage="Office2003SideBar"
Style-CssText="background-color:#fcfcf9;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#999999;border-left-style:solid;border-left-width:1px;border-right-color:#999999;border-right-style:solid;border-right-width:1px;border-top-color:#999999;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;">
</SubMenu>
</eo:MenuItem>
</LookItems>
<TopGroup>
<Items>
<eo:MenuItem Text-Html="Format">
<SubMenu>
<Items>
<eo:MenuItem Text-Html="Styles...">
</eo:MenuItem>
<eo:MenuItem IsSeparator="True">
</eo:MenuItem>
<eo:MenuItem LeftIcon-Url="00000101" Text-Html="Foreground Color...">
</eo:MenuItem>
<eo:MenuItem LeftIcon-Url="00000100" Text-Html="Background Color...">
</eo:MenuItem>
<eo:MenuItem IsSeparator="True">
</eo:MenuItem>
<eo:MenuItem Text-Html="Font">
<SubMenu ItemSpacing="3">
<Items>
<eo:MenuItem Checked="True" Text-Html="Bold">
</eo:MenuItem>
<eo:MenuItem Text-Html="Italic">
</eo:MenuItem>
<eo:MenuItem Text-Html="Underline">
</eo:MenuItem>
</Items>
</SubMenu>
</eo:MenuItem>
<eo:MenuItem IsSeparator="True">
</eo:MenuItem>
<eo:MenuItem Text-Html="Horizontal Spacing">
</eo:MenuItem>
<eo:MenuItem Text-Html="Vertical Spacing">
</eo:MenuItem>
<eo:MenuItem IsSeparator="True">
</eo:MenuItem>
<eo:MenuItem Text-Html="Order">
</eo:MenuItem>
</Items>
</SubMenu>
</eo:MenuItem>
<eo:MenuItem Text-Html="Layout">
<SubMenu>
<Items>
<eo:MenuItem Text-Html="More Items">
</eo:MenuItem>
</Items>
</SubMenu>
</eo:MenuItem>
</Items>
</TopGroup>
</eo:ContextMenu>
</ContentTemplate>
<ContentStyleActive CssText="background-color:#f0f0f0;font-family:tahoma;font-size:8pt;padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px" />
</eo:Dialog>
<br />
</form>
</body>
</html>
Code: C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.IO;
public partial class Testseite : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataTable table = new DataTable();
table.Columns.Add("Test");
table.Columns.Add("Test2");
table.Rows.Add(new Object[] { "X1", "X2" });
table.Rows.Add(new Object[] { "X2", "X3" });
table.Rows.Add(new Object[] { "X3", "X4" });
table.Rows.Add(new Object[] { "X4", "X5" });
table.Rows.Add(new Object[] { "X5", "X6" });
Grid1.DataSource = table;
Grid1.DataBind();
}
}
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
That appears to be a bug. ClientSideOnContextMenu works for Grid only if FullRowMode is set to False (The default value is True). We will get that fixed as soon as possible.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 6/9/2007 Posts: 98
|
Hi,
Habe you a timeline when you have fixed this problem?
Thanks Philipp
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Yes. We are making a build today and that should take care of it.
|
|
Rank: Advanced Member Groups: Member
Joined: 6/9/2007 Posts: 98
|
OK,
Thanks for your answer
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
We've posted the new build. Please check your private message for download location.
Thanks!
|
|