Telerik Forums
UI for WinForms Forum
4 answers
223 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
118 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
207 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
163 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
1 answer
204 views
Hello,


   I am trying to use the RadMessageBox. What ddl's do i need to have for that and can you provide me some examples?

Thanks
Stefan
Telerik team
 answered on 19 May 2011
1 answer
90 views
hi,
I have a column in my SELECT statement for the grid that I want to use as a checkbox.  For example, it reads:  0 as selected. This is automatically set to read only, so I ticked it off in property builder. But when i tick it on in the grid and move off it says that the column is read only. Any way to fix this?

thanks.
Julian Benkov
Telerik team
 answered on 19 May 2011
2 answers
182 views
should this work? I cant' seem to get BrinigIntoView() to scroll my Treeviews.

Regards
Erwin
Stefan
Telerik team
 answered on 19 May 2011
1 answer
237 views
The LoadLayout method of the RadGridView will sometimes throw an error "Collection was modified; enumeration operation may not execute." We have found that this happens after the following sequence of events:

1. Define one or more filters in the grid.
2. Use SaveLayout to save the layout definition, which includes the filters.
3. Use LoadLayout to load the layout that includes filters.
2. Use LoadLayout to load a different layout that includes no filters.

Apparently some internal code is iterating through the filter descriptors and attempting to delete them within the iteration. The workaround that we found is to first execute a .Columns.Clear() to remove all of the existing columns. Since they are all going to be replaced by the new layout this produces the same end result, minus the error.

We believe that this problem was introduced sometime between 2010Q1 and 2011Q1. Upgrading from 2010Q1 to 2011Q1 has been one of the most frustrating and time consuming version changes that I have ever experienced. There are a lot of new features and a lot of fixes, but it seems that little thought was given to backward compatibility.
Jack
Telerik team
 answered on 19 May 2011
8 answers
342 views

Hi,
     Do you have a control similar to Winform Property Grid control with property grid features like Number/DateTime masking, list box, categories sorting etc.  Winform Property Grid control is neither enough nor flexible enough for customizations.

 

Thanks,

Rangarajan.S

Stefan
Telerik team
 answered on 19 May 2011
5 answers
255 views
Hello,

Is it possible to create a header and footer for dropdownlist control,
and to insert controls to it?
exactly like in the asp.net ajax combobox control.

Thanks,
Oren
Boryana
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)
Form
Chart (obsolete as of Q1 2013)
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?