<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrdenServicioCU.ascx.cs"
Inherits="Presentation.Web.Catalogos.Cat_Contratos.OrdenServicioCU" %>
<
telerik:RadGrid
ID
=
"rgOrdenServicio"
runat
=
"server"
AllowMultiRowEdit
=
"true"
Visible
=
"true"
AllowPaging
=
"True"
GridLines
=
"None"
AllowAutomaticUpdates
=
"true"
AutoGenerateColumns
=
"false"
AllowAutomaticInserts
=
"true"
AllowAutomaticDeletes
=
"true"
AllowSorting
=
"true"
>
<
MasterTableView
CommandItemDisplay
=
"Top"
DataKeyNames
=
"ID"
NoMasterRecordsText
=
"No hay datos a mostrar."
>
<
PagerStyle
Mode
=
"NumericPages"
></
PagerStyle
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
Visible
=
"false"
>
<
HeaderStyle
Width
=
"1px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"OrdenServicio"
HeaderText
=
"Orden de Servicio"
ReadOnly
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"FechaInicio"
DataType
=
"System.DateTime"
HeaderText
=
"Fecha de Inicio"
SortExpression
=
"FechaInicio"
UniqueName
=
"FechaInicio"
DataFormatString
=
"{0:D}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"FechaTermino"
DataType
=
"System.DateTime"
HeaderText
=
"Fecha de Termino"
SortExpression
=
"FechaTermino"
UniqueName
=
"FechaTermino"
DataFormatString
=
"{0:D}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"MontoAsignado"
DataType
=
"System.Decimal"
HeaderText
=
"Monto Asignado"
SortExpression
=
"MontoAsignado"
UniqueName
=
"MONTO_ASIGNADO"
>
</
telerik:GridBoundColumn
>
<
telerik:GridButtonColumn
CommandName
=
"Delete"
ButtonType
=
"ImageButton"
>
</
telerik:GridButtonColumn
>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
>
</
EditColumn
>
<
FormTemplate
>
<
table
cellspacing
=
"2"
cellpadding
=
"1"
width
=
"100%"
border
=
"0"
>
<
tr
style
=
"visibility: hidden"
>
<
td
colspan
=
"2"
>
<
b
>ID:
<%# Eval("ID")%>
</
b
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Orden de Servicio:
</
td
>
<
td
>
<
asp:TextBox
Width
=
"200px"
ID
=
"TextBox1"
runat
=
"server"
Text='<%# Bind("OrdenServicio") %>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Fecha de Inicio:
</
td
>
<
td
>
<
asp:TextBox
Width
=
"200px"
ID
=
"TextBox2"
runat
=
"server"
Text='<%# DataBinder.Eval( Container, "DataItem.FechaInicio" )%>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Fecha de Termino:
</
td
>
<
td
>
<
asp:TextBox
Width
=
"200px"
ID
=
"TextBox3"
runat
=
"server"
Text='<%# DataBinder.Eval( Container, "DataItem.FechaTermino" )%>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Monto Asignado:
</
td
>
<
td
>
<
asp:TextBox
Width
=
"200px"
ID
=
"TextBox4"
runat
=
"server"
Text='<%# DataBinder.Eval( Container, "DataItem.MontoAsignado" )%>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
OnClick="btnInsertOrden_clic"></
asp:Button
>
<
asp:Button
ID
=
"Button2"
runat
=
"server"
Text
=
"Cancel"
CausesValidation
=
"false"
CommandName
=
"Cancel"
>
</
asp:Button
>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
ServicesReferencesCore.CatalogoService;
using
Telerik.Web.UI;
namespace
Presentation.Web.Catalogos.Cat_Contratos
{
public
partial
class
OrdenServicioCU : System.Web.UI.UserControl
{
CatalogoServiceClient CatClient =
new
CatalogoServiceClient();
public
ContratoDTO Contrato =
new
ContratoDTO();
List<OrdenServicioDTO> lstOrdenServicio;
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(Contrato.Id > 0)
{
ObtenerDatos();
Session[
"contrato"
] = Contrato;
}
else
{
if
(Session[
"contrato"
] !=
null
)
Contrato = Session[
"contrato"
]
as
ContratoDTO;
}
}
private
void
ObtenerDatos()
{
if
(Contrato !=
null
)
{
if
(Contrato.Id > 0)
{
CatClient =
new
CatalogoServiceClient();
lstOrdenServicio =
new
List<OrdenServicioDTO>();
lstOrdenServicio = CatClient.ObtenerOrdenServicioContrato(Contrato.Id);
rgOrdenServicio.DataSource = lstOrdenServicio;
rgOrdenServicio.DataBind();
}
else
{
lstOrdenServicio =
new
List<OrdenServicioDTO>();
rgOrdenServicio.DataSource = lstOrdenServicio;
rgOrdenServicio.DataBind();
}
}
else
{
lstOrdenServicio =
new
List<OrdenServicioDTO>();
rgOrdenServicio.DataSource = lstOrdenServicio;
rgOrdenServicio.DataBind();
}
}
#region Eventos
protected
void
btnInsertOrden_clic(
object
sender, EventArgs e)
{
//codigo para guardar los datos en la bd
}
#endregion
}
}
<
telerik:RadPane
runat
=
"server"
ID
=
"RadPane1"
>
<
telerik:RadToolBar
runat
=
"server"
ID
=
"RadToolBar1"
CssClass
=
"inbox-search-toolbar"
OnClientButtonClicked
=
"onButtonClicked"
OnButtonClick
=
"RadToolBar1_ButtonClick"
EnableViewState
=
"false"
>
<
Items
>
<
telerik:RadToolBarButton
ImageUrl
=
"~/Images/print.gif"
Enabled
=
"false"
/>
<
telerik:RadToolBarButton
ImageUrl
=
"~/Images/move.gif"
Enabled
=
"false"
/>
<
telerik:RadToolBarButton
ImageUrl
=
"~/Images/delete_inbox.gif"
Value
=
"Delete"
CommandName
=
"delete"
/>
<
telerik:RadToolBarButton
IsSeparator
=
"true"
/>
<
telerik:RadToolBarButton
Text
=
"Reply"
ImageUrl
=
"~/Images/reply.gif"
Value
=
"Reply"
CommandName
=
"reply"
/>
<
telerik:RadToolBarButton
Value
=
"searchTextBoxButton"
CommandName
=
"searchText"
>
<
ItemTemplate
>
<
telerik:RadTextBox
runat
=
"server"
ID
=
"RadTextBox1"
EmptyMessage
=
"Search Inbox"
CssClass
=
"inbox-search-textbox"
Width
=
"300px"
ClientEvents-OnKeyPress
=
"onKeyPress"
/>
</
ItemTemplate
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
ImageUrl
=
"~/Images/search.gif"
Value
=
"search"
CommandName
=
"doSearch"
/>
<
telerik:RadToolBarButton
ImageUrl
=
"~/Images/icons/MailSettings.png"
CommandName
=
"settings"
/>
</
Items
>
</
telerik:RadToolBar
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"grdMessage"
DataSourceID
=
"LinqDataSource1"
AutoGenerateColumns
=
"false"
GridLines
=
"None"
Height
=
"500px"
BorderWidth
=
"0"
AllowSorting
=
"true"
Style
=
"border: 0; outline: none;"
ShowGroupPanel
=
"true"
OnItemCommand
=
"grdMessage_ItemCommand"
AllowMultiRowSelection
=
"true"
OnRowDrop
=
"grdMessage_RowDrop"
>
<
ClientSettings
EnablePostBackOnRowClick
=
"true"
AllowDragToGroup
=
"true"
EnableAlternatingItems
=
"false"
AllowRowsDragDrop
=
"true"
>
<
Selecting
EnableDragToSelectRows
=
"true"
AllowRowSelect
=
"true"
/>
<
ClientEvents
OnRowSelected
=
"onGridRowSelected"
OnCommand
=
"function(){}"
OnRowDblClick
=
"RemoveBold"
OnRowClick
=
"RemoveBold"
OnRowContextMenu
=
"GrdMessageRowContextMenu"
OnRowDropping
=
"onRowDropping"
/>
<
Scrolling
UseStaticHeaders
=
"true"
AllowScroll
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
TableLayout
=
"Fixed"
GroupLoadMode
=
"Client"
DataKeyNames
=
"id"
Width
=
"100%"
AdditionalDataFieldNames
=
"Date"
ClientDataKeyNames
=
"id"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"DateResult"
HeaderValueSeparator
=
":"
SortOrder
=
"Descending"
/>
</
GroupByFields
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldName
=
"DateResult"
HeaderText
=
"Date"
FormatString
=
"{0:d}"
/>
</
SelectFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"TemplateColumn2"
GroupByExpression
=
"From Group By From"
SortExpression
=
"From"
HeaderText
=
"From / Subject"
HeaderStyle-Width
=
"150px"
>
<
ItemStyle
Height
=
"35px"
></
ItemStyle
>
<
ItemTemplate
>
<%# (Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "seen")) ? DataBinder.Eval(Container.DataItem, "from_msg").ToString() : "<
b
>" + DataBinder.Eval(Container.DataItem, "from_msg").ToString() + "</
b
>") %>
<
br
/>
<
div
class
=
"MailSubject"
>
<%# (Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "seen")) ? DataBinder.Eval(Container.DataItem, "subject").ToString() : "<
b
>" + DataBinder.Eval(Container.DataItem, "subject").ToString() + "</
b
>") %>
</
div
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"msg_date"
HeaderText
=
"Date"
HeaderStyle-Width
=
"150px"
GroupByExpression
=
"DateResult Date GROUP BY DateResult"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"size"
HeaderText
=
"Size"
HeaderStyle-Width
=
"50px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCalculatedColumn
UniqueName
=
"Date"
DataType
=
"System.DateTime"
DataFields
=
"msg_date"
Expression
=
"msg_date.Value.Date"
HeaderText
=
"Date"
Visible
=
"false"
>
</
telerik:GridCalculatedColumn
>
<
telerik:GridCalculatedColumn
UniqueName
=
"Conversation"
DataType
=
"System.String"
DataFields
=
"subject"
Expression
=
'subject.Replace("RE: ", "")'
HeaderText
=
"Conversation"
Visible
=
"false"
>
</
telerik:GridCalculatedColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"TemplateColumn3"
Groupable
=
"False"
>
<
HeaderStyle
Width
=
"25px"
></
HeaderStyle
>
<
ItemStyle
Height
=
"35px"
></
ItemStyle
>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"MailFlagImageButton"
BorderWidth
=
"0px"
CommandName
=
"ChangeFlag"
ImageUrl='<%# Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "flagged"))? "~/Images/MailFlagRed.png" : "~/Images/MailFlag.png" %>'
AlternateText="Change Flag" Style="cursor: pointer;" runat="server"></
asp:ImageButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:RadNotification
ID
=
"RadNotification1"
runat
=
"server"
LoadContentOn
=
"TimeInterval"
Width
=
"250"
Animation
=
"Fade"
EnableRoundedCorners
=
"true"
EnableShadow
=
"true"
Skin
=
"Default"
Height
=
"100"
OnClientUpdated
=
"OnClientUpdated"
Text="<strong>You have received 1 new message!</
strong
>" OffsetX="-30" OffsetY="-30" UpdateInterval="5000" AutoCloseDelay="10000"
ShowTitleMenu="true" ShowCloseButton="true" OnCallbackUpdate="OnCallbackUpdate">
<
NotificationMenu
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Open Item"
ImageUrl
=
"../../images/icons/open.png"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Flag Item"
ImageUrl
=
"../../images/icons/Flagged.png"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Delete Item"
ImageUrl
=
"../../images/icons/delete.gif"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Mark As Read"
ImageUrl
=
"../../images/icons/MarkAsRead.png"
></
telerik:RadMenuItem
>
</
Items
>
</
NotificationMenu
>
</
telerik:RadNotification
>
</
telerik:RadPane
>
var
data =
new
Array();
var
openedMsgs =
new
Array();
//use a flag to determine whether the item was selected by using the mouse or programmatically by the set_selected method
var
flag =
true
;
function
refreshGrid() {
var
grid = $find(
"<%=grdMessage.ClientID %>"
);
var
mtv = grid.get_masterTableView();
mtv.set_dataSource(data);
mtv.dataBind();
var
selectedItem = mtv.get_selectedItems()[0];
if
(selectedItem) {
selectedItem.set_selected(
false
);
}
var
items = mtv.get_dataItems();
for
(
var
i = 0; i < items.length; i++) {
items[i].get_element().style.fontWeight =
'bold'
;
}
if
(selectedItem) {
var
index = +selectedItem._itemIndexHierarchical;
flag =
false
;
if
(items[index + 1] !=
null
)
items[index + 1].set_selected(
true
);
}
for
(
var
i = 0; i < openedMsgs.length; i++) {
openedMsgs[i] = openedMsgs[i] + 1;
items[openedMsgs[i]].get_element().style.fontWeight =
'normal'
;
}
}
function
OnClientUpdated(sender, args) {
var
record = sender.get_value();
if
(record !=
""
) {
data.unshift(eval(record));
//refreshGrid();
sender.show();
}
sender.set_value(
""
);
}
function
RemoveBold(sender, args) {
var
item = args.get_item();
if
(!Array.contains(openedMsgs, (+item._itemIndexHierarchical)) && flag) {
openedMsgs.push(+item._itemIndexHierarchical);
item.get_element().style.fontWeight =
'normal'
;
}
flag =
true
;
}
function
OnRowCreated(sender, args) {
var
item = args.get_item();
item.get_element().style.fontWeight =
'bold'
;
}
protected
void
OnCallbackUpdate(
object
sender, RadNotificationEventArgs e)
{
CheckForNewMailsInHMailDB();
//simulates cases when there are and there are not new messages
if
(_NewMessages)
{
RadNotification1.Value = GetRecord();
grdMessage.Rebind();
_NewMessages =
false
;
}
else
RadNotification1.Value =
""
;
}
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="menu.aspx.vb" Inherits="TestaTredjepartWeb.menu" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"s"
runat
=
"server"
>
</
asp:ScriptManager
>
<
div
>
<
table
>
<
tr
>
<
td
>
<
telerik:RadMenu
ID
=
"menu"
runat
=
"server"
RenderMode
=
"Lightweight"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Test1"
Value
=
"item1"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
IsSeparator
=
"true"
Value
=
"separator"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Test2"
Value
=
"item2"
></
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
input
type
=
"button"
onclick
=
"var menu = $find('menu'); menu.findItemByValue('item2').hide(); menu.findItemByValue('separator').hide();"
value
=
"Click to hide"
/>
</
td
>
</
tr
>
</
table
>
</
div
>
</
form
>
</
body
>
</
html
>
protected void RadMenu1_ItemDataBound(object sender, Telerik.Web.UI.RadMenuEventArgs e)
{
if (e.Item.Level == 1 && e.Item.Value == "Units")
{
Telerik.Web.UI.RadMenuItem separator = new Telerik.Web.UI.RadMenuItem();
separator.IsSeparator = true;
Telerik.Web.UI.RadMenuItem itm = (Telerik.Web.UI.RadMenuItem)e.Item;
itm.Owner.Items.Insert(e.Item.Index + 1, separator);
}
}
<
style
type
=
"text/css"
>
/* <
Separators
> */
.rmSeparator {
height: 1px !important;
margin: 1px 0 0 !important;
width: 25px !important;
background-color: #A8A8A8 !important;
}
</
style
>
<
telerik:RadComboBox
Filter
=
"Contains"
runat
=
"server"
ID
=
"cmbTechnicalServicePerson"
Width
=
"420px"
MarkFirstMatch
=
"true"
DataSourceID
=
"DSGetTechnicalServicePerson"
EnableLoadOnDemand
=
"true"
HighlightTemplatedItems
=
"true"
OnClientItemsRequested
=
"UpdateItemCountField"
OnDataBound
=
"cmbTechnicalServicePerson_DataBound"
OnItemDataBound
=
"cmbTechnicalServicePerson_ItemDataBound"
LabelWidth
=
"100"
Label
=
"Technical Service Name:"
Skin
=
"Office2010Black"
Style
=
"position: absolute; top: 310px; left: 21px; z-index: 6500; height: 16px;"
Text
=
"Select a Value"
TabIndex
=
"3"
>
<
HeaderTemplate
>
<
ul
>
<
li
class
=
"col1"
>Name</
li
>
<
li
class
=
"col2"
>Position</
li
>
<
li
class
=
"col2"
>Unit</
li
>
</
ul
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
ul
>
<
li
class
=
"col1"
>
<%# DataBinder.Eval(Container.DataItem, "[FULLNAME]")%></
li
>
<
li
class
=
"col2"
>
<%# DataBinder.Eval(Container.DataItem, "Position")%></
li
>
<
li
class
=
"col3"
>
<%# DataBinder.Eval(Container.DataItem, "[Department]")%></
li
>
</
ul
>
</
ItemTemplate
>
<
FooterTemplate
>
A total of
<
asp:Literal
runat
=
"server"
ID
=
"RadComboItemsTCount"
/>
items
</
FooterTemplate
>
</
telerik:RadComboBox
>
This is how my combo box set up in aspx page
I wanted to select the value from combo box using vb.net it select the value but the selected text will always “Select a Value” which is default value.
This is how I am change the selected value inside the code
Me.cmbTechnicalServicePerson.SelectedValue = DRProjectDetailsinfo.Item("TechnicalServicePerson")
Or Me.cmbTechnicalServicePerson.SelectedValue = 12551
But it is not selecting the text any idea
Thanks
Syed
private void SetActions()
{
String sString =
@"
function SaveTreeState(action)
{
var tree = $find('" + RadTreeView1.ClientID + @"');
if(tree == null) { return; }
var nodes = tree.get_allNodes();
if(action == 'expand')
{
for(var cnt=0; cnt<nodes.length; cnt++)
{
nodes[cnt].expand();
}
}
if(action == 'collapse')
{
for(var cnt=0; cnt<nodes.length; cnt++)
{
nodes[cnt].collapse();
}
}
var expandedNodes = '';
for(var cnt=0; cnt<nodes.length; cnt++)
{
if(nodes[cnt].get_expanded())
{
expandedNodes += nodes[cnt].get_value() + '|';
}
}
SaveCookie('mpnotetreestate',expandedNodes);
}
function SaveCookie(name,value,days) {
if (days) {
if (days>730) {
days=730;
}
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = '; expires='+date.toGMTString();
}
else var expires = '';
document.cookie = name+'='+value+expires+'; path=/';
}
";
ScriptManager.RegisterClientScriptBlock(this, typeof(ViewNotes), "SaveTreeStateBlock", sString, true);
ViewToolBar1.btnExpandAll.Attributes.Add("onclick", "try{SaveTreeState('expand');}catch(err){return;}return false;");
ViewToolBar1.btnCollapseAll.Attributes.Add("onclick", "try{SaveTreeState('collapse');}catch(err){return}return false;");
}
OnClientNodeExpanded="SaveTreeState" ShowLineImages="false" ID="RadTreeView1" runat="server">
<CollapseAnimation Duration="100" Type="None" />
<ExpandAnimation Duration="100" Type="None" />
function
OnRibbonBarButtonClicking(sender, args) {
if
(args.get_button().get_value() ==
"delete"
) {
args.set_cancel(
true
);
radConfirm(
"Sure?"
, _callbackFunc);
}
}
function
_callbackFunc(arg) {
if
(arg) {
// do postback, but how?
}
}