473,978 Members | 26,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple tablestyles and one table?

I have one DataTable used in a datagrid. I have multiple TableStyles
to defining various views of the data. The table contains 20 unique
columns. I have four TableStyles, each with containing five columns.
I'd like to switch out these four views on button clicks. One view
will display at a time. Rather than create four datatables, I feel the
tablestyles and switching them is quicker. Comments?

For some reason, it isn't working. I do this in form_load() where dgts
is a gridtablestyle object:
dgtsSummary.Map pingName = "Summary";
dggrid.TableSty les.Add(dgtsSum mary);

I'm doing this on a button click for testing:
ds.Tables[0].TableName = dgtsSummary.Map pingName;
dggrid.Refresh( );

Right now, the tablestyle has only one mapped column, which should make
the grid display only that column. However, I'm still seeing all
columns. Each column in the table does have a space. Is the correct
mapping name "[some column]" or just "some column"?

Finally, how do I switch grid views by changing the mappings upon
button clicks?

Thanks,
Brett

Jan 27 '06 #1
1 1170
Ok, here it is:

case 0:
{
dggrid.TableSty les.Clear();
dggrid.TableSty les.Add(gridsty le1);
break;
}
case 1:
{
dggrid.TableSty les.Clear();
dggrid.TableSty les.Add(gridsty le2);
break;
}

Each gridstyle object should have the name of the table your mapping
to.

Brett

Jan 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3313
by: nevin | last post by:
Hiya, I have a table which without any tablestyles and associated columns displays all the columns of the table as you would expect. If I add a tablestyle and one column which I then add the TableStyle to the grid no columns at all show. This grid is visible and i can see the current position in the grid and the insertion point in the left column but my added style and it's column don't show. The column is not null, has a wide width and...
0
1116
by: Mike Gorgone | last post by:
Hi All, I'm currently trying to show a datagrid with a parent and child table realtionship. I've got the expansion icon (+) in the row headers and when I click on it I see the link to the child table. However if I click on the child table link I get the child data but there is no "Show/Hide parent rows" icon and there is no back button to take me back to the original parent grid where I clicked on the link to open the child grid. Am I...
6
1965
by: henk | last post by:
Hi, I have a vb.net application where I need multiple "Lookup windows". I could make 10 lookup window with each there own datagrid and table style, but I want to do it Nice. I was thinking about 1 Lookupwindow with 2 parameters (SQL and the tablestyle). The problem is: When calling the lookup window, it works ok. But when calling another Lookup window the table style won't update. (it still uses the first one).
0
1084
by: tshad | last post by:
On my VS 2003 Windows Forms page I am trying to reuse my DataTable dependant on the users preference. This is easy in Asp.net, but apparently not as easy here. If I do the following code, where I remove the Emails Table from the DataSet, it gives me an error at the line: EmailDataGrid.TableStyles.Add(dgStyle) with the error:
0
10172
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11413
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8464
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7617
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
5160
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3764
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.