|
That would be great, by the way here is the code that I use:
row[totalIndex] = Convert.ToDecimal(row[i]).ToString("c", numberFormatInfo);<br />
Debug.WriteLine("VAL: "+Convert.ToDecimal(row[i]).ToString("c", numberFormatInfo));
So, Debug.Writeline statement gives me the proper value, but the value in datagrid (row[totalIndex]) is displayed without comma separators.
|
|
|
|
|
Hey
Try this
if ( column.IsMoney )
{
NumberFormatInfo numberFormatInfo = null;
numberFormatInfo = new NumberFormatInfo();
numberFormatInfo.CurrencySymbol = "";
this.dataGridColumn.Format = "c";
this.dataGridColumn.FormatInfo = numberFormatInfo;
}
else
{
this.dataGridColumn.Format = "";
this.dataGridColumn.FormatInfo = null;
}
|
|
|
|
|
Great. Worked like a charm.
Thank you very much. Is there an option on NumberFormatInfo object, so I don't have .00 following the numbers? I don't want the decimal potion displayed, since all of my dollar values are rounded off already.
Thank you again.
-- modified at 11:16 Monday 19th September, 2005
I figured it out. Thank you for your help.
|
|
|
|
|
Sorry, a very quick question.
If I have a currency symbol in fron of the values for each of the columns, can I do something, so that the symbol does not show up in fron of the values for the first 5 rows, and then shows up for the rest. I guess to do that I have to override the paint method. ANy ideas?
Thank you.
|
|
|
|
|
This is very difficult to achieve. You cantry to override
GetColumnValueAtRow and SetColumnValueAtRow.
|
|
|
|
|
I want to display a "table" of data on the screen. This "table" may contain 2000+ entries. I want to sort the columns, highlight an entire row, programmatically select entries, and be able to determine which row (or at least the key column) that was clicked.
I can do all of this using a ListView, but it is slow to display when I loop through all record from the database and add to the ListView. When I use a DataGrid, it is much faster loading, but I can't determine how to change the column headers or more importantly, how to determine when a record is clicked and/or which record is selected.
Can someone provide a pointer or two, or tell me I'm approaching this from the wrong angle?
Thanks,
Glenn
|
|
|
|
|
Read this: Top Questions about the DataGrid Web Server Control in MSDN Help
|
|
|
|
|
Turtle Hand wrote:
Read this: Top Questions about the DataGrid Web Server Control in MSDN Help
I found this article at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchTopQuestionsAboutASPNETDataGridServerControl.asp[^]. Quoting from the article:
The Web Forms DataGrid control is not the same as the Windows Forms equivalent. It is a common (and not unreasonable) assumption that they are the same control, or at least have identical functionality. However, the entire programming paradigm for Web Forms is quite different from that for Windows Forms.
I didn't mention it explicitly, but this is a Windows Forms application.
--G
-- modified at 16:26 Friday 16th September, 2005
|
|
|
|
|
|
I am trying to write an automation routine to upload a file to a secure webmail system. i have figgured out how to get the information into the fields available, but i am unable to figgure out how to click a javascript button. I am using the axWebBrowser control. any thoughts how to click login?
|
|
|
|
|
Once you get the document object you can get the button element using the all collection or walking the DOM until you get the button object. Then you just use the IHTMLElement click method to simulate the click. Make sure you use the IE interop objects which come with the framework rather then generating your own. They have an easier to use object model.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
How do you walk the DOM? I cant figgure out how to use the ALL collection because it needs a name and what i am trying to click on is a link not a button.(foud this out after ripping appart the HTML)the link activates some javascript.
|
|
|
|
|
Even easier then, you can use the anchors collection of the document object to find the link you need, then just call the click method on the object.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Awsome. thanks. now my only problem is how to force an INPUT Type=file to a specific value. according to the help, the value is read only from the programatic end.
|
|
|
|
|
I have also found that, after making an app that automates a process of acessing a web site to be able to download files from the site, as well as delete them, u can manaully POST the data to the server and get the right response, this can be used to be able to upload and download files, its a bit of a mess sometimes (because of the POST data u may need) but u can use apps like Fiddler http://www.fiddlertool.com/fiddler/[^]
its a good app for viewing requests and response across the net.
hope that helps a bit
|
|
|
|
|
I have a Panel Control containing a PictureBox in it
If I set a picture for PictureBox and the size of the PictureBox is large enough to show the ScrollBars of the Panel control
Infact I am trying to add the scrolling functionality to My PictureBox and scroll it programmatically
How do I programmatically set the values of the ScrollBars of the Panel control such that the center of the PictureBox is in the Center of the Panel control.
I have used the AutoScrollPosition property of the Panel control, but, can't find the solution to my problem (how to scroll to the center)
I hope you understand my problem
Hoping for a quick reply
Thank You
|
|
|
|
|
panel.AutoScrollPosition = new Point((pictureBox.Width - panel.ClientRectangle.Width) / 2, (pictureBox.Height - panel.ClientRectangle.Height) / 2);
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
Hello All,
I want to add rows to dataGrid dynamically without using the datasource property. My problem is that if I bind a source to dataGrid using its datasource property, and when new datacomes in my source, it doesn't reflect in the dataGrid. I have to rebind the datagrid using
dataGrid1.datasource = null;
dataGrid1.datasource = Source;
i don't want to do this...as it refreshes the grid and clears previously selected rows and cells in grid.
What I want to do is something like we do in listbox..
listbox1.items.add(".....");
Any suggesstions or help?..
Thanks
Ritesh Tijoriwala.
|
|
|
|
|
Hi,
How can I set a DateTime to return a null?
for example
DateTime dtDateTime = null; it doesn't work.
Thanks
Tony
|
|
|
|
|
|
Return year 0 date 1/1 time 00:00:00 or something, and specific milliseconds to. And then check it at return. Otherwise you could throw an exception that does that. And catch it higher.
Niklas Ulvinge aka IDK
|
|
|
|
|
Use DateTime.MinValue.
public static readonly DateTime MinValue;<br />
<br />
Remarks<br />
The value of this constant is equivalent to 00:00:00.0000000, January 1, 0001.
---
b { font-weight: normal; }
|
|
|
|
|
I got Microsoft Visual Studio 2005 Beta 2 and I developed a program. I asced some people to run it and they said it didn't.
How do I make it work on other computers?
Niklas Ulvinge aka IDK
|
|
|
|
|
They must have the same version of the .NET Framework installed as the one you used to develop the application. Since you used VS 2005, they need to have the .NET Framework 2.0 Beta installed.
But, this is not as simple as it may seem. You can't just download the .NET Framework 2.0 redistributable package and install it anywhere. It's still a Beta and not authorized for release.
See this[^] page for more information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In all practicality, though, I can't imagine anyone will be upset if he makes his users install the 2.0 beta, assuming this is "see what I did" kind of thing as he made it sound.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|