Forms Data Controls :: Put Bracket For Negative Numbers?
Aug 6, 2010
I have a gridview that calculate net balance by taking deposit - withdraw. So when the withdraw is more than the deposit, it will result in a negative value, how do I detect that and replace the minus sign with bracket?
[code]....
View 10 Replies
Similar Messages:
Oct 19, 2010
I have the following issue where I cannot seem to display a negative number and the result seems to stay on zero.
The code is as follows:
[code]...
In my code iNumber1 = 108 and iNumber2=27 however when the result is divided again by 108 the answer seems to stay on 108. I tried using doubles but with no luck.
View 3 Replies
Sep 7, 2010
I have negative numbers in my report and I wish to display them with a "<" sign.
View 5 Replies
Oct 22, 2010
We have a large ASP.NET MVC project where all numbers output to the screen are formatted as currency (i.e. ToString("c"). However, negative numbers are showing up with ()'s. For example:
decimal d = -8.88m;
Console.WriteLine(d.ToString("c"));
//outputs $(8.88)
This is a bit annoying to our users, particularly since there are in textboxes. We have a few thousand places where we send currency fields to the screen like this, so we'd love a way to change the formatting globally. Is there one? All the methods I've seen indicate that you have to create a new formatter, similar to this:
string curCulture = System.Threading.Thread.CurrentThread.CurrentCulture.ToString();
System.Globalization.NumberFormatInfo currencyFormat =
new System.Globalization.CultureInfo(curCulture).NumberFormat;
currencyFormat.CurrencyNegativePattern = 1;
We'd prefer not to change all of our ToString("c") methods ... is there a better way? My first thought was to just change our locale to Australia, but realized the date formatting would be screwed up.
View 2 Replies
Apr 8, 2010
I have a GridView that populates the days between the start and end date. What i want to ask is that is it possible to display a word "Overdue" (If possible "Overdue by 7 days") when the datediff is negative (eg: -7 days) The following are parts my codes for now:
<asp:TemplateField HeaderText="Date Raised" SortExpression="DateRaised">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("DateRaised","{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Expected Close Date" SortExpression="DateClose">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("DateClose","{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DaysTaken" HeaderText="Allocated Days" />
<asp:BoundField DataField="RemainingDays" HeaderText="Remaining Days" />
<asp:SqlDataSource ID="SqlDS_UnresolvedIssues" runat="server"
ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString_PITLog %>"
SelectCommand="SELECT [IssueLog].[DateRaised], [IssueLog].[DateClose], DATEDIFF(dd,DateRaised,DateClose) AS DaysTaken, DATEDIFF(dd, GETDATE() ,DateClose) AS RemainingDays FROM [IssueLog]
INNER JOIN [ActDetails] ON [IssueLog].[ActID]=[ActDetails].[ActID] WHERE [ActDetails].[ProjID]=@ProjID AND [ActDetails].[DevPhase]=@DevPhase AND NOT [IssueLog].[IssueStatus]=@IssueStatus">
<SelectParameters>
<asp:ControlParameter ControlID="DD_PMProjID" Name="ProjID" />
<asp:ControlParameter ControlID="DD_DevPhase" Name="DevPhase" />
<asp:Parameter DefaultValue="COMP" Name="IssueStatus" />
</SelectParameters>
</asp:SqlDataSource>
By the way, I am using Web Developer 2008, VB.net.
View 11 Replies
May 20, 2010
This is my first attempt at paging on a listview. The first time my page loads it loads the listview fine, but when I try to use the paging I get the following error:
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Here's my code:
[code].....
When I take the following line out I don't get the error, but i need it to populate my controls:
DataKey currentDataKey = this.lvReports.DataKeys[currentItem.DataItemIndex];
View 8 Replies
Mar 1, 2011
i am trying to do a really simple thing but it won't work...
[Code]....
this is the error i get
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
i can see different columns in gridview but when hidding gives me error
View 1 Replies
Jul 29, 2010
I have the following problem, i am using gridview to display some table info,, and during RowDataBound event i am binding another DataList control placed on gridview template column,,, the problem is that the DataBind() event of the gridview gives "Index 1 is either negative or above rows count." error.
I debugged alot,, when you disable the DataList binding it works,, but why the 2 not working together i dont know!!.
Below my Code in
Code Behind:
using System;
View 4 Replies
Jan 26, 2011
I have gridview like this.
[Code]....
is index was out of range must be non negative and less than the size of the collection
View 7 Replies
Dec 13, 2010
I have a gridview that displays the total hours and employee works. I also have another column in the gridview that shows the difference from the hours worked and 8.5. I want the column that shows the difference to display the number in red whenever the number is a negative.
The gridview looks like:
Time In
Time Out
Hours Worked
Difference
7:30:00 AM
3:58:00 PM
8.47
-0.03
I would like it to look like:
Time In
Time Out
Hours Worked
Difference
7:30:00 AM
3:58:00 PM
8.47
-0.03
View 20 Replies
Mar 30, 2011
I've used <%# Container.ItemIndex + 1 %> to successfully add line/row numbers inside of a repeater control starting with 1, but I've run into a challenge where I need the line numbers to begin at row 50.
View 4 Replies
May 6, 2010
I have Gridview populated with few rows , sometimes in few pages set suppose 12 rows in 3 pages as page size is set to 5 per page. I want the footer to display something like this
while displayin page 1 :
displaying page 1 of 3 - items shown 0 to 5 of 12
while displayin page 2 :
displaying page 2 of 3 - items shown 6 to 10 of 12
while displayin page 3 :
displaying page 3 of 3 - items shown 11 to 12 of 12
View 4 Replies
Dec 28, 2010
I've a form where I'd like to impede the user from entering any alphabits or special characters. The user can only enter numbers between 0 & 3( both inclusive) no more no less.
How can i achieve this ? I've used RangeValidator. Would this alone be suffice or do we also need to use Expression Validator ?
Here is what I've used :
<asp:RangeValidator ID="RangeValidator0" runat="server" ErrorMessage="Enter values between 0 & 3" ForeColor="Red" ControlToValidate="q1tb1" MinimumValue="0" MaximumValue="3" SetFocusOnError="true" Type="Integer"
ValidationGroup="rangeCheck">
I just want the focus to be in the same texbox if the user enters other than 0,1,2,3.
View 5 Replies
Oct 28, 2010
I'd like to position the Pager numbers in a GridView control at a set position on each page, regardless of the number of records returned.
e.g. Even if only a few are returned, I'd still like to have the pager controls at the bottom of the screen.
Is this possible? VS tells me I can't use a div
View 5 Replies
Oct 4, 2010
I have a gridview that I loop through to get the x and y values of the chart control, and upon the first execution of this code, it looks great. But when the page posts back and it "refreshes" data, the original points on the chart control are still there, as well as the new values.
Is there any way to "delete" all data in the chart control to ensure this doesn't happen?
View 1 Replies
May 7, 2010
I have a small table that has ratings for a album let's say.
Instead of showing the rating from 1-4 I want to show start instead
Rating 1 the 1 star
Rating 3 3 stars
Rating 0 no star
etc.
I have an tiny int field in the table and I will make a drop down list to allow 0-4
Currently I have a list view to show the list of comments and ratings but not sure how to convert the 0-4 from tiny int to a the same amount of stars
View 2 Replies
Feb 9, 2010
I am customizing the asp:PasswordRecovery control by adding an own UserNameTemplate. This all works fine, but as soon as I am adding any "Angle Bracket Percent" (<%=) into the UserNameTemplate, the entire PasswordRecovery control falls back to the default design and doesn't use my own UserNameTemplate anymore.
For instance, if I customize a asp:PasswordRecovery control as follows, it works fine ...
[Code]....
... but when I add <%= "Hello world" %> it uses the default layout:
[Code]....
Is this a bug or do I need to change anything? Using Angle Bracket Percent in asp:Login (within LayoutTemplate) works fine, but not in asp:PasswordRecovery. The reason why I need/want to use Angle Bracket Percent is because I want to get localized text out of an XML file (e.g. "<%= GetText("ForgotPassword.Introduction") %>"). However, this shouldn't be the problem as asp:PasswordRecovery even breaks if I use the "<%= "Hello world" %> phrase in the example stated above.
View 3 Replies
Sep 27, 2010
inserted a data grid view control with paging.What I don't like is when the user hovers the numbers for the paging, the autoformat is classic, when the user hovers, there is a white box and the number dissapears because the box and the number have the same color,
View 3 Replies
Nov 3, 2010
I have a gridview control sitting in a jQuery Accordian. The data in the grid diplays fine, however in IE 6 the page numbers do not display when the pane of the accordian is first opened. If you open another pane and then re-open the pane containing the grid view the number appear. There is also no issue with IE7 or later or FF.
View 2 Replies
Feb 23, 2010
I had a repeater that will be binded using dataset
[Code]....
and on page load I write this code
[Code]....
it worked very well on my machine , after applying it on the server it give the following error
Server Error in '/' Application.
Number must be either non-negative or -1. Parameter name: millisecondsTimeout Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Number must be either non-negative or -1. Parameter name: millisecondsTimeoutSource Error:
[Code]....
Stack Trace:
[Code]....
View 3 Replies
Mar 10, 2010
I got below code from [URL] aspx for adding custom property in webpart tool pane. What does square bracket ([]) mean in the below code?
[Category("Custom Properties")]
[WebPartStorage(Storage.Personal)]
[FriendlyNameAttribute("Custom Color")]
[Description("Select a color from the dropdown list.")]
[Browsable(true)]
[XmlElement(typeof(System.Drawing.KnownColor))]
public System.Drawing.KnownColor MyColor
{
get
{
return _myColor;
}
set
{
_myColor = value;
}
}
View 2 Replies
Feb 15, 2011
I would like to to make a UI with a panel of numbers, and when hovered above one of them ten the number becomes larger. something like that:
[URL]
I want that when I press a numbers it shows it's value in some other textbox. In which .NET technology is it possible to do it? Windows Forms? WPF? other?
View 6 Replies
Oct 22, 2010
I am asked to save and output a tournament bracket, like NCAA or US Open, two parties play and the winner move on to next round. To display the whole bracket, I need to find a way to maintain the hierarchy, say I have the following class:
[Code]....
This is good for a single contest inside the tournament, but how do I change the class or use other classes to support hierarchy? Also if possible can someone show me the best way to model this in SQL server tables?
View 2 Replies
Oct 23, 2010
I need an algorithm to determine who match who in the tournament bracket, say I have 32 ( number could be flexible) contestants seeded 1 to 32, at round 1, seed 1 matches with 32, seed 2 with 31 and so forth. What about 2nd, 3rd, 4th and 5th round? I need an algorithm to be programmed into computer.
View 3 Replies
Feb 3, 2010
I currently designed a school result portal. If the students want to view their result, they input their student school number in a text box to search out their result. But this is not secured because anybody can look up any students result if you have the number which is even written on their school uniform for identification.
I have being trying to secure this result by trying to generate or code special numbers that the students will input with their school number. The special numbers will be random numbers and may be from 10 and above, it might even contain letters. How do
I code this. I believe this is the best asp.net forum. I want the students to be inputing this special unique numbers and their student numbers so that there result will be avaliable to them.
View 2 Replies