Solved

Change a cell in a C# desktop app datagrid

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

785 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