Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie: Enhancing the DataGrid
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01069412
Message ID:
01069817
Views:
24
Greg,

>I am working through the Jump Start: Windows Forms Application - C# in VS 2003 and have a problem on Step 13 - Enhancing the DataGrids. The enhancement to the Orders DataGrid worked fine however the enhancement to the Order Detail DataGrid results in no change in appearance (headers, null display, size). I double checked the settings and can't find anything wrong. I'm certain I've missed something simple but as a newcommer to .NET I'm lost. Can someone give me a hint on to how to figure out why this isn't happening?
>
>Here is the applicable Windows Form Designer generated code:
>
>//
>// grdOrderDetail
>//
>this.grdOrderDetail.AddRowsWithDownArrow = false;
>this.grdOrderDetail.BindingSource = "OrderDetail";
>this.grdOrderDetail.BindingSourceMember = null;
>this.grdOrderDetail.ControlID = new System.Guid("00000000-0000-0000-0000-000000000000");
>this.grdOrderDetail.DataMember = "";
>this.grdOrderDetail.HeaderForeColor = System.Drawing.SystemColors.ControlText;
>this.grdOrderDetail.Location = new System.Drawing.Point(24, 320);
>this.grdOrderDetail.Name = "grdOrderDetail";
>this.grdOrderDetail.Size = new System.Drawing.Size(432, 137);
>this.grdOrderDetail.TabIndex = 28;
>this.grdOrderDetail.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
> this.OrderDetailTableStyle});
>//
>// OrderDetailTableStyle
>//
>this.OrderDetailTableStyle.DataGrid = this.grdOrderDetail;
>this.OrderDetailTableStyle.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] {
> this.DetailOrderID,
> this.ProductID,
> this.UnitPrice,
> this.Quantity,
> this.Discount});
>this.OrderDetailTableStyle.HeaderForeColor = System.Drawing.SystemColors.ControlText;
>this.OrderDetailTableStyle.MappingName = "OrderDetail";
>//
>// DetailOrderID
>//
>this.DetailOrderID.Format = "";
>this.DetailOrderID.FormatInfo = null;
>this.DetailOrderID.HeaderText = "Order ID";
>this.DetailOrderID.MappingName = "OrderID";
>this.DetailOrderID.NullText = "";
>this.DetailOrderID.Width = 75;
>//
>// ProductID
>//
>this.ProductID.Format = "";
>this.ProductID.FormatInfo = null;
>this.ProductID.HeaderText = "Product";
>this.ProductID.MappingName = "ProductID";
>this.ProductID.NullText = "";
>this.ProductID.Width = 75;
>//
>// UnitPrice
>//
>this.UnitPrice.Format = "";
>this.UnitPrice.FormatInfo = null;
>this.UnitPrice.HeaderText = "Price";
>this.UnitPrice.MappingName = "UnitPrice";
>this.UnitPrice.NullText = "";
>this.UnitPrice.Width = 75;
>//
>// Quantity
>//
>this.Quantity.Format = "";
>this.Quantity.FormatInfo = null;
>this.Quantity.HeaderText = "Qty";
>this.Quantity.MappingName = "Quantity";
>this.Quantity.NullText = "";
>this.Quantity.Width = 75;
>//
>// Discount
>//
>this.Discount.Format = "";
>this.Discount.FormatInfo = null;
>this.Discount.HeaderText = "Discount";
>this.Discount.MappingName = "Discount";
>this.Discount.NullText = "";
>this.Discount.Width = 75;

Hmmm...it's hard to tell from here what's going on. A quick run-through of the properties seems like they are set correctly. You may want to just drop a second DataGrid on the form and try it on that one. You can also check out the sample application which has this DataGrid set up properly.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform