Thanks Kevin
That may help. It is at least a very straight forward example.
Thanks
(wordcount=15) :)
>Michael,
>
>Jeez...and I thought I was the wordiest guy on the planet!
>
>I may be mis-reading your question, and if I have, I apologize, but here's a very simple code sample for customizing the display of a grid for specific # of columns.
>
>This is based on a datatable, so I don't know if it applies to what you're doing, but here it is...
>
>dataGridEmployees.DataSource = DsEmployeeHeaders.Tables[0];
>
>DataGridTableStyle style = new DataGridTableStyle();
>style.MappingName = "EmployeeResults";
>
>DataGridTextBoxColumn fld1 = new DataGridTextBoxColumn();
>fld1.Alignment = HorizontalAlignment.Left;
>fld1.HeaderText = "First Name";
>fld1.MappingName = "FirstName";
>fld1.ReadOnly = true;
>fld1.Width = 85;
>
>DataGridTextBoxColumn fld2 = new DataGridTextBoxColumn();
>fld2.Alignment = HorizontalAlignment.Left;
>fld2.HeaderText = "Last Name";
>fld2.MappingName = "lastname";
>fld2.ReadOnly = true;
>fld2.Width = 85;
>
>DataGridTextBoxColumn fld3 = new DataGridTextBoxColumn();
>fld3.Alignment = HorizontalAlignment.Left;
>fld3.HeaderText = "Address";
>fld3.MappingName = "Address1";
>fld3.ReadOnly = true;
>fld3.Width = 180;
>
>style.GridColumnStyles.AddRange(new DataGridColumnStyle[] {fld1, fld2, fld3});
>style.PreferredRowHeight = 20;
>style.BackColor = Color.FromArgb(255,255,255);
>style.AlternatingBackColor = Color.FromArgb(234,239,251);
>style.SelectionBackColor = Color.FromArgb(118, 149, 222);
>dataGridEmployees.TableStyles.Clear();
>dataGridEmployees.TableStyles.Add(style);
>
>dataGridEmployees.DataSource = DsEmployeeHeaders.Tables[0];
>DsEmployeeHeaders.Tables[0].DefaultView.AllowNew = false;
>
>Does that help?
>
>Kevin
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only