Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / November 2007

Tip: Looking for answers? Try searching our database.

Datagrid and TableStyle in Master Detail table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vincenzo Quacquarelli - 09 Nov 2007 15:33 GMT
Hi,
I have modifiy the column style of a datagrid at desing time but at runtime
the datagrid set the standard style as Width = 50 ...
The grid is linked at two table in Master/Detail
I use Visual Studio 2005 and Vb .
Signature

Thanks

Vincenzo

Arun - 09 Nov 2007 17:43 GMT
Couldn't really understand your problem, can you eloborate the
problem..posibly with your code snippet?

> Hi,
> I have modifiy the column style of a datagrid at desing time but at runtime
[quoted text clipped - 5 lines]
>
> Vincenzo
Vincenzo Quacquarelli - 10 Nov 2007 09:13 GMT
I try to be more clear:
I have modified the width column in a datagrid, using visual studio wizard
tool.
But executing the program, no modify is applied.
This situation happens in a master/detail two table set, on the detail
table.
The environment is Windows CE 5.0
Where do I go wrong ?
Thanks
Vincenzo

> Couldn't really understand your problem, can you eloborate the
> problem..posibly with your code snippet?
[quoted text clipped - 9 lines]
>>
>> Vincenzo
Arun - 12 Nov 2007 20:01 GMT
> I try to be more clear:
> I have modified the width column in a datagrid, using visual studio wizard
[quoted text clipped - 9 lines]
> > Couldn't really understand your problem, can you eloborate the
> > problem..posibly with your code snippet?

http://groups.google.com/group/microsoft.public.dotnet.framework.compactframewor
k/browse_thread/thread/b6e2854081b11346/320b18ccde7392b7?lnk=gst&q=Arun+DataGrid
TableStyle&rnum=1#320b18ccde7392b7


http://groups.google.com/group/microsoft.public.dotnet.framework.compactframewor
k/browse_thread/thread/e6515228725b35c2/a1811b91c131ff16?lnk=gst&q=DataGridTable
Style+Arun#a1811b91c131ff16


http://groups.google.com/group/microsoft.public.dotnet.framework.compactframewor
k/search?group=microsoft.public.dotnet.framework.compactframework&q=DataGridTabl
eStyle


Better use word "DataGridTableStyle" and do a google compact framework
group search
http://groups.google.com/advanced_group_search
you will get lots of threads discussed the same topic and few will
really help you to start with.

Hope this helps,
Cheers,
Arun.

> >> Hi,
> >> I have modifiy the column style of a datagrid at desing time but at
[quoted text clipped - 8 lines]
>
> - Show quoted text -
Vincenzo Quacquarelli - 28 Nov 2007 11:52 GMT
Hi Arun,
please see this example
http://msdn2.microsoft.com/it-it/library/7bx62e55(VS.80).aspx

it contain a detailed procedure to create two datagrid in relation
(master-detail)

I have modified the width column in OrdersDatagrid
But executing the program, no modify is applied

>> I try to be more clear:
>> I have modified the width column in a datagrid, using visual studio
[quoted text clipped - 39 lines]
>>
>> - Show quoted text -
Arun - 29 Nov 2007 00:26 GMT
I followed the steps to recreate your problem, I could find a work
around.
Add a ListChanged event for the detail grid binding source
(orders_FK00BindingSource) and add the code to modify the TableStyle,
I have added the example below.

You need to add the other columns with the width of your choice and
remove the replicated code from the InitializeComponent()
If you run the code you will only see 3 columns and the width of
OrderID column is 10.

Hope this helps,
Cheers,
Arun

------------------------------------------------------------------------------------------------------------------------------------------------------------------------
private void orders_FK00BindingSource_ListChanged(object sender,
ListChangedEventArgs e)
       {
           System.Windows.Forms.DataGridTextBoxColumn
order_IDDataGridColumnStyleDataGridTextBoxColumn;
           System.Windows.Forms.DataGridTextBoxColumn
customer_IDDataGridColumnStyleDataGridTextBoxColumn1;
           System.Windows.Forms.DataGridTextBoxColumn
employee_IDDataGridColumnStyleDataGridTextBoxColumn;
           order_IDDataGridColumnStyleDataGridTextBoxColumn = new
System.Windows.Forms.DataGridTextBoxColumn();
           customer_IDDataGridColumnStyleDataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();
           employee_IDDataGridColumnStyleDataGridTextBoxColumn = new
System.Windows.Forms.DataGridTextBoxColumn();
           //
           // order_IDDataGridColumnStyleDataGridTextBoxColumn
           //
           order_IDDataGridColumnStyleDataGridTextBoxColumn.Format =
"";

order_IDDataGridColumnStyleDataGridTextBoxColumn.FormatInfo = null;

order_IDDataGridColumnStyleDataGridTextBoxColumn.HeaderText = "Order
ID";

order_IDDataGridColumnStyleDataGridTextBoxColumn.MappingName = "Order
ID";

order_IDDataGridColumnStyleDataGridTextBoxColumn.PropertyDescriptor =
null;
           order_IDDataGridColumnStyleDataGridTextBoxColumn.Width =
10;
           //
           // customer_IDDataGridColumnStyleDataGridTextBoxColumn1
           //

customer_IDDataGridColumnStyleDataGridTextBoxColumn1.Format = "";

customer_IDDataGridColumnStyleDataGridTextBoxColumn1.FormatInfo =
null;

customer_IDDataGridColumnStyleDataGridTextBoxColumn1.HeaderText =
"Customer ID";

customer_IDDataGridColumnStyleDataGridTextBoxColumn1.MappingName =
"Customer ID";

customer_IDDataGridColumnStyleDataGridTextBoxColumn1.PropertyDescriptor
= null;
           //
           // employee_IDDataGridColumnStyleDataGridTextBoxColumn
           //
           employee_IDDataGridColumnStyleDataGridTextBoxColumn.Format
= "";

employee_IDDataGridColumnStyleDataGridTextBoxColumn.FormatInfo = null;

employee_IDDataGridColumnStyleDataGridTextBoxColumn.HeaderText =
"Employee ID";

employee_IDDataGridColumnStyleDataGridTextBoxColumn.MappingName =
"Employee ID";

employee_IDDataGridColumnStyleDataGridTextBoxColumn.PropertyDescriptor
= null;
           //
           // ordersTableStyleDataGridTableStyle
           //
           this.ordersTableStyleDataGridTableStyle = new
System.Windows.Forms.DataGridTableStyle();

this.ordersTableStyleDataGridTableStyle.GridColumnStyles.Add(order_IDDataGridColumnStyleDataGridTextBoxColumn);

this.ordersTableStyleDataGridTableStyle.GridColumnStyles.Add(customer_IDDataGridColumnStyleDataGridTextBoxColumn1);

this.ordersTableStyleDataGridTableStyle.GridColumnStyles.Add(employee_IDDataGridColumnStyleDataGridTextBoxColumn);
           this.ordersTableStyleDataGridTableStyle.MappingName =
"Orders";
           //
           // ordersDataGrid
           //
           this.ordersDataGrid.DataSource =
this.orders_FK00BindingSource;
           this.ordersDataGrid.TableStyles.Clear();

this.ordersDataGrid.TableStyles.Add(this.ordersTableStyleDataGridTableStyle);
       }

> Hi Arun,
> please see this examplehttp://msdn2.microsoft.com/it-it/library/7bx62e55(VS.80).aspx
[quoted text clipped - 50 lines]
>
> - Show quoted text -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.