or
protected
void
LeaseRenewalRadGrid_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
Telerik.Web.UI.GridEditableItem)
{
GridEditableItem editableItem = (GridEditableItem)e.Item;
RadMaskedTextBox startDateTextBox;
if
(e.Item.IsInEditMode)
{
if
(e.Item.OwnerTableView.IsItemInserted)
{
Image startDateCalendarImage = (Image)editableItem.FindControl(
"RenewalInsertStartDateCalendarImage"
);
if
(startDateCalendarImage !=
null
)
{
startDateCalendarImage.Attributes.Add(
"onclick"
,
"ShowGridDatePopup('Insert','Start','"
+ editableItem.ItemIndex +
"');"
);
}
Image endDateCalendarImage = (Image)editableItem.FindControl(
"RenewalInsertEndDateCalendarImage"
);
if
(endDateCalendarImage !=
null
)
{
endDateCalendarImage.Attributes.Add(
"onclick"
,
"ShowGridDatePopup('Insert','End','"
+ editableItem.ItemIndex +
"');"
);
}
startDateTextBox = (RadMaskedTextBox)editableItem.FindControl(
"RenewalInsertStartDateRadMaskedTextBox"
);
}
else
{
Image startDateCalendarImage = (Image)editableItem.FindControl(
"RenewalStartDateCalendarImage"
);
if
(startDateCalendarImage !=
null
)
{
startDateCalendarImage.Attributes.Add(
"onclick"
,
"ShowGridDatePopup('Edit','Start','"
+ editableItem.ItemIndex +
"');"
);
}
Image endDateCalendarImage = (Image)editableItem.FindControl(
"RenewalEndDateCalendarImage"
);
if
(endDateCalendarImage !=
null
)
{
endDateCalendarImage.Attributes.Add(
"onclick"
,
"ShowGridDatePopup('Edit','End','"
+ editableItem.ItemIndex +
"');"
);
}
startDateTextBox = (RadMaskedTextBox)editableItem.FindControl(
"RenewalStartDateRadMaskedTextBox"
);
}
if
(startDateTextBox !=
null
)
{
startDateTextBox.Focus();
startDateTextBox.Attributes.Add(
"onfocus"
,
"this.select()"
);
}
}
}
}
row = MasterTable.get_dataItems()[index];
function ShowGridDatePopup(editinsert, startend, index) {
// alert(index);
var grid = $find("<%=LeaseRenewalRadGrid.ClientID %>");
var MasterTable = grid.get_masterTableView();
var dateTextBox;
var row;
if (editinsert == "Edit") {
row = MasterTable.get_dataItems()[index];
if (startend == "Start") {
dateTextBox = row.findControl("RenewalStartDateRadMaskedTextBox");
}
else { // End
dateTextBox = row.findControl("RenewalEndDateRadMaskedTextBox");
}
if (dateTextBox != null) {
dateControls[8] = dateTextBox;
ShowDatePopup(8, "TopRight", true);
}
}
else { // Insert
row = MasterTable.get_dataItems()[index];
if (startend == "Start") {
dateTextBox = row.findControl("RenewalInsertStartDateRadMaskedTextBox");
}
else { // End
dateTextBox = row.findControl("RenewalInsertEndDateRadMaskedTextBox");
}
if (dateTextBox != null) {
dateControls[9] = dateTextBox;
ShowDatePopup(9, "TopRight", true);
}
}
}
<
asp:CustomValidator
ID
=
"CustomValidator1"
runat
=
"server"
ErrorMessage
=
"Duplicate product not allowed"
ControlToValidate
=
"RadComboBox1"
OnServerValidate
=
"CustomValidator1_ServerValidate"
>
Protected
Sub
CustomValidator1_ServerValidate(
ByVal
source
As
Object
,
ByVal
args
As
System.Web.UI.WebControls.ServerValidateEventArgs)
For
Each
dataItem
As
GridDataItem
In
RadGrid1.Items
If
args.Value =
CType
(dataItem(
"pk_productid"
).FindControl(
"RadComboBox1"
), RadComboBox).Text
Then
args.IsValid =
False
End
If
Next
End
Sub
foreach (var status in statuslist)
{
RadComboBoxItem item = new RadComboBoxItem(status.StockName, status.StockStatusID.ToString());
item.Attributes.Add("Class", status.StockColor);
RadComboBox1.Items.Add(item);
}
EnableRoundedCorners
="True" is set on the RadToolBar itself;
<
telerik:RadToolBar
ID
=
"RadToolBar4"
Height
=
"30px"
runat
=
"server"
Width
=
"100%"
Skin
=
"Black"
OnClientLoad
=
"clientLoad"
onbuttonclick
=
"RadToolBar4_ButtonClick"
CssClass
=
"SeparatedButtons"
OnClientDropDownOpened
=
"dropDownOpened"
EnableRoundedCorners
=
"True"
>
<
Items
>
<
telerik:RadToolBarButton
CommandName
=
"Dashboard"
Text
=
"Dashboard"
ID
=
"rbDashboard"
Font-Size
=
"Medium"
runat
=
"server"
Font-Names
=
"Microsoft Sans Serif"
BorderColor
=
"LightGray"
BorderStyle
=
"Solid"
BorderWidth
=
"1px"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
CommandName
=
"Documents"
ID
=
"rbDocuments"
runat
=
"server"
Text
=
"Documents"
Font-Names
=
"Microsoft Sans Serif"
Font-Size
=
"Medium"
BorderColor
=
"LightGray"
BorderStyle
=
"Solid"
BorderWidth
=
"1px"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
CommandName
=
"OrgChart"
ID
=
"rbOrgChart"
runat
=
"server"
Text
=
"Organization Chart"
Font-Size
=
"Medium"
Visible
=
"false"
BorderColor
=
"LightGray"
BorderStyle
=
"Solid"
BorderWidth
=
"1px"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarDropDown
Text
=
"Please Select"
Font-Size
=
"Medium"
CssClass
=
"rightAligned"
DropDownWidth
=
"220px"
BorderColor
=
"White"
BorderStyle
=
"Solid"
BorderWidth
=
"1px"
>
<
Buttons
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Profile"
Font-Size
=
"Medium"
CheckOnClick
=
"true"
CommandName
=
"ViewAccountProfile"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Contact Us"
Font-Size
=
"Medium"
CheckOnClick
=
"true"
CommandName
=
"ContactUs"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Sign Out"
Font-Size
=
"Medium"
CheckOnClick
=
"true"
CommandName
=
"SignOut"
>
</
telerik:RadToolBarButton
>
<%-- <
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Change Password"
Font-Size
=
"Medium"
CheckOnClick
=
"true"
CommandName
=
"ChangePassword"
>
</
telerik:RadToolBarButton
>--%>
</
Buttons
>
</
telerik:RadToolBarDropDown
>
</
Items
>
</
telerik:RadToolBar
>