or
if ((e.Item is GridDataInsertItem) && e.Item.IsInEditMode) |
{ |
// Insert is clicked |
GridEditableItem editedItem = e.Item as GridEditableItem; |
GridDataItem dataItem = (GridDataItem)e.Item; |
GridEditManager editMan = editedItem.EditManager; |
GridDropDownListColumnEditor editor = editMan.GetColumnEditor("Id") as GridDropDownListColumnEditor; |
RadComboBox dropDownList1 = editedItem["Id"].Controls[0] as RadComboBox; |
TableCell cell = (TableCell)editor.ContainerControl; |
//Declare the validator |
RequiredFieldValidator rfv = new RequiredFieldValidator(); |
rfv.ControlToValidate = dropDownList1.ID; |
rfv.ID = "valId"; |
rfv.ErrorMessage = @"<img src='Images/cautionIcon.png' class='Validation' />"; |
//Add the validator to the cell |
cell.Controls.Add(rfv); |
editor.ComboBoxControl.Skin = "MySkin"; |
editor.ComboBoxControl.EnableEmbeddedSkins = false; |
editor.ComboBoxControl.DropDownWidth = Unit.Pixel(500); |
editor.ComboBoxControl.Width = Unit.Pixel(380); |
var erds = (from result in _s |
where !_Ds.Any(dto => |
dto.Id == result.SystemID) |
select result).ToList<DTO>(); |
editor.DataSource = s; |
editor.DataBind(); |
} |
else if ((e.Item is GridEditableItem) && e.Item.IsInEditMode) |
{ |
// Edit is clicked |
GridEditableItem editedItem = e.Item as GridEditableItem; |
GridDataItem dataItem = (GridDataItem)e.Item; |
DTO affected = (DTO)e.Item.DataItem; |
GridEditManager editMan = editedItem.EditManager; |
GridDropDownListColumnEditor editor = editMan.GetColumnEditor("Id") as GridDropDownListColumnEditor; |
RadComboBox dropDownList1 = editedItem["Id"].Controls[0] as RadComboBox; |
TableCell cell = (TableCell)editor.ContainerControl; |
//Declare the validator |
RequiredFieldValidator rfv = new RequiredFieldValidator(); |
rfv.ControlToValidate = dropDownList1.ID; |
rfv.ID = "Id"; |
rfv.ErrorMessage = @"<img src='Images/cautionIcon.png' class='Validation' />"; |
editor.ComboBoxControl.Skin = "EPSS"; |
editor.ComboBoxControl.EnableEmbeddedSkins = false; |
editor.ComboBoxControl.DropDownWidth = Unit.Pixel(500); |
editor.ComboBoxControl.Width = Unit.Pixel(380); |
var erds = (from result in _s |
where !_as.Any(dto => |
dto.Id == result.SystemID && dto.Id != affected.Id) |
select result).ToList<DTOSystem>(); |
editor.DataSource = s; |
editor.DataBind(); |
editor.SelectedValue = affected.Id.ToString(); |
} |
<
telerik:RadEditor
ID
=
"txtBody"
runat
=
"server"
EditModes
=
"Design"
Width
=
"98%"
Height
=
"200px"
ContentAreaMode
=
"Div"
NewLineBr
=
"true"
ToolbarMode
=
"Default"
AutoResizeWidth
=
"false"
>
<
Tools
>
<
telerik:EditorToolGroup
Tag
=
"Edit"
>
<
telerik:EditorTool
Name
=
"Undo"
/>
<
telerik:EditorTool
Name
=
"Redo"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"Cut"
/>
<
telerik:EditorTool
Name
=
"Copy"
/>
<
telerik:EditorTool
Name
=
"Paste"
ShortCut
=
"CTRL+!"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"PasteFromWord"
/>
<
telerik:EditorTool
Name
=
"PasteFromWordNoFontsNoSizes"
/>
<
telerik:EditorTool
Name
=
"PastePlainText"
/>
<
telerik:EditorTool
Name
=
"PasteAsHtml"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"Print"
/>
<
telerik:EditorTool
Name
=
"SelectAll"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"InsertDate"
/>
<
telerik:EditorTool
Name
=
"InsertTime"
/>
</
telerik:EditorToolGroup
>
<
telerik:EditorToolGroup
Tag
=
"Font"
>
<
telerik:EditorTool
Name
=
"Bold"
/>
<
telerik:EditorTool
Name
=
"Italic"
/>
<
telerik:EditorTool
Name
=
"Underline"
/>
<
telerik:EditorTool
Name
=
"StrikeThrough"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"JustifyLeft"
/>
<
telerik:EditorTool
Name
=
"JustifyCenter"
/>
<
telerik:EditorTool
Name
=
"JustifyRight"
/>
<
telerik:EditorTool
Name
=
"JustifyFull"
/>
<
telerik:EditorTool
Name
=
"JustifyNone"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"Superscript"
/>
<
telerik:EditorTool
Name
=
"Subscript"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"ConvertToLower"
/>
<
telerik:EditorTool
Name
=
"ConvertToUpper"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"Indent"
/>
<
telerik:EditorTool
Name
=
"Outdent"
/>
<
telerik:EditorTool
Name
=
"InsertOrderedList"
/>
<
telerik:EditorTool
Name
=
"InsertUnorderedList"
/>
<
telerik:EditorTool
Name
=
"ToggleTableBorder"
/>
</
telerik:EditorToolGroup
>
<
telerik:EditorToolGroup
Tag
=
"Color-Font"
>
<
telerik:EditorTool
Name
=
"ForeColor"
/>
<
telerik:EditorTool
Name
=
"BackColor"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"FontName"
/>
<
telerik:EditorTool
Name
=
"FontSize"
/>
</
telerik:EditorToolGroup
>
</
Tools
>
</
telerik:RadEditor
>
<
CommandItemSettings
ShowExportToExcelButton
=
"true"
ShowAddNewRecordButton
=
"false"
ShowRefreshButton
=
"true"
/>
<
telerik:RadButton
ID
=
"rbtIGTExportToExcel"
Width
=
"150px"
Text
=
"Export To Excel"
OnClick
=
"btnExcel_Click"
runat
=
"server"
Icon-PrimaryIconUrl
=
"~/images/icons/sys-excel.png"
/>
protected
void
ExportList(
object
sender, EventArgs e)
{
RadGridListAllUser.ExportSettings.IgnorePaging =
true
;
RadGridListAllUser.ExportSettings.OpenInNewWindow =
true
;
RadGridListAllUser.ExportSettings.FileName =
string
.Format(
"{0} User List Export {1}"
, (
string
)Session[
"StudyName"
], DateTime.Now.ToShortDateString());
RadGridListAllUser.MasterTableView.ExportToExcel();
}
protected
void
btnExcel_Click(
object
sender, EventArgs e)
{
rgIGTSummaryGrid.ExportSettings.IgnorePaging =
true
;
rgIGTSummaryGrid.ExportSettings.OpenInNewWindow =
true
;
rgIGTSummaryGrid.ExportSettings.FileName =
string
.Format(
"{0} IGT Export {1}"
, (
string
)Session[
"StudyName"
], DateTime.Now.ToShortDateString());
rgIGTSummaryGrid.MasterTableView.ExportToExcel();
}