<
telerik:GridTemplateColumn
HeaderText
=
"Status"
SortExpression
=
"MarketingStatusTypeName"
DataField
=
"MarketingStatusTypeName"
UniqueName
=
"MarketingStatusTypeName"
Groupable
=
"False"
Reorderable
=
"False"
>
<
ItemTemplate
>
<
telerik:RadComboBox
ID
=
"GridStatusDropDown"
runat
=
"server"
DataTextField
=
"MarketingStatusTypeName"
AutoPostBack
=
"true"
DataValueField
=
"MarketingStatusTypeID"
OnSelectedIndexChanged
=
"GridStatusDropDown_SelectedIndexChanged"
/>
</
ItemTemplate
>
<
ItemStyle
VerticalAlign
=
"Middle"
/>
</
telerik:GridTemplateColumn
>
The RadTextbox accept only numbers and decimail. How to use this validation expression for only accept 2 digits after decimal point. Example: 12.12, 123.23, 1234.12, 12345.67 like this.
I tried 2 ways.
1. ^((?:[1-9]\d*)|(?:(?=[\d.]+)(?:[1-9]\d*|0).\d+))$ --> This expression working fine but i need to accept only two digits after the decimal point.
public void Textbox1_OnTextChanged(object sender, EventArgs e)
{
if (Regex.IsMatch(Textbox1.Text, @"^((?:[1-9]\d*)|(?:(?=[\d.]+)(?:[1-9]\d*|0).\d+))$ "))
{
CalculationSummary();
}
else
{
RadAjaxManager1.Alert("Please enter only numerics.");
}
}
****or****
^(\d+)?+([\.]{1})?+([\d]{1,2})?$ --> This expression working good. It accepts only two digits after the decimal point. but i got error below condition.
public void Textbox1_OnTextChanged(object sender, EventArgs e)
{
if (Regex.IsMatch(Textbox1.Text, @"^(\d+)?+([\.]{1})?+([\d]{1,2})?$"))
{
CalculationSummary();
}
else
{
RadAjaxManager1.Alert("Please enter only numerics.");
}
}
Can anybody please let me know the possible solution. Thanke in advance.
<
telerik:OpenAccessLinqDataSource
ID
=
"oaldsMap"
Runat
=
"server"
ContextTypeName
=
"HRSystemModel.HRContext"
EntityTypeName
=
""
ResourceSetName
=
"EMaps"
Select
=
"new (EMapName, ECaption)"
Where
=
"EProcedureName == @EProcedureName"
>
<
WhereParameters
>
<
asp:ControlParameter
ControlID
=
"rtbProcedure"
Name
=
"EProcedureName"
PropertyName
=
"Text"
Type
=
"String"
/>
</
WhereParameters
>
</
telerik:OpenAccessLinqDataSource
>
<
telerik:OpenAccessLinqDataSource
ID
=
"oaldsStage"
Runat
=
"server"
ContextTypeName
=
"HRSystemModel.HRContext"
EntityTypeName
=
""
OrderBy
=
"ECaption"
ResourceSetName
=
"EStages"
Select
=
"new (EStageName,ECaption)"
Where
=
"EMapName == @EMapName"
>
<
WhereParameters
>
<
asp:ControlParameter
ControlID
=
"cmbMapNames"
DefaultValue
=
""
Name
=
"EMapName"
PropertyName
=
"SelectedValue"
Type
=
"String"
/>
</
WhereParameters
>
</
telerik:OpenAccessLinqDataSource
>
<
telerik:OpenAccessLinqDataSource
ID
=
"oaldsAction"
Runat
=
"server"
ContextTypeName
=
"HRSystemModel.HRContext"
EntityTypeName
=
""
ResourceSetName
=
"EActions"
Select
=
"new (EActionName, ECaption)"
Where
=
"EStageName == @EStageName && EMapName == @EMapName"
>
<
WhereParameters
>
<
asp:ControlParameter
ControlID
=
"cmbStageName"
DefaultValue
=
""
Name
=
"EStageName"
PropertyName
=
"SelectedValue"
Type
=
"String"
/>
<
asp:ControlParameter
ControlID
=
"cmbMapNames"
DefaultValue
=
""
Name
=
"EMapName"
PropertyName
=
"SelectedValue"
Type
=
"String"
/>
</
WhereParameters
>
</
telerik:OpenAccessLinqDataSource
>
protected
void
DisplayEditForm(GridDataItem selectedItem)
{
PlaceHolder.FindControl(
"pnlExternalForm"
).Visible =
true
;
(PlaceHolder.FindControl(
"btnSaveChanges"
)
as
Button).Text =
"Update"
;
(PlaceHolder.FindControl(
"cmbMapNames"
)
as
RadComboBox).FindItemByText(selectedItem[
"MMap"
].Text).Selected =
true
;
(PlaceHolder.FindControl(
"cmbStageName"
)
as
RadComboBox).FindItemByText(selectedItem[
"MStage"
].Text).Selected =
true
;
(PlaceHolder.FindControl(
"cmbAction"
)
as
RadComboBox).FindItemByText(selectedItem[
"MAction"
].Text).Selected =
true
;
}
PlaceHolder.FindControl(
"cmbMapNames"
). Always.
It throws a need to create new object error... and I have checked to confirm that it's not the dropdown but the list item that it can't find.<
script
type
=
"text/javascript"
>
// ritorna valore selezionato Anagrafica
function LoadProfilo(sender, eventArgs) {
var arg = eventArgs.get_argument();
if (arg == 1) {
window.location.href("profile.aspx");
}
}
</
script
>
<
telerik:RadWindow
ID
=
"RadWindowProfileconfirm"
runat
=
"server"
ShowContentDuringLoad
=
"false"
Width
=
"435px"
Height
=
"166px"
Title
=
"Aggiornamento profilo"
Behaviors
=
"None"
MaxHeight
=
"166"
MaxWidth
=
"435"
Modal
=
"True"
Behavior
=
"None"
Font-Names
=
"Verdana"
Font-Size
=
"Small"
IconUrl
=
"/image/iconlogo.png"
ToolTip
=
"Aggiornamento profilo"
OnClientClose
=
"LoadProfilo"
VisibleStatusbar
=
"False"
NavigateUrl
=
"register_step2.aspx"
Skin
=
"Simple"
ReloadOnShow
=
"True"
>
</
telerik:RadWindow
>
Dim
script
As
String
=
"function f(){$find("
""
+ RadWindowProfileconfirm.ClientID +
""
").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
ScriptManager.RegisterStartupScript(Page, Page.
GetType
(),
"key"
, script,
True
)
<
script
type
=
"text/javascript"
>
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function Close_and_Load() {
var arg = new Object();
arg = 1
GetRadWindow().close(arg);
}
</
script
>
Protected
Sub
ImgBtncontinua_Click(sender
As
Object
, e
As
System.Web.UI.ImageClickEventArgs)
Handles
ImgBtncontinua.Click
ScriptManager.RegisterStartupScript(Page,
Me
.
GetType
,
"close"
,
"Close_and_Load();"
,
True
)
End
Sub