Click or drag to resize
KaxNumericTextBoxDbValue Property
Gets or sets the data content of KaxNumericTextBox in a database friendly way.

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public virtual Object DbValue { get; set; }

Property Value

Type: Object
An object that represents the Text property. The default value is null.
Remarks
This property behaves exactly like the Value property. The only difference is that it will not throw an exception if the new value is not double object (or null). If you assign null to the control you will see blank KaxInput.
Examples

The following example demonstrates how to bind the KaxNumericTextBox:

[C#]

            </%@ Page Language="C#" /%>
</%@ Register Assembly="KaxInput.Net2" Namespace="Kettic.AspNetControls" TagPrefix="kaxI" /%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
System.Data.DataTable table = new System.Data.DataTable();
table.Columns.Add("num");

System.Data.DataRow row = table.NewRow();
row["num"] = (double)12.56;
table.Rows.Add(row);

row = table.NewRow();
row["num"] = (int)12;
table.Rows.Add(row);

row = table.NewRow();
row["num"] = DBNull.Value;
table.Rows.Add(row);

row = table.NewRow();
row["num"] = "33";
table.Rows.Add(row);

row = table.NewRow();
table.Rows.Add(row);

Repeater1.DataSource = table;
Repeater1.DataBind();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Repeater runat="server" ID="Repeater1">
<ItemTemplate>
<kaxI:KaxNumericTextBox DbValue='</%# Bind("num") /%>'
ID="KaxNumericTextBox1" runat="server">
</kaxI:KaxNumericTextBox>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>

[VisualBasic]

            </%@ Page Language="VB" /%>

</%@ Register Assembly="KaxInput.Net2" Namespace="Kettic.AspNetControls" TagPrefix="kaxI" /%>

<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim table As System.Data.DataTable = New System.Data.DataTable
table.Columns.Add("num")
Dim row As System.Data.DataRow = table.NewRow
row("num") = CType(12.56,Double)
table.Rows.Add(row)
row = table.NewRow
row("num") = CType(12,Integer)
table.Rows.Add(row)
row = table.NewRow
row("num") = DBNull.Value
table.Rows.Add(row)
row = table.NewRow
row("num") = "33"
table.Rows.Add(row)
row = table.NewRow
table.Rows.Add(row)
Repeater1.DataSource = table
Repeater1.DataBind
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Repeater runat="server" ID="Repeater1">
<ItemTemplate>
<kaxI:KaxNumericTextBox DbValue='</%# Bind("num") /%>'
ID="KaxNumericTextBox1" runat="server">
</kaxI:KaxNumericTextBox>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>
See Also