Click here to Skip to main content
15,892,199 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# launches another program Pin
ipstefan8-Jan-09 0:12
ipstefan8-Jan-09 0:12 
AnswerRe: C# launches another program Pin
HosamAly8-Jan-09 0:09
HosamAly8-Jan-09 0:09 
GeneralRe: C# launches another program Pin
ipstefan8-Jan-09 0:15
ipstefan8-Jan-09 0:15 
GeneralRe: C# launches another program Pin
HosamAly8-Jan-09 5:38
HosamAly8-Jan-09 5:38 
QuestionForcina a space or suppressing zeroes in Data Grid Pin
Vanq20097-Jan-09 7:53
Vanq20097-Jan-09 7:53 
AnswerRe: Forcina a space or suppressing zeroes in Data Grid Pin
Henry Minute7-Jan-09 9:08
Henry Minute7-Jan-09 9:08 
QuestionRe: Forcina a space or suppressing zeroes in Data Grid Pin
Vanq20097-Jan-09 10:38
Vanq20097-Jan-09 10:38 
AnswerRe: Forcina a space or suppressing zeroes in Data Grid Pin
Henry Minute7-Jan-09 11:02
Henry Minute7-Jan-09 11:02 
Ok. We all have to start somewhere.

1. Make sure your Form with the DataGridView is visible in the designer with the DataGridView selected.
2. Make sure that you can see the Properties Window. If you can't then select it from the View Menu in VS or, a good tip, press F4.
3. At the top of the Properties Window there are several icons, click on the lightening bolt. This will take you to the events for the selected control, hopefully
your DataGridView. If not select it now.
4. The events can be organised in many ways. Alphabetically or in categories for example, so I cannot tell you exactly where the CellFormatting event
will be on your system. Search for it, and double click on it.
5. The designer will switch to code view with an empty event handler method for the CellFormatting event. Like this:
private void Grid_Property_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{

}

6. Put your code between the braces. Your code should look like this:
// return if value is null
if (e.Value == null)
{
    return;
}

// get the column triggering the event
DataGridViewColumn col = this.Grid_Property.Columns[e.ColumnIndex];

// if it is the column you want
if (col.DataPropertyName == "pDiff")
{
    // Format data source value how you like
    if (e.Value.ToString() == "-Infinity")
    {
        e.Value = "";

            // very important. Prevents the standard text formatting
            e.FormattingApplied = true;
    }
}


Try that.

Henry Minute

If you open a can of worms, any viable solution *MUST* involve a larger can.

GeneralRe: Forcina a space or suppressing zeroes in Data Grid Pin
Vanq20098-Jan-09 2:02
Vanq20098-Jan-09 2:02 
QuestionFileSystemWatcher Events Fired Twice Pin
#realJSOP7-Jan-09 5:58
mve#realJSOP7-Jan-09 5:58 
AnswerRe: FileSystemWatcher Events Fired Twice Pin
Dave Kreskowiak7-Jan-09 6:15
mveDave Kreskowiak7-Jan-09 6:15 
GeneralRe: FileSystemWatcher Events Fired Twice Pin
#realJSOP7-Jan-09 6:43
mve#realJSOP7-Jan-09 6:43 
GeneralRe: FileSystemWatcher Events Fired Twice Pin
Dave Kreskowiak7-Jan-09 8:01
mveDave Kreskowiak7-Jan-09 8:01 
GeneralRe: FileSystemWatcher Events Fired Twice Pin
Luc Pattyn7-Jan-09 6:25
sitebuilderLuc Pattyn7-Jan-09 6:25 
GeneralRe: FileSystemWatcher Events Fired Twice Pin
#realJSOP7-Jan-09 6:42
mve#realJSOP7-Jan-09 6:42 
GeneralRe: FileSystemWatcher Events Fired Twice Pin
Luc Pattyn7-Jan-09 6:49
sitebuilderLuc Pattyn7-Jan-09 6:49 
AnswerRe: FileSystemWatcher Events Fired Twice Pin
Not Active7-Jan-09 7:06
mentorNot Active7-Jan-09 7:06 
AnswerRe: FileSystemWatcher Events Fired Twice Pin
Jason C Bourne7-Jan-09 10:47
Jason C Bourne7-Jan-09 10:47 
QuestionStore Key / Value Pair Pin
mark_w_7-Jan-09 5:32
mark_w_7-Jan-09 5:32 
AnswerRe: Store Key / Value Pair Pin
S. Senthil Kumar7-Jan-09 5:47
S. Senthil Kumar7-Jan-09 5:47 
GeneralRe: Store Key / Value Pair Pin
mark_w_7-Jan-09 5:52
mark_w_7-Jan-09 5:52 
Questionretrieving the last increment value in a table Pin
bfis1081377-Jan-09 4:22
bfis1081377-Jan-09 4:22 
AnswerRe: retrieving the last increment value in a table Pin
Wendelius7-Jan-09 4:25
mentorWendelius7-Jan-09 4:25 
GeneralRe: retrieving the last increment value in a table Pin
bfis1081377-Jan-09 4:26
bfis1081377-Jan-09 4:26 
GeneralRe: retrieving the last increment value in a table Pin
Wendelius7-Jan-09 4:30
mentorWendelius7-Jan-09 4:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.