Telerik Forums
UI for WinForms Forum
1 answer
241 views
Hi Telerik Team ,
How to remove/ hide the close button from the rad message box control?
Thanks in advance
Ivan Petrov
Telerik team
 answered on 20 May 2011
2 answers
101 views
This question must be one of the top FAQ.  But I cannot find a concise, clear answer.  Let me try for a concise, clear question.

Given a "Lookup" table:

Code  Direction
1        South
2        East
3        North
4        West

And a "Main" table:

Name Vehicle Code
Bert    Truck1  1
Mac    Truck2  4

How do I make the RadGrid display as follows?  My RadGrid is readonly so no pulldowns are necessary on the third column.

Bert Truck1 South
Mac Truck2 West

I'm using OpenAccess ORM so my tables are in POCOs Lookup and Main.

Does the third column have to be a ComboBox column?  Or do I use CellFormatting event?  If I use a combobox column how do I set the three parameters (Main.Code, Lookup.Code and Lookup.Direction)?

Regards,
Guy


Ivan Petrov
Telerik team
 answered on 20 May 2011
13 answers
331 views
Hi,
 is there a way to print a RadGridView grid? The only solution i've found yet is to export the grid to excel, and then print it.

thx,
 Levi
Martin Vasilev
Telerik team
 answered on 20 May 2011
2 answers
101 views
If a sort is saved as part of a layout it is not honored when the layout is loaded. The column header has the sort indicator (black triangle indicating ascending/descending), but the data appears in the order of the underlying data source, not the order specified in the layout.

If I click on the column header the data is sorted, but the sort added as part of the layout definition is ignored. It almost seems as though there is some sort of "apply" method that needs to be called.

I believe that this worked in 2010Q1, but is broken in 2011Q1.
Martin Vasilev
Telerik team
 answered on 20 May 2011
2 answers
126 views
I am having an issue and am on the very latest version of the controls where CommandBarTextBox elements placed in CommandBars do not fire the LostFocus events.

The following used to work, but since the last upgrade does not fire.

cbTextBox.TextBoxElement.TextBoxItem.LostFocus += new EventHandler(TextBoxItem_LostFocus);

I have also tried the code below, but again nothing happens.

cbTextBox.LostFocus +=new EventHandler(TextBoxItem_LostFocus);

I could use the TextChanged event, but for filtering large datasets I do not want to filter for every keystroke, only when focus is changed.

These are being hooked in the constructor so the events should be firing.

Any ideas?
Ivan Todorov
Telerik team
 answered on 20 May 2011
1 answer
88 views
On upgrading the Winforms controls from Q3_2010 release to Q1_2011(just by changing the references), i have broke the aspect of all my forms where i had a TableLayoutPanel hosting RadDropdownList controls on rows with autosize (the height of the RadDropDownList controls has increased by 4 pixels) .

Can you advice a solution or explain me what change in RadDropDownList cause this?
Peter
Telerik team
 answered on 20 May 2011
4 answers
172 views
Hi,

when I'm writing in the dropdownlist the dropdown is automatically dropping down. That's great. But when I try to leave the dropdownlist by tabbing whilst the dropdown still is dropped down, the dropdown won't close...

Am I missing something?

Best regards
Anders
Peter
Telerik team
 answered on 20 May 2011
3 answers
93 views
Hi,

When filtering is on, an exception is thrown when you press the single quote key (or apostrophe). I guess it's an expression injection problem or something like that.

Any solution ?

Thanks
Jack
Telerik team
 answered on 20 May 2011
1 answer
153 views
Hi All,

I have a Grid bound to a Dictionary<> in C# (Actually bound to Dictionary.Values).  I am doing this because I am editing the values of the grid pretty often and have a large data set, so using the dictionary allows me to find the exact element I am trying to change without looping through the entire collection. 

This is working pretty well.  I realize that a Dictionary doesn't provide notification when the collection is changed, so to show changes in the Grid I call the following 2 lines of code when I change any Dictionary element:
grid.TableElement.Update(GridUINotifyAction.DataChanged);
grid.TableElement.Update(GridUINotifyAction.StateChanged);

This shows all updates!  Horray!  However, it does not resort the grid correctly.  So, if one of the fields that is being sorted changes, the rows do not move accordingly.  I was hoping that I could determine when I might need to resort and call a "Resort()" type method, but it seems like I can't.

How can I get the Grid to resort in this scenario?

Thanks All!
Emanuel Varga
Top achievements
Rank 1
 answered on 20 May 2011
1 answer
109 views
Hi,

I have a rad dropdownbutton element in ribbonbar for that dropdown i want to create templates .

This i had done using janus same functionality shld be done using telerik i am posting the janus code can anyone see it and please explain me how to do in telerik what r the proerties used.

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.WordReportTemplates);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.SerialDocumentTemplates);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.ObjectDocumentTemplates);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.NewDocumentTemplates);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.ProtocolTemplates);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.InvitationTemplates);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.ProjectOverviewTemplates);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.TaskOverviewTemplates);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.TaskListTemplate);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.QueryFolderTemplate);

 

 

PopulateWordReportFiles(

 

Enums.WordTemplateFileTypes.LinkFolderTemplate);

 

 

#region

 

 

"menus for templates"

 

 

 

 

 

private void PopulateWordReportFiles(Enums.WordTemplateFileTypes e)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

foreach (Janus.Windows.Ribbon.ButtonCommand cmd in rbgddReports_WordReports.Commands)

 

 

