Solved

Change a cell in a C# desktop app datagrid

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

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