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

Formatting iban 24 digits as number.. ??

2 Answers 173 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adem
Top achievements
Rank 1
Adem asked on 19 Nov 2012, 10:17 PM
Hi.

i am having trouble about saving long numbers in my oracle database. :( i am trying to save some iban numbers (Exp: TR24 1234 2569 6963 5489 4589 12) . In order to view it in RadGrid with datastringformat property; as i read from the from pages; i have to save the digits in "number" datatype. So i seperated the TR part and the digits. but when i insert the long number (TR241234256969635489458912) into digit part in the oracle database, it shows it with exponent. and in RadGrid it shows 0s instead of numbers after some values. :(

i really could ont find the answer in the form.. 

Can you please help me to find a way to view it as shown below? 

           Oracle Database: RadGrid:
(TR241234256969635489458912     >>>>  TR24 1234 2569 6963 5489 4589 12

thank you.

2 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 22 Nov 2012, 09:52 AM
Hello Adem,

In order to achieve your scenario you could subscribe to RadGrid ItemDataBound event and manually format the value there as shown in the example below. Note that you should use the id of the TextBox control or find it in the GridDataItem Controls collection.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        TextBox textBox = e.Item.FindControl("TextBoxId") as TextBox;
        textBox.Text = FormatValue(textBox.Text);
    }
}
 
private string FormatValue(string value)
{
    //code logic for formating the value
    return value;
}

Greetings,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Adem
Top achievements
Rank 1
answered on 22 Nov 2012, 09:03 PM
THANKS FOR YOUR HELP AGAIN!!

IT REALLY WORKED!!

Adem.
Tags
Grid
Asked by
Adem
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Adem
Top achievements
Rank 1
Share this question
or