{

 

 

 

 

if (e == Enums.WordTemplateFileTypes.WordReportTemplates)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowWordReport);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.SerialDocumentTemplates)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowMailMerge);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.ObjectDocumentTemplates)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowObjectTemplate);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.NewDocumentTemplates)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowNewDocument);

 

 

}

 

}

 

 

 

 

string sReportsPath = "";

 

 

 

 

 

if (e == Enums.WordTemplateFileTypes.WordReportTemplates)

 

 

{

 

rbgddReports_WordReports.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.WordReportsTemplatesFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.SerialDocumentTemplates)

 

 

{

 

rbgddReports_SerialDocuments.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.SeriallettersFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.ObjectDocumentTemplates)

 

 

{

 

rbgddReports_ObjectDocuments.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.ObjectTemplateFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.NewDocumentTemplates)

 

 

{

 

rbgddReports_NewDocument.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.NewDocumentTemplateFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.ProtocolTemplates)

 

 

{

 

 

 

 

foreach (Janus.Windows.Ribbon.ButtonCommand cmd in rbDDReports_Doc_CreateProtocol.Commands)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowProtocolTemplate);

 

 

}

 

rbDDReports_Doc_CreateProtocol.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.ProtocolTemplatesFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.TaskListTemplate)

 

 

{

 

 

 

 

foreach (Janus.Windows.Ribbon.ButtonCommand cmd in rbDDReports_Doc_CreateTaskList.Commands)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowTaskListTemplate);

 

 

}

 

rbDDReports_Doc_CreateTaskList.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.TaskListTemplateFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.InvitationTemplates)

 

 

{

 

 

 

 

foreach (Janus.Windows.Ribbon.ButtonCommand cmd in rbDDReports_Doc_CreateInvitation.Commands)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowInvitationTemplate);

 

 

}

 

rbDDReports_Doc_CreateInvitation.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.InvitationTemplatesFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.ProjectOverviewTemplates)

 

 

{

 

 

 

 

foreach (Janus.Windows.Ribbon.ButtonCommand cmd in rbDDReports_Doc_ProjectOverview.Commands)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowProjectOverviewTemplate);

 

 

}

 

rbDDReports_Doc_ProjectOverview.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.ProjectOverviewTemplateFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.TaskOverviewTemplates)

 

 

{

 

 

 

 

foreach (Janus.Windows.Ribbon.ButtonCommand cmd in rbDDReports_Doc_TaskOverview.Commands)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowProjectOverviewTemplate);

 

 

}

 

rbDDReports_Doc_TaskOverview.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.TaskOverviewTemplateFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.QueryFolderTemplate)

 

 

{

 

 

 

 

foreach (Janus.Windows.Ribbon.ButtonCommand cmd in rbDDReports_Doc_QueryFolder.Commands)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowQueryFolderTemplate);

 

 

}

 

rbDDReports_Doc_QueryFolder.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.QueryFolderTemplateFolderPath;

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.LinkFolderTemplate)

 

 

{

 

 

 

 

foreach (Janus.Windows.Ribbon.ButtonCommand cmd in rbDDReports_Doc_LinkFolder.Commands)

 

 

{

 

cmd.Click -=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowQueryFolderTemplate);

 

 

}

 

rbDDReports_Doc_LinkFolder.Commands.Clear();

 

sReportsPath =

 

 

MosaiqueSettings.LinkFolderTemplateFolderPath;

 

 

}

 

 

 

 

if (sReportsPath == "")

 

 

{

 

 

 

 

//word reports template path is not configured.

 

 

 

 

 

 

 

 

 

 

 

return;

 

 

}

 

 

 

 

if (System.IO.Directory.Exists(sReportsPath) == false)

 

 

{

 

 

 

 

//word reports template path is not accessible.

 

 

 

 

 

 

 

 

 

 

 

return;

 

 

}

 

 

 

 

string sLanguageCode = clsObj.fnGetLangaugeCode(Common.iLanguageId);

 

 

 

 

 

if (sLanguageCode != "")

 

 

