473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 dgLicensedBlocks is the data grid

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

I have also tried:-
dgLicensedBlocks.DataSource = SubAreasAtDate
dgLicensedBlocks.TableStyles.Clear()
dgLicensedBlocks.TableStyles.Add(Me.DataGridTableS tyle2)
dgLicensedBlocks.TableStyles(0).MappingName = SubAreasAtDate.TableName

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

any ideas?

guy
Nov 21 '05 #1
4 1016
Hi,

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

Ken
---------------
"guy" <gu*@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.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 dgLicensedBlocks is the data grid

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

I have also tried:-
dgLicensedBlocks.DataSource = SubAreasAtDate
dgLicensedBlocks.TableStyles.Clear()
dgLicensedBlocks.TableStyles.Add(Me.DataGridTableS tyle2)
dgLicensedBlocks.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 DataGridColumnStyles 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 dgLicensedBlocks is the data grid

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

I have also tried:-
dgLicensedBlocks.DataSource = SubAreasAtDate
dgLicensedBlocks.TableStyles.Clear()
dgLicensedBlocks.TableStyles.Add(Me.DataGridTableS tyle2)
dgLicensedBlocks.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 dgLicensedBlocks is the data grid

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

I have also tried:-
dgLicensedBlocks.DataSource = SubAreasAtDate
dgLicensedBlocks.TableStyles.Clear()
dgLicensedBlocks.TableStyles.Add(Me.DataGridTableS tyle2)
dgLicensedBlocks.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 dgLicensedBlocks is the data grid

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

I have also tried:-
dgLicensedBlocks.DataSource = SubAreasAtDate
dgLicensedBlocks.TableStyles.Clear()
dgLicensedBlocks.TableStyles.Add(Me.DataGridTableS tyle2)
dgLicensedBlocks.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
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...
38
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 =...
7
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>...
2
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...
3
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...
1
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...
7
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...
29
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.