473,804 Members | 3,802 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

1 datagrid, multiple tables and tablestyles

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).

Anybody an idea?

Thanks in advance.

I use:
dsLookup.Clear( )
cCommand = frmMain.GlcComm and
' create a data adapter
Dim daStudy As OleDbDataAdapte r = New
OleDbDataAdapte r(cCommand, frmMain.myConne ction)
dsLookup.Clear( )
dsLookup.DataSe tName = frmMain.GlcTS
'daStudy.Update (dsLookup, frmMain.GlcTS)
' fill dataset
daStudy.TableMa ppings.Clear()
daStudy.Fill(ds Lookup, frmMain.GlcTS)

Nov 21 '05 #1
6 1961
Henk,

I had this problem as well. The most simple solution was than always to set
tablestyle zero to nothing and than add the needed one.

I hope this helps,

Cor
Nov 21 '05 #2
Hi

Thanks for your answer.
I made 2 tablestyles with the properties window of the datagrid.
Did you make the tablestyles with code?
Maybe you have an example??

Thanks
Henk,
The Netherlands

Nov 21 '05 #3
Henk,

More than one, however here is the most simple one look for the rest
yourself.

http://www.vb-tips.com/default.aspx?...6-3300b2215049

I hope this helps,

Cor
Nov 21 '05 #4
dgLookup1.Table Styles(0) = Nothing

I get "item is readonly"

Nov 21 '05 #5
Hi,

"henk" <ri*******@hotm ail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Hi

Thanks for your answer.
I made 2 tablestyles with the properties window of the datagrid.
Ok, so did you set a MappingName for each table style ? When you bind to a
grid then the name of the DataTable is used to find the TableStyle with an
equal MappingName and that one will be used.

So make sure that your tables have the right TableName and that each
DataGridTableSt yle has the right MappingName.

Public Sub BindGrid( Query As String, TableName As String )
Dim lookupAdapter As OleDbDataAdapte r =
New OleDbDataAdapte r( Query, frmMain.myConne ction)

Dim lookupTable As New DataTable( TableName )
lookupAdapter.F ill( lookupTable )

LookupDataGrid. DataSource = lookupTable
End Sub
Did you make the tablestyles with code?
You could also do that, but it's not entirely clear whether you want to keep
all TableStyles in the LookupForm or not.

HTH,
Greetings
Maybe you have an example??

Thanks
Henk,
The Netherlands

Nov 21 '05 #6
Henk,

Sorrry a litle bit "te kort door de bocht"
:-)
DataLookup1.Tab leStyles.Remove At(0)

I hope this helps better,

Cor
Nov 21 '05 #7

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

Similar topics

2
2509
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is the OID of Person), the information of the person matching the selected OID is shown in the Textboxes (Name, Address, id, etc) and the courses this person is taken are shown in a DataGrid (course name, price, etc.). This is working well so far, I...
2
6416
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
6
1355
by: Jim Mirra | last post by:
Hey, I have been working on this for a while now and I keep getting the same error. here is my code: ------- start code --------- Dim strSQL = "Select tagid,itemid,description,status, transtype, (select max(datetime) from transactions where tagid = inventory.tagid) as statusdate
17
7439
by: Mike Fellows | last post by:
im trying (unsucessfully) to add a checkbox column to my datagrid i basically have a datagrid that im populating from a dataset Me.DataGrid1.DataSource = ds.Tables(0) the datagrid then has 5 columns in it but i need to add a sixth column which will be my checkbox column - any help or pointers with this would be great
5
7815
by: J | last post by:
Ok, they have changed a lot of stuff in VB.net. How in the world do you hide a column on the Datagrid? -- Jason
0
2598
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create tablestyles to format any of the columns within the datagrid, the exception "Can-not parent objects created on one thread to objects created on another" or words to that effect. I'm not too sure if what I said make sense, but i will add details to...
0
1109
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
3530
by: Bill nguyen | last post by:
I use DatagridTableStyle to display data from table WF_Carrier_FreightChart. USers than can add/delete/edit rows in the Datagrid. Since the Datagrid's datasource "dCarrierFreight" is just a copy/view of the table (dataset dFreight.tables(0) ), I need to update the original table to reflect multiple changes in the Datagrid. Your help is greatly appreciated. Bill
0
1075
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
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10569
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
10325
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
7615
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
5519
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...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
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.