{

 

 

 

 

if (sReportsPath.Substring(sReportsPath.Length - 2, 1) != @"\")

 

 

sReportsPath +=

 

 

@"\";

 

 

sReportsPath += sLanguageCode;

 

 

 

 

if (System.IO.Directory.Exists(sReportsPath))

 

 

{

 

 

 

 

//directory exists.

 

 

 

 

 

 

 

 

 

 

 

DirectoryInfo di = new DirectoryInfo(sReportsPath);

 

 

 

 

 

if (e == Enums.WordTemplateFileTypes.WordReportTemplates)

 

 

{

 

GetWordFiles(di, rbgddReports_WordReports,

 

 

Enums.WordTemplateFileTypes.WordReportTemplates);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.SerialDocumentTemplates)

 

 

{

 

GetWordFiles(di, rbgddReports_SerialDocuments,

 

 

Enums.WordTemplateFileTypes.SerialDocumentTemplates);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.ObjectDocumentTemplates)

 

 

{

 

GetWordFiles(di, rbgddReports_ObjectDocuments,

 

 

Enums.WordTemplateFileTypes.ObjectDocumentTemplates);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.NewDocumentTemplates)

 

 

{

 

GetWordFiles(di, rbgddReports_NewDocument,

 

 

Enums.WordTemplateFileTypes.NewDocumentTemplates);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.ProtocolTemplates)

 

 

{

 

GetWordFiles(di, rbDDReports_Doc_CreateProtocol,

 

 

Enums.WordTemplateFileTypes.ProtocolTemplates);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.InvitationTemplates)

 

 

{

 

GetWordFiles(di, rbDDReports_Doc_CreateInvitation,

 

 

Enums.WordTemplateFileTypes.InvitationTemplates);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.ProjectOverviewTemplates)

 

 

{

 

GetWordFiles(di, rbDDReports_Doc_ProjectOverview,

 

 

Enums.WordTemplateFileTypes.ProjectOverviewTemplates);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.TaskOverviewTemplates)

 

 

{

 

GetWordFiles(di, rbDDReports_Doc_TaskOverview,

 

 

Enums.WordTemplateFileTypes.TaskOverviewTemplates);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.TaskListTemplate)

 

 

{

 

GetWordFiles(di, rbDDReports_Doc_CreateTaskList,

 

 

Enums.WordTemplateFileTypes.TaskListTemplate);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.QueryFolderTemplate)

 

 

{

 

GetWordFiles(di, rbDDReports_Doc_QueryFolder,

 

 

Enums.WordTemplateFileTypes.QueryFolderTemplate);

 

 

}

 

 

 

 

else if (e == Enums.WordTemplateFileTypes.LinkFolderTemplate)

 

 

{

 

GetWordFiles(di, rbDDReports_Doc_LinkFolder,

 

 

Enums.WordTemplateFileTypes.LinkFolderTemplate);

 

 

}

 

}

 

}

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private void GetWordFiles(DirectoryInfo di, Janus.Windows.Ribbon.DropDownCommand rbgdd, Enums.WordTemplateFileTypes enm)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

foreach (DirectoryInfo diChild in di.GetDirectories())

 

 

{

 

 

 

 

// add menu item to represent directory which can have children.

 

 

 

 

 

 

 

 

Janus.Windows.Ribbon.

 

 

DropDownCommand cmdDir = new Janus.Windows.Ribbon.DropDownCommand();

 

 

cmdDir.Text = diChild.Name;

 

cmdDir.ImageKey = ((

 

 

int)Enums.Icons.Objects_DataFolder_Documents).ToString();

 

 

rbgdd.Commands.Add(cmdDir);

 

GetWordFiles(diChild, cmdDir, enm);

 

 

 

 

if (cmdDir.Commands.Count == 0)

 

 

cmdDir.Enabled =

 

 

false;

 

 

}

 

 

 

 

foreach (FileInfo fi in di.GetFiles())

 

 

{

 

 

 

 

if ((File.GetAttributes(fi.FullName) & FileAttributes.Hidden) != FileAttributes.Hidden)

 

 

{

 

 

 

 

string sExtension = fi.Extension;

 

 

 

 

 

if (fi.Extension == ".dot" || fi.Extension == ".dotx" || fi.Extension == ".dotm")

 

 

{

 

 

 

 

if (sExtension == ".dot")

 

 

{

 

sExtension =

 

 

".doc";

 

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

sExtension =

 

 

".docx";

 

 

}

 

Janus.Windows.Ribbon.

 

 

ButtonCommand cmd = null;

 

 

 

 

 

string sCommandTitle = fi.Name;

 

 

sCommandTitle = sCommandTitle.Substring(0, fi.Name.Length - (fi.Extension.Length));

 

cmd =

 

 

new Janus.Windows.Ribbon.ButtonCommand("", sCommandTitle);

 

 

cmd.Key = fi.FullName;

 

 

 

 

//cmd.ImageKey = ((int)Enums.Icons.ribbon_Start_IDFix_NewWordFile).ToString();

 

 

 

 

 

 

 

 

 

 

 

Bitmap bm = Common.GetFileImageFromExtension(sExtension);

 

 

 

 

 

if (bm != null)

 

 

{ cmd.Image = bm; }

 

 

 

 

 

 

if (enm == Enums.WordTemplateFileTypes.WordReportTemplates)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowWordReport);

 

 

}

 

 

 

 

else if (enm == Enums.WordTemplateFileTypes.ObjectDocumentTemplates)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowObjectTemplate);

 

 

}

 

 

 

 

else if (enm == Enums.WordTemplateFileTypes.SerialDocumentTemplates)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowMailMerge);

 

 

}

 

 

 

 

else if (enm == Enums.WordTemplateFileTypes.NewDocumentTemplates)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowNewDocument);

 

 

}

 

 

 

 

else if (enm == Enums.WordTemplateFileTypes.ProtocolTemplates)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowProtocolTemplate);

 

 

}

 

 

 

 

else if (enm == Enums.WordTemplateFileTypes.InvitationTemplates)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowInvitationTemplate);

 

 

}

 

 

 

 

else if (enm == Enums.WordTemplateFileTypes.ProjectOverviewTemplates)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowProjectOverviewTemplate);

 

 

}

 

 

 

 

else if (enm == Enums.WordTemplateFileTypes.TaskOverviewTemplates)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowProjectOverviewTemplate);

 

 

}

 

 

 

 

else if (enm == Enums.WordTemplateFileTypes.TaskListTemplate)

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowTaskListTemplate);

 

 

}

 

 

 

 

else if ((enm == Enums.WordTemplateFileTypes.QueryFolderTemplate) ||

 

 

(enm ==

 

 

Enums.WordTemplateFileTypes.LinkFolderTemplate))

 

 

{

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowQueryFolderTemplate);

 

 

}

 

rbgdd.Commands.Add(cmd);

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

 

 

 

