Solved

Change a cell in a C# desktop app datagrid

Posted on 2004-09-28
1
179 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 125 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now