473,668 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

code check please

guy
I am binding a datatable to a WinForms grid control but for some reason the
GridTableStyle is being ignored, the data just displays as if no TableStyle
was set up

I have also tried changing the DataTable TableName in code before the code
below - no effect.
The data displayed is correct, just the formatting is wrong

SubAreasAtDate is a DataTable and dgLicensedBlock s is the data grid

hear are the two lines:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

I have also tried:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles.C lear()
dgLicensedBlock s.TableStyles.A dd(Me.DataGridT ableStyle2)
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

Equivalent code works fine on 8 other datagrids in the app.

any ideas?

guy
Nov 21 '05 #1
4 1034
Hi,

The little code you show looks ok. Are you sure you are loading the
right tablestyle?

Ken
---------------
"guy" <gu*@discussion s.microsoft.com > wrote in message
news:4C******** *************** ***********@mic rosoft.com...
I am binding a datatable to a WinForms grid control but for some reason the
GridTableStyle is being ignored, the data just displays as if no TableStyle
was set up

I have also tried changing the DataTable TableName in code before the code
below - no effect.
The data displayed is correct, just the formatting is wrong

SubAreasAtDate is a DataTable and dgLicensedBlock s is the data grid

hear are the two lines:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

I have also tried:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles.C lear()
dgLicensedBlock s.TableStyles.A dd(Me.DataGridT ableStyle2)
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

Equivalent code works fine on 8 other datagrids in the app.

any ideas?

guy
Nov 21 '05 #2
Have you checked the mappnig names of your DataGridColumnS tyles to be sure
they reflect the names of fields in the DataTable? You didn't show your code
for setting up these and adding them to the TableStyle Collection.

"guy" wrote:
I am binding a datatable to a WinForms grid control but for some reason the
GridTableStyle is being ignored, the data just displays as if no TableStyle
was set up

I have also tried changing the DataTable TableName in code before the code
below - no effect.
The data displayed is correct, just the formatting is wrong

SubAreasAtDate is a DataTable and dgLicensedBlock s is the data grid

hear are the two lines:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

I have also tried:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles.C lear()
dgLicensedBlock s.TableStyles.A dd(Me.DataGridT ableStyle2)
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

Equivalent code works fine on 8 other datagrids in the app.

any ideas?

guy

Nov 21 '05 #3
guy
Thanks all,
i put a handler on the mappingname changed event and found another bit of
code was butting in and changing it

guy

I am binding a datatable to a WinForms grid control but for some reason the
GridTableStyle is being ignored, the data just displays as if no TableStyle
was set up

I have also tried changing the DataTable TableName in code before the code
below - no effect.
The data displayed is correct, just the formatting is wrong

SubAreasAtDate is a DataTable and dgLicensedBlock s is the data grid

hear are the two lines:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

I have also tried:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles.C lear()
dgLicensedBlock s.TableStyles.A dd(Me.DataGridT ableStyle2)
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

Equivalent code works fine on 8 other datagrids in the app.

any ideas?

guy

Nov 21 '05 #4
guy
Thanks all,
i put a handler on the mappingname changed event and found another bit of
code was butting in and changing it

guy

I am binding a datatable to a WinForms grid control but for some reason the
GridTableStyle is being ignored, the data just displays as if no TableStyle
was set up

I have also tried changing the DataTable TableName in code before the code
below - no effect.
The data displayed is correct, just the formatting is wrong

SubAreasAtDate is a DataTable and dgLicensedBlock s is the data grid

hear are the two lines:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

I have also tried:-
dgLicensedBlock s.DataSource = SubAreasAtDate
dgLicensedBlock s.TableStyles.C lear()
dgLicensedBlock s.TableStyles.A dd(Me.DataGridT ableStyle2)
dgLicensedBlock s.TableStyles(0 ).MappingName = SubAreasAtDate. TableName

Equivalent code works fine on 8 other datagrids in the app.

any ideas?

guy

Nov 21 '05 #5

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

Similar topics

4
3597
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers using check boxes. For example, a question such as
38
3514
by: jrlen balane | last post by:
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser = serial.Serial()
7
3598
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title> </head> <style type="text/css">
2
3229
by: LordBlue | last post by:
Hi, please forgive me if i'm sending this post in the wrong place, and please don't tell me to post it in another group, because if i found a better one i'd have already done it. I'm writing a thesis and i'm in real hurry. I have an old c code which i cannot compile correctly. I am using the Dev-Cpp 4 compiler. Anyway, my question is: i have already solved most of the problems deleting some parts of the code which used graphics i don't...
3
1291
by: cisco | last post by:
Let's say i have something, that will eat up a lot of cpu cycles, that i want to run for the whole webpage( asp.net application and all subfolders underneath). What's the best way to accomplish this? I can't have anyone 'turn off' this feature or atleast not anyone who is not an administrator on the box(win 2k3). If the check fails i want any asp.net request to not return the page they requested but an error message. I implemented it...
1
47820
by: =?Utf-8?B?Wmlub24=?= | last post by:
Hello I have an ASP.NET 2 intranet application written in C#. I use Active Directory authentication and parts of the application uses AJAX. From time to time (about once every 200-300 accesses at least) I get the following error on the server: Event code: 3005 Event message: An unhandled exception has occurred.
7
2217
by: robin1983 | last post by:
Hi, good morning everyone, i have a file called attendence.php The problem is that some part of code is executing properly and half of the code is not and i dont get any warning or error message. For more information i m giving the whole code below. please give me the solution, the code is executing upto line no 95 (echo $halfday;) and after this line not a single code is executing. i am not able to get solution. So plaease help me in solving...
29
2953
by: Virtual_X | last post by:
As in IEEE754 double consist of sign bit 11 bits for exponent 52 bits for fraction i write this code to print double parts as it explained in ieee754 i want to know if the code contain any bug , i am still c++ beginner
0
8462
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
8381
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
8797
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
6209
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
4205
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
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2791
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
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
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.