if (enm == Enums.WordTemplateFileTypes.NewDocumentTemplates)

 

 

{

 

Janus.Windows.Ribbon.

 

 

ButtonCommand cmd = null;

 

 

 

 

 

string sCommandTitle = fi.Name;

 

 

sCommandTitle = sCommandTitle.Substring(0, fi.Name.Length - (fi.Extension.Length));

 

cmd =

 

 

new Janus.Windows.Ribbon.ButtonCommand("", sCommandTitle);

 

 

cmd.Key = fi.FullName;

 

 

 

 

if (sExtension.ToLower() == ".xlt")

 

 

{

 

sExtension =

 

 

".xls";

 

 

}

 

 

 

 

else if (sExtension == ".xltx" || sExtension == ".xltm")

 

 

{

 

sExtension =

 

 

".xlsx";

 

 

}

 

 

 

 

Bitmap bm = Common.GetFileImageFromExtension(sExtension);

 

 

 

 

 

if (bm != null)

 

 

{ cmd.Image = bm; }

 

cmd.Click +=

 

 

new Janus.Windows.Ribbon.CommandEventHandler(this.ShowNewDocument);

 

 

rbgdd.Commands.Add(cmd);

 

}

 

}

 

}

 

}

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private void ShowWordReport(object sender, Janus.Windows.Ribbon.CommandEventArgs e)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

Common.ShowWordReport(e.Command.Key, false, "", 0, 0, Common.iUserID);

 

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

 

 

private void CallNewWordTemplate(string strPath)

 

 

{

 

 

 

 

this.Cursor = Cursors.WaitCursor;

 

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

int iObjectId = int.Parse(grdTreeObjects.CurrentRow.Cells["ID"].Value.ToString());

 

 

 

 

 

Enums.MosaiqueObjects objType = Enums.MosaiqueObjects.Meeting;

 

 

 

 

 

Control ctl = uiPanRightContainer.Controls[0];

 

 

 

 

 

if (ctl.GetType() == typeof(ctlAgendaItems))

 

 

{

 

objType =

 

 

Enums.MosaiqueObjects.AgendaItem;

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlTasks))

 

 

{

 

 

 

 

if ((Common.grdCurrentRow != null) && (Common.grdCurrentRow.GridEX == grdTreeObjects) &&

 

 

(grdTreeObjects.CurrentRow.Cells[

 

 

"ViewRight"].Value.ToString() == "1") &&

 

 

(grdTreeObjects.CurrentRow.Cells[

 

 

"Tag"].Value.ToString() == ((int)Enums.ObjectNodes.DataFolder_Projects_Project).ToString()))

 

 

{

 

objType =

 

 

Enums.MosaiqueObjects.Project;

 

 

}

 

 

 

 

else if ((Common.grdCurrentRow != null) && (Common.grdCurrentRow.GridEX == grdTreeObjects) &&

 

 

(grdTreeObjects.CurrentRow.Cells[

 

 

"ViewRight"].Value.ToString() == "1") &&

 

 

(grdTreeObjects.CurrentRow.Cells[

 

 

"Tag"].Value.ToString() == ((int)Enums.ObjectNodes.DataFolder_Tasks_Task).ToString()))

 

 

{

 

objType =

 

 

Enums.MosaiqueObjects.Task;

 

 

}

 

}

 

 

 

 

FileInfo fi = new FileInfo(strPath);

 

 

 

 

 

string sSaveTempPath = "";

 

 

 

 

 

string sDefaultName = "";

 

 

sDefaultName = fi.Name.Split(

 

 

'.')[0];

 

 

sDefaultName +=

 

 

" [" + DateTime.Today.ToShortDateString().Replace('/', '.') + "]";

 

 

 

 

 

 

 

string strExt = ".docx";

 

 

 

 

 

if (fi.Extension.ToLower() == ".dot")

 

 

strExt =

 

 

".doc";

 

 

 

 

 

else if (fi.Extension.ToLower() == ".dotm" || fi.Extension.ToLower() == ".dotx")

 

 

strExt =

 

 

".docx";

 

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

strExt = fi.Extension;

 

}

 

sDefaultName += strExt;

 

 

 

 

if (MosaiqueSettings.ManualDocumentNames)

 

 

{

 

 

 

 

frmRenameFile frmRName = new frmRenameFile(sDefaultName, false, strExt);

 

 

frmRName.ShowDialog();

 

 

 

 

if (!frmRName.bReNameCancelled)

 

 

{

 

frmRName.Close();

 

sDefaultName = frmRName.strNewFileName;

 

 

 

 

Application.DoEvents();

 

 

}

 

}

 

 

 

 

 

 

if (!sDefaultName.EndsWith(strExt))

 

 

{

 

sDefaultName += strExt;

 

}

 

sSaveTempPath =

 

 

Common.GetMosaiqueTempPath() + sDefaultName;// +strExt;

 

 

 

 

 

 

 

 

 

 

 

 

 

if (Common.ShowWordReport(strPath, true, sSaveTempPath, objType, iObjectId, Common.iUserID))

 

 

