Click here to Skip to main content
15,901,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: SqlDataAdapter.Fill Pin
Wendelius7-Jan-09 10:29
mentorWendelius7-Jan-09 10:29 
GeneralRe: SqlDataAdapter.Fill Pin
Dave Kreskowiak7-Jan-09 10:46
mveDave Kreskowiak7-Jan-09 10:46 
GeneralRe: SqlDataAdapter.Fill Pin
Rutvik Dave7-Jan-09 10:15
professionalRutvik Dave7-Jan-09 10:15 
AnswerRe: SqlDataAdapter.Fill Pin
Le centriste8-Jan-09 3:37
Le centriste8-Jan-09 3:37 
QuestionC# launches another program Pin
ipstefan7-Jan-09 8:29
ipstefan7-Jan-09 8:29 
AnswerRe: C# launches another program Pin
Dave Kreskowiak7-Jan-09 10:08
mveDave Kreskowiak7-Jan-09 10:08 
AnswerRe: C# launches another program Pin
Dragonfly_Lee7-Jan-09 19:53
Dragonfly_Lee7-Jan-09 19:53 
AnswerRe: C# launches another program Pin
Pritam Karmakar7-Jan-09 21:45
Pritam Karmakar7-Jan-09 21:45 
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
professional#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
professional#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
professional#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 

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.