Click here to Skip to main content
15,894,646 members
Home / Discussions / C#
   

C#

 
QuestionHow draw formatted text in cell DataGrid Pin
Piotr B.4-Apr-06 19:18
Piotr B.4-Apr-06 19:18 
AnswerRe: How draw formatted text in cell DataGrid Pin
Bobby8874-Apr-06 20:41
Bobby8874-Apr-06 20:41 
AnswerRe: How draw formatted text in cell DataGrid Pin
russellsoft4-Apr-06 20:59
russellsoft4-Apr-06 20:59 
QuestionPropertygrid help required. Pin
aliasjad4-Apr-06 19:09
aliasjad4-Apr-06 19:09 
AnswerRe: Propertygrid help required. Pin
Ricardo Casquete4-Apr-06 21:55
Ricardo Casquete4-Apr-06 21:55 
GeneralRe: Propertygrid help required. Pin
aliasjad5-Apr-06 21:13
aliasjad5-Apr-06 21:13 
GeneralRe: Propertygrid help required. Pin
Ricardo Casquete5-Apr-06 21:30
Ricardo Casquete5-Apr-06 21:30 
GeneralRe: Propertygrid help required. Pin
Ricardo Casquete5-Apr-06 21:40
Ricardo Casquete5-Apr-06 21:40 
Drag and Drop any table to geenrate the SqlDataAdapter, Drag and drop the Grid and genereate the Item dataBound code...

and copy this


<br />
		private void Page_Load(object sender, System.EventArgs e)<br />
		{<br />
			this.sqlDataAdapter1.Fill ( this.dstCategories1 );<br />
			this.DataGrid1.DataBind();<br />
		}<br />
<br />
		private int i = 0;<br />
		private int j = 1;<br />
<br />
		private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)<br />
		{<br />
			if ( ( e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item ) || ( e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem ) )<br />
			{<br />
				if ( i % 2 == 0 )<br />
				{<br />
					e.Item.Cells [ 0 ].BackColor = Color.Aqua;<br />
				}<br />
				if ( j % 2 == 0 )<br />
					e.Item.Cells [ 1 ].BackColor = Color.Red;<br />
				else<br />
					e.Item.Cells [ 2 ].BackColor = Color.Yellow;<br />
<br />
				i++;<br />
			}<br />
			j++;<br />
		}<br />
<br />


Regards

Ricardo Casquete
GeneralRe: Propertygrid help required. Pin
aliasjad6-Apr-06 2:39
aliasjad6-Apr-06 2:39 
GeneralRe: Propertygrid help required. Pin
aliasjad9-Apr-06 20:16
aliasjad9-Apr-06 20:16 
QuestionIn c# datagrid Pin
simran0074-Apr-06 18:42
simran0074-Apr-06 18:42 
QuestionFiles Pin
clint19824-Apr-06 18:23
clint19824-Apr-06 18:23 
AnswerRe: Files Pin
Expert Coming4-Apr-06 20:36
Expert Coming4-Apr-06 20:36 
GeneralRe: Files Pin
clint19824-Apr-06 22:27
clint19824-Apr-06 22:27 
AnswerRe: Files Pin
Navaneeth.K.N4-Apr-06 20:44
Navaneeth.K.N4-Apr-06 20:44 
GeneralRe: Files Pin
Guffa4-Apr-06 23:24
Guffa4-Apr-06 23:24 
GeneralRe: Files Pin
clint19824-Apr-06 23:30
clint19824-Apr-06 23:30 
AnswerRe: Files Pin
Guffa5-Apr-06 5:23
Guffa5-Apr-06 5:23 
GeneralRe: Files Pin
simran0075-Apr-06 19:24
simran0075-Apr-06 19:24 
GeneralRe: Files Pin
Guffa6-Apr-06 1:45
Guffa6-Apr-06 1:45 
AnswerRe: Files Pin
Guffa4-Apr-06 20:56
Guffa4-Apr-06 20:56 
Questionvery very urgent please help me in c# datagrid Pin
Abdul_Rahman4-Apr-06 18:22
Abdul_Rahman4-Apr-06 18:22 
AnswerRe: very very urgent please help me in c# datagrid Pin
krishna194-Apr-06 21:47
krishna194-Apr-06 21:47 
QuestionMerge INI Pin
picasso24-Apr-06 17:57
picasso24-Apr-06 17:57 
AnswerRe: Merge INI Pin
Expert Coming4-Apr-06 20:37
Expert Coming4-Apr-06 20:37 

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.