{

 

 

 

 

//file is created based on the template.

 

 

 

 

 

 

 

 

 

 

 

CFileInfo cfi = new CFileInfo(sSaveTempPath);

 

 

 

 

 

clsDocuments clsObj = new clsDocuments();

 

 

 

 

 

string sNewFileId = "";

 

 

clsObj.fnSaveNewWordReport(objType, iObjectId, sSaveTempPath,

 

 

Common.sUserName, ref sNewFileId,

 

 

cfi.FileType, cfi.GetFileSize(cfi.FileSize), cfi.FileSize.ToString(), cfi.FileTitle,

 

cfi.FileSubject, cfi.FileAuthor, cfi.FileCategory,

 

 

"", cfi.FileComment);

 

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

if (File.Exists(sSaveTempPath))

 

 

{

 

 

 

 

File.Delete(sSaveTempPath);

 

 

}

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

ex =

 

 

null;

 

 

}

 

 

 

 

 

 

 

 

if (ctl.GetType() == typeof(ctlMeetings))

 

 

{

 

((

 

 

ctlMeetings)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlAgendaItems))

 

 

{

 

((

 

 

ctlAgendaItems)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlTasks))

 

 

{

 

((

 

 

ctlTasks)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

DialogResult dlgRes = DialogResult.No;

 

 

 

 

 

if (Common.HiddenMessages[(int)Enums.MessagesDialogs.Reporting_Open_Report_] == true)

 

 

{

 

 

 

 

if (Common.HiddenMessagesDefaultValue[(int)Enums.MessagesDialogs.Reporting_Open_Report_] == 1)

 

 

{

 

dlgRes =

 

 

DialogResult.Yes;

 

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

dlgRes =

 

 

DialogResult.No;

 

 

}

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

dlgRes =

 

 

OfficeBox.Show(Common.TranslateText(Enums.InterFaces.Common, "Report generated successfully. Would you like to open?", Enums.TextType.Messages), "EPM", MessageBoxButtons.YesNo, OfficeBoxIcon.Question);

 

 

}

 

 

 

 

if (dlgRes == DialogResult.Yes)

 

 

{

 

 

 

 

if (ctl.GetType() == typeof(ctlMeetings))

 

 

{

 

((

 

 

ctlMeetings)ctl).ViewReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlAgendaItems))

 

 

{

 

((

 

 

ctlAgendaItems)ctl).ViewReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlTasks))

 

 

{

 

((

 

 

ctlTasks)ctl).ViewReportFile(sNewFileId);

 

 

}

 

}

 

}

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

 

 

 

finally

 

 

 

 

 

 

 

 

{

 

 

 

 

this.Cursor = Cursors.Default;

 

 

}

 

}

 

 

 

 

private void ShowQueryFolderTemplate(object sender, Janus.Windows.Ribbon.CommandEventArgs e)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

int iObjectId = int.Parse(grdTreeObjects.CurrentRow.Cells["ID"].Value.ToString());

 

 

 

 

 

Enums.MosaiqueObjects objType = Enums.MosaiqueObjects.QueryFolder;

 

 

 

 

 

Common.ShowWordReport(e.Command.Key, false, "", objType, iObjectId, Common.iUserID);

 

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private void ShowProjectOverviewTemplate(object sender, Janus.Windows.Ribbon.CommandEventArgs e)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

bool bIsSaveinDoc = MosaiqueSettings.IsSavePrjOverviewTemplateinDoc;

 

 

 

 

 

int iObjectId = int.Parse(grdTreeObjects.CurrentRow.Cells["ID"].Value.ToString());

 

 

 

 

 

Enums.MosaiqueObjects objType = Enums.MosaiqueObjects.Project;

 

 

 

 

 

if ((Common.grdCurrentRow != null) && (Common.grdCurrentRow.GridEX == grdTreeObjects) &&

 

 

(grdTreeObjects.CurrentRow.Cells[

 

 

"ViewRight"].Value.ToString() == "1") &&

 

 

(grdTreeObjects.CurrentRow.Cells[

 

 

"Tag"].Value.ToString() == ((int)Enums.ObjectNodes.DataFolder_Tasks_Task).ToString()))

 

 

{

 

objType =

 

 

Enums.MosaiqueObjects.Task;

 

 

bIsSaveinDoc =

 

 

MosaiqueSettings.IsSaveTaskOverviewTemplateinDoc;

 

 

}

 

 

 

 

if (bIsSaveinDoc)

 

 

CallNewWordTemplate(e.Command.Key);

 

 

 

 

else

 

 

 

 

 

 

 

 

 

 

 

Common.ShowWordReport(e.Command.Key, false, "", objType, iObjectId, Common.iUserID);

 

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private void ShowInvitationTemplate(object sender, Janus.Windows.Ribbon.CommandEventArgs e)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

int iObjectId = int.Parse(grdTreeObjects.CurrentRow.Cells["ID"].Value.ToString());

 

 

 

 

 

if (MosaiqueSettings.IsSaveInvitationTemplateinDoc)

 

 

CallNewWordTemplate(e.Command.Key);

 

 

 

 

else

 

 

 

 

 

 

 

 

 

 

 

Common.ShowWordReport(e.Command.Key, false, "", Enums.MosaiqueObjects.Meeting, iObjectId, Common.iUserID);

 

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private void ShowTaskListTemplate(object sender, Janus.Windows.Ribbon.CommandEventArgs e)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

int iObjectId = int.Parse(grdTreeObjects.CurrentRow.Cells["ID"].Value.ToString());

 

 

 

 

 

if (MosaiqueSettings.IsSaveTaskListTemplateinDoc)

 

 

CallNewWordTemplate(e.Command.Key);

 

 

 

 

else

 

 

 

 

 

 

 

 

 

 

 

