[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Change a cell in a C# desktop app datagrid

Posted on 2004-09-28
1
Medium Priority
?
187 Views
Last Modified: 2010-04-15
ok first off this is a desktop app I found a few solutions to this on the web but they all seem to only work for web application.

What I have is a datagrid comprised of 4 columns and numerous rows. whenever the second, third and forth cells in any row are equal to null I want to set the first cells font to bold. Any ideas?
0
Comment
Question by:toby_lang
1 Comment
 
LVL 1

Accepted Solution

by:
ryeandi earned 375 total points
ID: 12181097
hi toby

take a look at this link:

http://www.dotnet247.com/247reference/a.aspx?u=http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp

specifically faq 5.67.

in the code example that is associated with the above link you'll need to modify your FormatGridCells event handler to look something like this:

private void FormatGridCells(object sender, DataGridFormatCellEventArgs e)
{
if(dg[e.Row,1].ToString() == dg[e.Row,2].ToString() &&
   dg[e.Row,2].ToString() == dg[e.Row,3].ToString()
{
  e.TextFont = new Font(e.TextFont.Name, e.TextFont.Size, FontStyle.Bold);
}
}

hope this helps,

rye
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question