473,976 Members | 42,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with DataGrid1.Table Styles

I have created some definitions at design time for a Datagrid. How do I
actually switch one of the definition on - ie make it active?

I've tried Datagrid1.Table Styles.Add - but that just adds it to the
collection. I feel I need something like:

Datagrid1.Table Styles(0).activ e = True

Also, having created a style and given it a name (Style1) how do I refer to
it?

Datagrid1.Table Styles(Style1). active = True ???

- Jerry
Nov 21 '05 #1
3 2594
Jerry,

I thought that this would be it.

\\\
Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
For Each a As DataGridTableSt yle In DataGrid1.Table Styles
a.MappingName = Nothing
Next
DataGrid1.Table Styles(1).Mappi ngName = "Persons"
End Sub
Private Sub Button2_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button2.Click
For Each a As DataGridTableSt yle In DataGrid1.Table Styles
a.MappingName = Nothing
Next
DataGrid1.Table Styles(2).Mappi ngName = "Persons"
End Sub
///
And not set the Mappingname in advance

Personaly it looks for me easier just to remove constantly the first one
with
datagrid1.table styles.removeat (0)
and than replace it with a new one again with Add

I hope this helps?

Cor

"Jerry Spence1" <je**********@s omewhere.com>
I have created some definitions at design time for a Datagrid. How do I
actually switch one of the definition on - ie make it active?

I've tried Datagrid1.Table Styles.Add - but that just adds it to the
collection. I feel I need something like:

Datagrid1.Table Styles(0).activ e = True

Also, having created a style and given it a name (Style1) how do I refer
to
it?

Datagrid1.Table Styles(Style1). active = True ???

- Jerry

Nov 21 '05 #2
Thanks for this. I have just found the answer elsewhere.A given style is
applied when the Datagrid's DataMember property is equal (in case as well)
to the DataGridTagleSt yle's MappingName property.

- Jerry

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:eD******** ******@TK2MSFTN GP12.phx.gbl...
Jerry,

I thought that this would be it.

\\\
Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
For Each a As DataGridTableSt yle In DataGrid1.Table Styles
a.MappingName = Nothing
Next
DataGrid1.Table Styles(1).Mappi ngName = "Persons"
End Sub
Private Sub Button2_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button2.Click
For Each a As DataGridTableSt yle In DataGrid1.Table Styles
a.MappingName = Nothing
Next
DataGrid1.Table Styles(2).Mappi ngName = "Persons"
End Sub
///
And not set the Mappingname in advance

Personaly it looks for me easier just to remove constantly the first one
with
datagrid1.table styles.removeat (0)
and than replace it with a new one again with Add

I hope this helps?

Cor

"Jerry Spence1" <je**********@s omewhere.com>
I have created some definitions at design time for a Datagrid. How do I
actually switch one of the definition on - ie make it active?

I've tried Datagrid1.Table Styles.Add - but that just adds it to the
collection. I feel I need something like:

Datagrid1.Table Styles(0).activ e = True

Also, having created a style and given it a name (Style1) how do I refer
to
it?

Datagrid1.Table Styles(Style1). active = True ???

- Jerry


Nov 21 '05 #3
Jerry,

That is the same answer as I give you?

I give you as well the answer how to do that because your mappingname have
to be the same as your datasource member.

Cor

"Jerry Spence1" <je**********@s omewhere.com>
Thanks for this. I have just found the answer elsewhere.A given style is
applied when the Datagrid's DataMember property is equal (in case as well)
to the DataGridTagleSt yle's MappingName property.

- Jerry

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:eD******** ******@TK2MSFTN GP12.phx.gbl...
Jerry,

I thought that this would be it.

\\\
Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
For Each a As DataGridTableSt yle In DataGrid1.Table Styles
a.MappingName = Nothing
Next
DataGrid1.Table Styles(1).Mappi ngName = "Persons"
End Sub
Private Sub Button2_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button2.Click
For Each a As DataGridTableSt yle In DataGrid1.Table Styles
a.MappingName = Nothing
Next
DataGrid1.Table Styles(2).Mappi ngName = "Persons"
End Sub
///
And not set the Mappingname in advance

Personaly it looks for me easier just to remove constantly the first one
with
datagrid1.table styles.removeat (0)
and than replace it with a new one again with Add

I hope this helps?

Cor

"Jerry Spence1" <je**********@s omewhere.com>
>I have created some definitions at design time for a Datagrid. How do I
> actually switch one of the definition on - ie make it active?
>
> I've tried Datagrid1.Table Styles.Add - but that just adds it to the
> collection. I feel I need something like:
>
> Datagrid1.Table Styles(0).activ e = True
>
> Also, having created a style and given it a name (Style1) how do I
> refer
> to
> it?
>
> Datagrid1.Table Styles(Style1). active = True ???
>
> - Jerry
>
>



Nov 21 '05 #4

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

Similar topics

3
2555
by: michael haller | last post by:
In my project i have a textfile witch i import in my c# application. The datas in the textfile i show the datas in the textfile in my datagrid..ok that ist not my problem. Now i have a dataset (dataset.xsd the name is ds_BESR). How i can my datas in the datagrid into this dataset ds_BESR? Please help me...i need that. the reasen is my crystal report get the datas
2
1924
by: Ralf | last post by:
Hi NG, if there a way to Clear a DataGrid dataGrid1.TableStyles.Clear(); or dataGrid1.TableStyles.Remove(tblStyle); or dataGrid1.TableStyles.RemoveAt(intDG); or not work!? dataGrid1.TableStyles.GridColumnStyles.RemoveAt(0);
5
7821
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
3
1080
by: Aaron Smith | last post by:
I can't seem to get my table styles to apply to my DataGrid. In order for them to apply correctly, what exactly has to be set in the DataSource and DataMember, and then the DataMapping properties? I keep trying all different combinations of DataSets, tables, and even DataViews, but it just isn't working... I have a DataSet that has the following: Table1 |_ Table 2
0
2606
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...
30
4640
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a corresponding field in the lookup table. In my data table we store the ID in what I will call the 'key' field. == Description of the desired operation:
3
2166
by: Jason Huang | last post by:
Hi, In my C# Windows form project. I am wondering can we manually define the width of a cell in a DataGrid? Thanks for help. Jason
0
967
by: Stephen Plotnick | last post by:
I have a bool type I've built in a data grid that is acting very strange. The column shows up and if I click on the bool type it does not change the check mark. If I click and than click on another rows bool type the check mark shows up. Sometimes the check mark looks grayed out afterwards. FYI, I was successful doing the same thing in a different table and bool type column and copied the code. Here is a snippet of the code that sets up...
1
1979
by: Stephen Plotnick | last post by:
I have a checkbox in a data grid that does not change it's state until I actually leave the field. I've done this routine several times in other data grids without an issue. I'm using VB.2003. Steve
0
10355
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
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,...
1
11576
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10084
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7605
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
6416
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
6558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5156
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

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.