Click here to Skip to main content
15,914,642 members
Home / Discussions / C#
   

C#

 
GeneralRe: Show menu from form other than MDI form? Pin
MudkiSekhon12-Jan-06 18:31
MudkiSekhon12-Jan-06 18:31 
GeneralRe: Show menu from form other than MDI form? Pin
Luis Alonso Ramos12-Jan-06 18:37
Luis Alonso Ramos12-Jan-06 18:37 
GeneralRe: Show menu from form other than MDI form? Pin
MudkiSekhon12-Jan-06 19:04
MudkiSekhon12-Jan-06 19:04 
GeneralRe: Show menu from form other than MDI form? Pin
Luis Alonso Ramos13-Jan-06 5:20
Luis Alonso Ramos13-Jan-06 5:20 
QuestionCrystal Report Deployment in C# Pin
aarontan12-Jan-06 18:16
aarontan12-Jan-06 18:16 
AnswerRe: Crystal Report Deployment in C# Pin
CooperWu12-Jan-06 21:24
CooperWu12-Jan-06 21:24 
QuestionHttpWebRequest and SSL Authentication Pin
Skoder12-Jan-06 17:48
Skoder12-Jan-06 17:48 
QuestionDataGrid Issue, Please Help Pin
student_rhr12-Jan-06 16:41
student_rhr12-Jan-06 16:41 
Hello all,

I am new to C# and Windows programming student. I am wokring on a DataGrid and I tried to customize it a little. But whenever I click all the cells get highlighted excpet the one I custmized, here is the code:

public class PaintedColumnStyle:DataGridTextBoxColumn
{
	protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight)
	{
		foreBrush = new SolidBrush(GetColor(GetColumnValueAtRow(source,rowNum)));
		
		if(GetColumnValueAtRow(source,rowNum) != DBNull.Value)
		{
			object txt;
			decimal Num;
			txt = GetColumnValueAtRow(source,rowNum);
			if(txt.GetType() == typeof(decimal) )
			{
				Num = (decimal)txt;
			}
			else
			{
				Num = decimal.Parse((string)txt);
			}
			if(Num < 0)
			{
				backBrush = new SolidBrush(GetBackColor(GetColumnValueAtRow(source,rowNum)));
			}
			else
			{
				backBrush = new LinearGradientBrush(bounds, 
						Color.FromArgb(255, 255, 255),
						Color.FromArgb(13, 150, 255),
						92,false);
			}
		}
		//backBrush = new LinearGradientBrush(bounds, GetBackColor(GetColumnValueAtRow(source,rowNum)));
		base.Paint (g, bounds, source, rowNum, backBrush, foreBrush, alignToRight);
	}


Pleaes click here to see the pictuer[^]


I am thinking that my 'override Paint' overrides when I click to highlight a row as well.
I am attaching a picture here so you may have a better understanding. Please help a newbie Frown | :(
AnswerRe: DataGrid Issue, Please Help Pin
Daniel Santillanes13-Jan-06 4:50
professionalDaniel Santillanes13-Jan-06 4:50 
AnswerRe: DataGrid Issue, Please Help Pin
Drew McGhie13-Jan-06 5:49
Drew McGhie13-Jan-06 5:49 
GeneralRe: DataGrid Issue, Please Help Pin
student_rhr13-Jan-06 6:35
student_rhr13-Jan-06 6:35 
GeneralRe: DataGrid Issue, Please Help Pin
student_rhr13-Jan-06 6:53
student_rhr13-Jan-06 6:53 
QuestionGenerics and the form designer in VS2005 Pin
Luis Alonso Ramos12-Jan-06 16:26
Luis Alonso Ramos12-Jan-06 16:26 
GeneralRe: Generics and the form designer in VS2005 Pin
Luis Alonso Ramos12-Jan-06 19:01
Luis Alonso Ramos12-Jan-06 19:01 
QuestionGenerate exe file from the C# program Pin
tadung12-Jan-06 15:04
tadung12-Jan-06 15:04 
AnswerRe: Generate exe file from the C# program Pin
Christian Graus12-Jan-06 15:12
protectorChristian Graus12-Jan-06 15:12 
GeneralRe: Generate exe file from the C# program Pin
tadung12-Jan-06 15:55
tadung12-Jan-06 15:55 
GeneralRe: Generate exe file from the C# program Pin
Christian Graus12-Jan-06 15:56
protectorChristian Graus12-Jan-06 15:56 
GeneralRe: Generate exe file from the C# program Pin
tadung12-Jan-06 15:58
tadung12-Jan-06 15:58 
QuestionSearch and Replace in Word Pin
CliffAnderson12-Jan-06 13:55
CliffAnderson12-Jan-06 13:55 
AnswerRe: Search and Replace in Word Pin
Nick Parker12-Jan-06 14:19
protectorNick Parker12-Jan-06 14:19 
QuestionDatabase Microsoft Access Pin
Sasuko12-Jan-06 12:36
Sasuko12-Jan-06 12:36 
AnswerRe: Database Microsoft Access Pin
Christian Graus12-Jan-06 12:49
protectorChristian Graus12-Jan-06 12:49 
GeneralRe: Database Microsoft Access Pin
Daniel Santillanes12-Jan-06 13:02
professionalDaniel Santillanes12-Jan-06 13:02 
GeneralRe: Database Microsoft Access Pin
Christian Graus12-Jan-06 13:07
protectorChristian Graus12-Jan-06 13:07 

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.