Common.ShowWordReport(e.Command.Key, false, "", Enums.MosaiqueObjects.Meeting, iObjectId, Common.iUserID);

 

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private void ShowProtocolTemplate(object sender, Janus.Windows.Ribbon.CommandEventArgs e)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

int iObjectId = int.Parse(grdTreeObjects.CurrentRow.Cells["ID"].Value.ToString());

 

 

 

 

 

if (MosaiqueSettings.IsSaveProtocolTemplateinDoc)

 

 

CallNewWordTemplate(e.Command.Key);

 

 

 

 

else

 

 

 

 

 

 

 

 

 

 

 

Common.ShowWordReport(e.Command.Key, false, "", Enums.MosaiqueObjects.Meeting, iObjectId, Common.iUserID);

 

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private void ShowNewDocument(object sender, Janus.Windows.Ribbon.CommandEventArgs e)

 

 

{

 

 

 

 

if (uiPanRightContainer.Controls.Count > 0)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

this.Cursor = Cursors.WaitCursor;

 

 

 

 

 

Control ctl = uiPanRightContainer.Controls[0];

 

 

 

 

 

if (ctl.GetType() == typeof(ctlOrganisation) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlPersons) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlContacts) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlTasks) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlDecission) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlAgendaItems) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlMeetings))

 

 

{

 

 

 

 

if (IsCurrentObjectNew())

 

 

{

 

 

 

 

string sMessage = "Please save changes to current object before launching report generation.";

 

 

sMessage =

 

 

Common.TranslateText(Enums.InterFaces.Common, sMessage, Enums.TextType.Messages);

 

 

 

 

 

OfficeBox.Show(sMessage, "EPM", MessageBoxButtons.OK, OfficeBoxIcon.Information);

 

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

 

 

 

int iObjectTypeId = int.Parse(grdTreeObjects.CurrentRow.Cells["ObjectTypeId"].Value.ToString());

 

 

 

 

 

int iObjectId = int.Parse(grdTreeObjects.CurrentRow.Cells["ID"].Value.ToString());

 

 

 

 

 

FileInfo fi = new FileInfo(e.Command.Key);

 

 

 

 

 

string sSaveTempPath = "";

 

 

 

 

 

string sDefaultName = "";

 

 

sDefaultName = fi.Name.Split(

 

 

'.')[0];

 

 

sDefaultName +=

 

 

" [" + DateTime.Today.ToShortDateString().Replace('/', '.') + "]";

 

 

 

 

 

bool bOtherType = false;

 

 

 

 

 

 

 

string strExt = ".docx";

 

 

 

 

 

if (fi.Extension.ToLower() == ".dot")

 

 

strExt =

 

 

".doc";

 

 

 

 

 

else if (fi.Extension.ToLower() == ".dotm" || fi.Extension.ToLower() == ".dotx")

 

 

strExt =

 

 

".docx";

 

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

strExt = fi.Extension;

 

bOtherType =

 

 

true;

 

 

}

 

sDefaultName += strExt;

 

 

 

 

if (MosaiqueSettings.ManualDocumentNames)

 

 

{

 

 

 

 

frmRenameFile frmRName = new frmRenameFile(sDefaultName, false, strExt);

 

 

frmRName.ShowDialog();

 

 

 

 

if (!frmRName.bReNameCancelled)

 

 

{

 

frmRName.Close();

 

sDefaultName = frmRName.strNewFileName;

 

 

 

 

Application.DoEvents();

 

 

}

 

}

 

 

 

 

 

 

if (!sDefaultName.EndsWith(strExt))

 

 

{

 

sDefaultName += strExt;

 

}

 

sSaveTempPath =

 

 

Common.GetMosaiqueTempPath() + sDefaultName;// +strExt;

 

 

 

 

 

 

 

 

 

 

 

CFileInfo cfi = null;

 

 

 

 

 

clsDocuments clsObj = new clsDocuments();

 

 

 

 

 

string sNewFileId = "";

 

 

 

 

 

if (bOtherType == false)

 

 

{

 

 

 

 

if (Common.ShowWordReport(e.Command.Key, true, sSaveTempPath, (Enums.MosaiqueObjects)iObjectTypeId, iObjectId, Common.iUserID, true))

 

 

{

 

cfi =

 

 

new CFileInfo(sSaveTempPath);

 

 

clsObj.fnSaveNewWordReport((

 

 

Enums.MosaiqueObjects)iObjectTypeId, iObjectId, sSaveTempPath,

 

 

 

 

 

Common.sUserName, ref sNewFileId, cfi.FileType,

 

 

cfi.GetFileSize(cfi.FileSize), cfi.FileSize.ToString(), cfi.FileTitle,

 

cfi.FileSubject, cfi.FileAuthor, cfi.FileCategory,

 

 

"", cfi.FileComment);

 

 

 

 

 

//new file is saved to database.

 

 

 

 

 

 

 

 

AddAndOpenFileToObject(ctl, sNewFileId);

 

}

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

 

 

 

File.Copy(fi.FullName, sSaveTempPath, true);

 

 

cfi =

 

 

new CFileInfo(sSaveTempPath);

 

 

clsObj.fnSaveNewWordReport((

 

 

Enums.MosaiqueObjects)iObjectTypeId, iObjectId, sSaveTempPath,

 

 

 

 

 

Common.sUserName, ref sNewFileId, cfi.FileType,

 

 

cfi.GetFileSize(cfi.FileSize), cfi.FileSize.ToString(), cfi.FileTitle,

 

cfi.FileSubject, cfi.FileAuthor, cfi.FileCategory,

 

 

"", cfi.FileComment);

 

 

 

 

 

//new file is saved to database.

 

 

 

 

 

 

 

 

AddAndOpenFileToObject(ctl, sNewFileId);

 

}

 

clsObj =

 

 

null;

 

 

}

 

}

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

 

 

 

