This is a migrated thread and some comments may be shown as answers.

Numeric Text Box Increment

4 Answers 603 Views
Input
This is a migrated thread and some comments may be shown as answers.
Madhu
Top achievements
Rank 1
Madhu asked on 24 Jul 2008, 04:00 PM
Hi,

I am newbie for Telerik and I need help with Numeric Text Box.

Is it possible to increment/decrement values by .01 when button clicked. I have max value of 2.99 and min value of 0.9.

It should go like this: 0.9, 0.91, 0.92 and so on. Same with decrement.

I would appreciate any help, preferably with sample code.

thanks
Madhu

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 24 Jul 2008, 05:26 PM
Hi Madhu,

Thank you for your interest in Telerik RadControls.

When using RadNumericTextBox, you can specify the increment/decrement values by setting the Step property. For example:

<telerik:RadNumericTextBox  ShowSpinButtons="True">  
    <IncrementSettings  Step="0.01" /> 
</telerik:RadNumericTextBox> 


You can refer to the following help article for additional information on using RadNumericTextBox:

http://www.telerik.com/help/aspnet-ajax/input_radnumerictextbox.html


Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Madhu
Top achievements
Rank 1
answered on 04 Aug 2008, 09:34 PM
Dimo,

thanks for the quick answer. I searched the forums but couldn't find what I am looking for. Looking for some guidance on how to go about this:

I need to create grid dynamically showing footer total. Editable fields must be numeric only.

I was able to create the grid and set the fields to editable. Now how do I make some of the columns readonly and get columns total at the footer.

When user edits any numeric field, other fields in the grid will be changed as well as there will be complex calculation.

Any direction will be much appreciated.

thanks
Madhu
0
Sebastian
Telerik team
answered on 05 Aug 2008, 06:14 AM
Hi Madhu,

I think that the information/code snippets from the following online demos will help you attain the functionality  you are searching for:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Controls/Examples/Integration/GridAndInput/DefaultCS.aspx?product=grid
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/GeneralFeatures/Aggregates/DefaultCS.aspx
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/GeneralFeatures/CalculatedColumns/DefaultCS.aspx

They illustrate how to calculate totals dynamically client-side (using RadNumericTextBoxes) and how to use footer aggregates/calculated columns to present summaries for read-only columns.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Madhu
Top achievements
Rank 1
answered on 17 Sep 2008, 02:05 PM

Sorry for not being clear on my question. I have created Grid dynamically (Simply Grid is defined in .aspx file, columns are bind from code behind., no hard coded column Name) I have Combo Box outside the grid, gird loads with different column as item changes in Combo Box. 

protected

void grdSystemComponents_ItemCreated(object sender, GridItemEventArgs e){
if

(e.Item is GridDataItem && e.Item.IsInEditMode || e.Item is GridFilteringItem)
{
foreach (GridColumn column in e.Item.OwnerTableView.RenderColumns)
{
if ((column is GridBoundColumn) && !((GridBoundColumn)column).ReadOnly)
{
TextBox textBox = null;
if (e.Item is GridDataItem)
{
textBox = ((
TextBox)((GridDataItem)e.Item)[column.UniqueName].Controls[0]);
textBox.Style[
"width"] = "90%";
textBox.Style[
"height"] = "11px";
textBox.Style[
"border"] = "0px";
textBox.Style[
"font-size"] = "11px";
} }

//Each column is assigned UniqueName as ID of respective Column
string
headerID = column.HeaderText;
int count = dtHeaderInfo.Rows.Count;
for (int i = 0; i < count; i++)
{
if (headerID == dtHeaderInfo.Rows[i][0].ToString())
column.UniqueName = dtHeaderInfo.Rows[i][0].ToString();
} } } }

Here are my two Issues:

1) Since Grid is set up this way, I have no idea how to calculate Footer Total for each columns. Number of column changes depending on the selected Item on Combo Box.

2) I also need to update Caluculation as user will enter number on textboxes of the Grid. In the grid, there is a column called "Tot Num", as user enter numbers here I need to update other columns on same row, user can change it but can't exceed value of "Tot Num" column. If "Tot Number" is zero, should not allow to enter number.

I need to have database interaction for calculation? How do I go go to accomplish this? Your help is much appreciated.

thansk
Madhu

Tags
Input
Asked by
Madhu
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Madhu
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or