PDA

View Full Version : سوال: ظاهر گرید ویو



htmbarnamenevisl
سه شنبه 13 بهمن 1388, 14:16 عصر
سلام
چطور میشه سطرهای دیتا گرید ویو رو به صورت یکی در میون رنگ کرد
یعنی سطر اول ابی رنگ باشه و سطر دوم زرد و سطر سوم دوباره ابی و ......
مرسی

aminh85
سه شنبه 13 بهمن 1388, 14:39 عصر
من که با این کد همیشه جواب می گیرم.


DataGridViewCellStyle objAlignRightCellStyle = newDataGridViewCellStyle();
objAlignRightCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
DataGridViewCellStyle objAlternatingCellStyle = new DataGridViewCellStyle();
objAlternatingCellStyle.BackColor = Color.WhiteSmoke;
grdAuthorTitles.AlternatingRowsDefaultCellStyle = objAlternatingCellStyle;
DataGridViewCellStyle objCurrencyCellStyle = new DataGridViewCellStyle();
objCurrencyCellStyle.Format = "c";
objCurrencyCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

htmbarnamenevisl
سه شنبه 13 بهمن 1388, 16:39 عصر
من دیتا گرید ویو رو به یک data table وصل کردم
می خوام فقط بعضی از ستونها به نمایش در بیان چیکار کنم
مرسی