PC Review


Reply
Thread Tools Rate Thread

datagridtablestyle

 
 
=?Utf-8?B?TE1JVA==?=
Guest
Posts: n/a
 
      4th May 2005
I have tried to modify the width of the columns in my dataset and nothing is
working. I used the designer to begin with and it didn't work so now I'm
calling it in the load event of the form. The DataTable shows up, but with
no modifications. The name of the DataTable is "Table3".

private void LineSelect_Load(object sender, System.EventArgs e)
{
this.LSDataGrid.DataSource = this.Order;

DataGridTableStyle dgts = new DataGridTableStyle();
dgts.MappingName = "Table3";

DataGridColumnStyle item = new DataGridTextBoxColumn();
item.MappingName = "Item No";
item.HeaderText = "Item No";
item.NullText = "";
item.Width = 50;
dgts.GridColumnStyles.Add(item);

DataGridColumnStyle qty = new DataGridTextBoxColumn();
qty.MappingName = "Qty To Pick";
qty.HeaderText = "Qty To Pick";
qty.NullText = "";
qty.Width = 50;
dgts.GridColumnStyles.Add(qty);

DataGridColumnStyle loc = new DataGridTextBoxColumn();
loc.MappingName = "Location 1";
loc.HeaderText = "Location 1";
loc.NullText = "";
loc.Width = 50;
dgts.GridColumnStyles.Add(loc);

this.LSDataGrid.TableStyles.Add(dgts);
}
 
Reply With Quote
 
 
 
 
Damon Payne
Guest
Posts: n/a
 
      4th May 2005
When you assign the DataSource, does the table have a name of "Table3" ?

 
Reply With Quote
 
=?Utf-8?B?TE1JVA==?=
Guest
Posts: n/a
 
      4th May 2005
Yes, the name is defaulted from a sql server and I've tested it using:
MessageBox.Show(Order.TableName.ToString());

"Damon Payne" wrote:

> When you assign the DataSource, does the table have a name of "Table3" ?
>
>

 
Reply With Quote
 
=?Utf-8?B?TE1JVA==?=
Guest
Posts: n/a
 
      4th May 2005
Yes, I tested with: MessageBox.Show(Order.TableName.ToString()); to make sure
it was the same name.

"Damon Payne" wrote:

> When you assign the DataSource, does the table have a name of "Table3" ?
>
>

 
Reply With Quote
 
Rüdiger Kardel
Guest
Posts: n/a
 
      4th May 2005
LMIT,

please try a

LSDataGrid.TableStyles.Clear()

before calling :
this.LSDataGrid.TableStyles.Add(dgts);

HTH
Ruediger


 
Reply With Quote
 
=?Utf-8?B?TE1JVA==?=
Guest
Posts: n/a
 
      5th May 2005
No difference unfortunately.

"Rüdiger Kardel" wrote:

> LMIT,
>
> please try a
>
> LSDataGrid.TableStyles.Clear()
>
> before calling :
> this.LSDataGrid.TableStyles.Add(dgts);
>
> HTH
> Ruediger
>
>
>

 
Reply With Quote
 
=?Utf-8?B?TE1JVA==?=
Guest
Posts: n/a
 
      5th May 2005
I take back my first reply, it works perfectly now. Thanks for the help!

"Rüdiger Kardel" wrote:

> LMIT,
>
> please try a
>
> LSDataGrid.TableStyles.Clear()
>
> before calling :
> this.LSDataGrid.TableStyles.Add(dgts);
>
> HTH
> Ruediger
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGridTableStyle nita Microsoft VB .NET 3 27th Jul 2006 02:18 PM
Help with DataGridTableStyle? Brett Romero Microsoft C# .NET 4 11th Jan 2006 08:14 PM
Re: DataGridTableStyle #2 Ilya Tumanov [MS] Microsoft Dot NET Compact Framework 1 27th Jun 2005 07:59 PM
Re: DataGridTableStyle Sergey Bogdanov Microsoft Dot NET Compact Framework 0 25th Jun 2005 07:42 PM
How to use DataGridTableStyle? Lars Netzel Microsoft VB .NET 1 29th Apr 2004 10:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:44 AM.