finally

 

 

 

 

 

 

 

 

{

 

 

 

 

this.Cursor = Cursors.Default;

 

 

}

 

}

 

}

 

 

 

 

private void ShowObjectTemplate(object sender, Janus.Windows.Ribbon.CommandEventArgs e)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

if (uiPanRightContainer.Controls.Count > 0)

 

 

{

 

 

 

 

Control ctl = uiPanRightContainer.Controls[0];

 

 

 

 

 

if (ctl.GetType() == typeof(ctlOrganisation) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlPersons) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlContacts) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlTasks) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlDecission) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlAgendaItems) ||

 

 

ctl.GetType() ==

 

 

typeof(ctlMeetings))

 

 

{

 

 

 

 

if (IsCurrentObjectSaved())

 

 

{

 

 

 

 

frmSearch frm = null;

 

 

frm =

 

 

new frmSearch(Enums.SearchType.Addresses_All, "A.IsActive=1", true, Enums.SearchingForField.ObjectDocuments, false);

 

 

frm.ShowDialog();

 

 

 

 

if (frm.bSearchCancelled == false)

 

 

{

 

 

 

 

if (frm.selectedRows != null && frm.selectedRows.Length > 0)

 

 

{

 

 

 

 

string sAddresseId = frm.selectedRows[0].Cells["AddresseId"].Value.ToString();

 

 

frm.Close();

 

 

 

 

Application.DoEvents();

 

 

 

 

 

int iObjectTypeId = int.Parse(grdTreeObjects.CurrentRow.Cells["ObjectTypeId"].Value.ToString());

 

 

 

 

 

int iObjectId = int.Parse(grdTreeObjects.CurrentRow.Cells["ID"].Value.ToString());

 

 

 

 

 

Common.sObjDocs_SelectedAddresseId = sAddresseId;

 

 

 

 

 

FileInfo fi = new FileInfo(e.Command.Key);

 

 

 

 

 

string sSaveTempPath = "";

 

 

 

 

 

string sDefaultName = "";

 

 

sDefaultName = fi.Name.Split(

 

 

'.')[0];

 

 

sDefaultName +=

 

 

" [" + DateTime.Today.ToShortDateString().Replace('/', '.') + "]";

 

 

 

 

 

string strExt = ".docx";

 

 

 

 

 

if (fi.Extension.ToLower() == ".dot")

 

 

strExt =

 

 

".doc";

 

 

sDefaultName += strExt;

 

 

 

 

if (MosaiqueSettings.ManualDocumentNames)

 

 

{

 

 

 

 

frmRenameFile frmRName = new frmRenameFile(sDefaultName, false, strExt);

 

 

frmRName.ShowDialog();

 

 

 

 

if (!frmRName.bReNameCancelled)

 

 

{

 

frmRName.Close();

 

sDefaultName = frmRName.strNewFileName;

 

 

 

 

Application.DoEvents();

 

 

}

 

}

 

 

 

 

//if (fi.Extension.ToLower() == ".dot")

 

 

 

 

 

 

 

 

 

 

 

// sSaveTempPath = Common.GetMosaiqueTempPath() + sDefaultName + ".doc";

 

 

 

 

 

 

 

 

 

 

 

//else

 

 

 

 

 

 

 

 

 

 

 

if (!sDefaultName.EndsWith(strExt))

 

 

{

 

sDefaultName += strExt;

 

}

 

sSaveTempPath =

 

 

Common.GetMosaiqueTempPath() + sDefaultName;// +strExt;

 

 

 

 

 

 

 

 

 

 

 

if (Common.ShowWordReport(e.Command.Key, true, sSaveTempPath, (Enums.MosaiqueObjects)iObjectTypeId, iObjectId, Common.iUserID))

 

 

{

 

 

 

 

CFileInfo cfi = new CFileInfo(sSaveTempPath);

 

 

 

 

 

clsDocuments clsObj = new clsDocuments();

 

 

 

 

 

string sNewFileId = "";

 

 

clsObj.fnSaveNewWordReport((

 

 

Enums.MosaiqueObjects)iObjectTypeId, iObjectId, sSaveTempPath,

 

 

 

 

 

Common.sUserName, ref sNewFileId, cfi.FileType,

 

 

cfi.GetFileSize(cfi.FileSize), cfi.FileSize.ToString(), cfi.FileTitle,

 

cfi.FileSubject, cfi.FileAuthor, cfi.FileCategory,

 

 

"", cfi.FileComment);

 

 

clsObj =

 

 

null;

 

 

 

 

 

//new file is saved to database.

 

 

 

 

 

 

 

 

AddAndOpenFileToObject(ctl, sNewFileId);

 

}

 

}

 

}

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

 

 

 

string sMessage = "Please save changes to current object before launching report generation.";

 

 

sMessage =

 

 

Common.TranslateText(Enums.InterFaces.Common, sMessage, Enums.TextType.Messages);

 

 

 

 

 

OfficeBox.Show(sMessage, "EPM", MessageBoxButtons.OK, OfficeBoxIcon.Information);

 

 

}

 

}

 

}

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private void AddAndOpenFileToObject(Control ctl, string sNewFileId)

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

if (sNewFileId != "")

 

 

{

 

 

 

 

if (ctl.GetType() == typeof(ctlPersons))

 

 

{

 

((

 

 

ctlPersons)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlOrganisation))

 

 

{

 

((

 

 

ctlOrganisation)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlContacts))

 

 

{

 

((

 

 

ctlContacts)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlTasks))

 

 

{

 

((

 

 

ctlTasks)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlDecission))

 

 

{

 

((

 

 

ctlDecission)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlAgendaItems))

 

 

{

 

((

 

 

ctlAgendaItems)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlMeetings))

 

 

{

 

((

 

 

ctlMeetings)ctl).AddReportFile(sNewFileId);

 

 

}

 

 

 

 

DialogResult dlgRes = DialogResult.No;

 

 

 

 

 

if (Common.HiddenMessages[(int)Enums.MessagesDialogs.Reporting_Open_Report_] == true)

 

 

{

 

 

 

 

if (Common.HiddenMessagesDefaultValue[(int)Enums.MessagesDialogs.Reporting_Open_Report_] == 1)

 

 

{

 

dlgRes =

 

 

DialogResult.Yes;

 

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

dlgRes =

 

 

DialogResult.No;

 

 

}

 

}

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

dlgRes =

 

 

OfficeBox.Show(Common.TranslateText(Enums.InterFaces.Common, "Report generated successfully. Would you like to open?", Enums.TextType.Messages), "EPM", MessageBoxButtons.YesNo, OfficeBoxIcon.Question);

 

 

}

 

 

 

 

if (dlgRes == DialogResult.Yes)

 

 

{

 

 

 

 

if (ctl.GetType() == typeof(ctlPersons))

 

 

{

 

((

 

 

ctlPersons)ctl).ViewReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlOrganisation))

 

 

{

 

((

 

 

ctlOrganisation)ctl).ViewReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlContacts))

 

 

{

 

((

 

 

ctlContacts)ctl).ViewReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlTasks))

 

 

{

 

((

 

 

ctlTasks)ctl).ViewReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlDecission))

 

 

{

 

((

 

 

ctlDecission)ctl).ViewReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlAgendaItems))

 

 

{

 

((

 

 

ctlAgendaItems)ctl).ViewReportFile(sNewFileId);

 

 

}

 

 

 

 

else if (ctl.GetType() == typeof(ctlMeetings))

 

 

{

 

((

 

 

ctlMeetings)ctl).ViewReportFile(sNewFileId);

 

 

}

 

}

 

}

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

OfficeDialog.

 

 

OfficeBox.Show(ex.Message, ex.TargetSite.Name.ToString(), MessageBoxButtons.OK, OfficeBoxIcon.Error);

 

 

 

 

 

Common.LogMessage(ex);

 

 

}

 

}

 

 

 

 

private bool IsCurrentObjectSaved()

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

if (grdTreeObjects.CurrentRow != null)

 

 

{

 

 

 

 

if (grdTreeObjects.CurrentRow.Cells["ID"].Value != null &&

 

 

grdTreeObjects.CurrentRow.Cells[

 

 

"ID"].Value.ToString() != "" &&

 

 

grdTreeObjects.CurrentRow.Cells[

 

 

"ID"].Value.ToString() != "-100" &&

 

 

grdTreeObjects.CurrentRow.Cells[

 

 

"ID"].Value.ToString() != "0")

 

 

{

 

 

 

 

if (grdTreeObjects.CurrentRow.Cells["ObjectTypeId"].Value != null &&

 

 

grdTreeObjects.CurrentRow.Cells[

 

 

"ObjectTypeId"].Value.ToString() != "")

 

 

{

 

 

 

 

if (IsDetailControlModified())

 

 

{

 

 

return false; }

 

 

 

 

 

else

 

 

 

 

 

 

 

 

{

 

 

return true; }

 

 

}

 

}

 

}

 

 

 

 

return false;

 

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

 

 

 

throw ex;

 

 

}

 

}

 

 

 

 

private bool IsCurrentObjectNew()

 

 

{

 

 

 

 

try

 

 

 

 

 

 

 

 

{

 

 

 

 

if (grdTreeObjects.CurrentRow != null)

 

 

{

 

 

 

 

if (grdTreeObjects.CurrentRow.Cells["ID"].Value != null &&

 

 

grdTreeObjects.CurrentRow.Cells[

 

 

"ID"].Value.ToString() != "" &&

 

 

grdTreeObjects.CurrentRow.Cells[

 

 

"ID"].Value.ToString() != "-100" &&

 

 

grdTreeObjects.CurrentRow.Cells[

 

 

"ID"].Value.ToString() != "0")

 

 

{

 

 

 

 

if (grdTreeObjects.CurrentRow.Cells["ObjectTypeId"].Value != null &&

 

 

grdTreeObjects.CurrentRow.Cells[

 

 

"ObjectTypeId"].Value.ToString() != "")

 

 

{

 

 

 

 

return false;

 

 

}

 

}

 

}

 

 

 

 

return true;

 

 

}

 

 

 

 

catch (Exception ex)

 

 

{

 

 

 

 

throw ex;

 

 

}

 

}

 

 

 

 

 

 

#endregion

 

 

 

"menus for templates"

 

 

 

 

 

 

 

the same i need to do using telerik raddropdownbutton element

 

Peter
Telerik team
 answered on 19 May 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?