eDosWeb/safety/docACertificates.aspx.cs
Luc Vandenbroucke ee9fa6be65 first
2018-12-13 09:09:17 +01:00

51 lines
No EOL
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
namespace safety
{
public partial class docACertificates : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
General.setTitle(Master, "Certificates CEK");
}
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDropDownListColumnEditor editor = (GridDropDownListColumnEditor)(editMan.GetColumnEditor("hrmType"));
//in case you have RadComboBox editor for the GridDropDownColumn (this is the default editor),
//you will need to use ComboBoxControl below instead of DropDownListControl
//and add RadComboBoxItems instead of ListItems to the Items collection of the editor
DropDownList ddList = editor.DropDownListControl;
ddList.Items.Insert(0, new ListItem("Normal", "0"));
//ddList.Items[0].Attributes["style"] = "color: red";
ddList.Items.Insert(1, new ListItem("Extern follow up", "1"));
//ddList.Items[0].Attributes["style"] = "color: red";
ddList.Items.Insert(2, new ListItem("No follow up", "2"));
//ddList.Items[0].Attributes["style"] = "color: red";
editor = (GridDropDownListColumnEditor)(editMan.GetColumnEditor("externType"));
//in case you have RadComboBox editor for the GridDropDownColumn (this is the default editor),
//you will need to use ComboBoxControl below instead of DropDownListControl
//and add RadComboBoxItems instead of ListItems to the Items collection of the editor
ddList = editor.DropDownListControl;
ddList.Items.Insert(0, new ListItem("Normal", "0"));
//ddList.Items[0].Attributes["style"] = "color: red";
ddList.Items.Insert(1, new ListItem("Extern follow up", "1"));
//ddList.Items[0].Attributes["style"] = "color: red";
ddList.Items.Insert(2, new ListItem("No follow up", "2"));
//ddList.Items[0].Attributes["style"] = "color: red";
}
}
}
}