.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

how to display amount in words

Posted By: Catherine     Posted Date: June 13, 2011    Points:5   Category :C#
Hi i bind the name,id,salary in gridview. In footer i calculated sum of salary. no i would like to display the total in words after the gridview. how to do this. where i call function and what code i have to write please tell.

Responses
Author: Gowthammanju             
Posted Date: June 13, 2011     Points: 20   

hey

modify ur codings as

<asp:TemplateField HeaderText="yourTextColumn" SortExpression="yourTextColumn">

<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("yourTextColumn").ToString().Substring(0,Math.Min(30,Eval("yourTextColumn").Length)) %>' />
</ItemTemplate>
</asp:TemplateField>


u will find solution

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Gowthammanju             
Posted Date: June 13, 2011     Points: 20   

IF YOU ARE HAVING PAGING then you have to follow this code.

GridView g = new GridView();
g = This.Gridview1;
g.Databind();
int sum;
for (int i = 0; i < g.PageCount; i++)
{
g.PageIndex = i;
for (int j = 0; j < g.Rows.Count; j++)
{
GridViewRow gr = g.Rows[j];
Label lblAmt = (Label)gr.FindControl("Amount");
sum+=Convert.Toint(lblAmt.Text);
}
}


Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Sasi Prabhu             
Posted Date: June 13, 2011     Points: 20   
Author: Gowthammanju             
Posted Date: June 13, 2011     Points: 20   

look at these articles below

http://www.dotnetspark.com/kb/4188-number-to-word-generator.aspx

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: shiv chandra             
Posted Date: June 14, 2011     Points: 20   
Author: Ravi Ranjan Kumar             
Posted Date: June 16, 2011     Points: 20   

Hey Catherine Check out another link having same question with perfect solution to convert amount to words
http://www.daniweb.com/software-development/csharp/threads/235307
I hope it might help you.

Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: shiv chandra             
Posted Date: June 18, 2011     Points: 20   
Author: Narayanan             
Posted Date: July 12, 2011     Points: 20   

Hi,
Try this link
http://forums.asp.net/p/1479517/3450449.aspx


Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend