Footer Dataformat
-
Hi all, I have a datagrid with some cost information. In the footer for column totalcost, i have calculated the total cost of all items in the grid. The problem is that the footer dataformat is not in the format $100.00, instead it is in the format 100. The items in that column are in the correct format because when i created the column i set the dataformatstring property to {0:c}. Why doesn't that carry over to the footer? How do I set that in the footer? Thanks.
-
Hi all, I have a datagrid with some cost information. In the footer for column totalcost, i have calculated the total cost of all items in the grid. The problem is that the footer dataformat is not in the format $100.00, instead it is in the format 100. The items in that column are in the correct format because when i created the column i set the dataformatstring property to {0:c}. Why doesn't that carry over to the footer? How do I set that in the footer? Thanks.
-
-
The grid is a shopping cart. I add a row to the cart when the user selects an addtocart button. In the onclick event, i am calculating and populating the cell. gridShoppingCart.Columns[3].FooterText = dtCart.Compute("Sum(TotalValue)", "").ToString();
-
The grid is a shopping cart. I add a row to the cart when the user selects an addtocart button. In the onclick event, i am calculating and populating the cell. gridShoppingCart.Columns[3].FooterText = dtCart.Compute("Sum(TotalValue)", "").ToString();
gridShoppingCart.Columns[3].FooterText = **string.format("{0:C}",** dtCart.Compute("Sum(TotalValue)", ""));
would be one way. regards, Paul Watson Bluegrass South Africa Chris Maunder wrote: "I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly." Jon Sagara replied: "I think we've all been in that situation before." Crikey! ain't life grand? -
snap, except I highlighted my code... though you actually used the correct syntax case :-D regards, Paul Watson Bluegrass South Africa Chris Maunder wrote: "I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly." Jon Sagara replied: "I think we've all been in that situation before." Crikey! ain't life grand?
-
snap, except I highlighted my code... though you actually used the correct syntax case :-D regards, Paul Watson Bluegrass South Africa Chris Maunder wrote: "I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly." Jon Sagara replied: "I think we've all been in that situation before." Crikey! ain't life grand?
-
gridShoppingCart.Columns[3].FooterText = **string.format("{0:C}",** dtCart.Compute("Sum(TotalValue)", ""));
would be one way. regards, Paul Watson Bluegrass South Africa Chris Maunder wrote: "I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly." Jon Sagara replied: "I think we've all been in that situation before." Crikey! ain't life grand? -
-
-
Marcie, Silly question. Is there a way to convert it back to just the string 15.00, using the String.Format function? Or should I just remove the $ manually?
Depending on what you're looking for, you may want to use a different format, see this post for some good examples: String Formatting Marcie P.S. It wasn't a silly question :) CP Blog[^]