Hi,
My team is having an issue with the NumericTextBox and the developer currently having the issue asked that I post his question in the forum on his behalf since he is having a technical issue with his workstation that is preventing him from posting himself.
"Using the NumericTextbox, I am seeing behavior that is not the way that I want or expect. I have a MinValue="0" and a MaxValue="100". I have a InvalidStyleDuration="2000000".
When the user enters -1, the textbox border turns red and there is an invalid icon in the textbox. What is happening that I don't want is that the -1 value that was entered is replaced by the MinValue, 0. How can I get the entered value, -1, to remain in the textbox?"
Thanks,
Andrew
When the user hits the Save button and validation takes place, is there a way for invalid values in the NumericTextBox control, for example value entered is less than the MinValue, to be displayed in the ValidationSummary control without hooking up an additional asp.net validation control?"
Thanks,
Andrew
I have been experimenting both with the User Control and Template Edit Form Type (currently I am working with the Template). There have been a few issues based on how I'm coding it:
Is there a sample somewhere on the Telerik site that follows a similar approach? I haven't been able to find anything that mimics this behavior, but perhaps I am searching for the wrong thing or describing it wrong.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
style
=
"margin-top:25px;"
AutoGenerateColumns
=
"true"
oncolumncreated
=
"RadGrid1_ColumnCreated"
>
<
MasterTableView
TableLayout
=
"Fixed"
/>
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
<
Selecting
AllowRowSelect
=
"False"
/>
<
ClientEvents
/>
<
Scrolling
AllowScroll
=
"True"
/>
<
Resizing
AllowColumnResize
=
"true"
AllowResizeToFit
=
"true"
ResizeGridOnColumnResize
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
using
System;
using
System.Collections.Generic;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
Telerik.Web.UI;
using
System.Data;
using
myNameSpace.BusinessLogic.myLogic;
namespace
myNameSpace
{
public
partial
class
myScreen : System.Web.UI.UserControl
{
private
MyController myController =
new
MyController();
protected
void
Page_Load(
object
sender, EventArgs e)
{
DataTable dt =
new
DataTable();
List<Guid> thisPositionIds = myController.GetPositionIDs();
// add 1st column, the Item
dt.Columns.Add(
"Item"
);
// make the Annual Costs columns
foreach
(Guid positionId
in
thisPositionIds)
{
// add a column
dt.Columns.Add(
new
DataColumn(myController.GetPositionName(positionId)
+ System.Environment.NewLine +
"Annual Costs"
,
System.Type.GetType(
"System.Decimal"
)));
}
// get the data for the rows
List<Guid> thisItemIds = myController.GetItemIDs();
foreach
(Guid itemID
in
thisItemIds)
{
DataRow dr = dt.NewRow();
// enter the first column, the Item Name
dr[
"Item"
] = myController.GetItemName(itemID);
// enter the final set of columns, the Annual Costs
foreach
(Guid positionId
in
thisPositionIds)
{
dr[myController.GetPositionName(positionId) + System.Environment.NewLine +
"Annual Costs"
]
= myController.GetAnnualCosts(itemID, positionId);
}
dt.Rows.Add(dr);
}
RadGrid1.DataSource = dt;
RadGrid1.DataBind();
}
protected
void
RadGrid1_ColumnCreated(
object
sender, GridColumnCreatedEventArgs e)
{
if
(e.Column.ColumnType ==
"GridBoundColumn"
)
{
// get column header text
string
colName = e.Column.UniqueName;
// get last 12 chars of text (if it is long enough)
string
colNameEnd;
if
(colName.Length >= 12)
colNameEnd = colName.Substring(colName.Length - 12, 12);
else
colNameEnd =
"x"
;
// format according to which column this
if
(colName ==
"Item"
)
e.Column.HeaderStyle.Width = Unit.Pixel(80);
else
if
(colNameEnd ==
"Annual Costs"
)
{
(e.Column
as
GridBoundColumn).DataFormatString =
"{0:C}"
;
}
}
}
}
}
OnSelectedIndexChanged="cbProductItems_SelectedIndexChanged"
cbProductItems.ClearSelection();
cbProductItems.DataBind();