473,320 Members | 1,612 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,320 software developers and data experts.

Datagrid tablestyle problem

guy
I have a datagrid with tablestyles and columnstyles set up using the
designer, there are 4 columns, bount to 4 of the properties of an object held
in an arraylist

the binding works fine, the data displaying correctly and is editable,
however the table and columnstyles are ignored when displaying, the grid just
using the default formatting and displays all properties of the object. I
have checked that the grid has the correct table and columnstyles after
binding.

any ideas where I can look?

guy
Nov 21 '05 #1
6 1377
Guy,

One of the possiblilities (what is mostly the problem in this) is that you
have not set the mappingname of your datagridtablestyle and/or the
datagridcolumnstyles.

I hope this helps?

Cor

"guy" <gu*@discussions.microsoft.com>
..> I have a datagrid with tablestyles and columnstyles set up using the
designer, there are 4 columns, bount to 4 of the properties of an object held in an arraylist

the binding works fine, the data displaying correctly and is editable,
however the table and columnstyles are ignored when displaying, the grid just using the default formatting and displays all properties of the object. I
have checked that the grid has the correct table and columnstyles after
binding.

any ideas where I can look?

guy

Nov 21 '05 #2
guy
Hi Cor,
It turns out that thhis is actually working correctly, however only if I
have data in the arraylist.
How do I display column headers when there is no data, eg before the
operator has entered any?

"guy" wrote:
Hi Cor,

I have the following code to set the mapping name:-
me.dgBlocks.TableStyles(0).MappingName = lic.Blocks.GetType().Name

and for the ColumnStyles the MappingName is the name of each Property I want
to display

is this correct

cheers

guy

"Cor Ligthert" wrote:
Guy,

One of the possiblilities (what is mostly the problem in this) is that you
have not set the mappingname of your datagridtablestyle and/or the
datagridcolumnstyles.

I hope this helps?

Cor

"guy" <gu*@discussions.microsoft.com>
..> I have a datagrid with tablestyles and columnstyles set up using the
designer, there are 4 columns, bount to 4 of the properties of an object

held
in an arraylist

the binding works fine, the data displaying correctly and is editable,
however the table and columnstyles are ignored when displaying, the grid

just
using the default formatting and displays all properties of the object. I
have checked that the grid has the correct table and columnstyles after
binding.

any ideas where I can look?

guy


Nov 21 '05 #3
Guy,

I never used this with an arraylist, however when I use a datatable or a
dataview which is empty than the header as named in the
tablestyle.headertext is showed.

I hope this helps somehow.

Cor
Nov 21 '05 #4
Hi,

Use ArrayList as the tablestyles mapping name when binding to an
arraylist.

Ken
-----------------
"guy" <gu*@discussions.microsoft.com> wrote in message
news:11**********************************@microsof t.com...
I have a datagrid with tablestyles and columnstyles set up using the
designer, there are 4 columns, bount to 4 of the properties of an object
held
in an arraylist

the binding works fine, the data displaying correctly and is editable,
however the table and columnstyles are ignored when displaying, the grid
just
using the default formatting and displays all properties of the object. I
have checked that the grid has the correct table and columnstyles after
binding.

any ideas where I can look?

guy
Nov 21 '05 #5
guy
Hi Cor,

I have the following code to set the mapping name:-
me.dgBlocks.TableStyles(0).MappingName = lic.Blocks.GetType().Name

and for the ColumnStyles the MappingName is the name of each Property I want
to display

is this correct

cheers

guy

"Cor Ligthert" wrote:
Guy,

One of the possiblilities (what is mostly the problem in this) is that you
have not set the mappingname of your datagridtablestyle and/or the
datagridcolumnstyles.

I hope this helps?

Cor

"guy" <gu*@discussions.microsoft.com>
..> I have a datagrid with tablestyles and columnstyles set up using the
designer, there are 4 columns, bount to 4 of the properties of an object

held
in an arraylist

the binding works fine, the data displaying correctly and is editable,
however the table and columnstyles are ignored when displaying, the grid

just
using the default formatting and displays all properties of the object. I
have checked that the grid has the correct table and columnstyles after
binding.

any ideas where I can look?

guy


Nov 21 '05 #6
guy
Hi Cor,

I have the following code to set the mapping name:-
me.dgBlocks.TableStyles(0).MappingName = lic.Blocks.GetType().Name

and for the ColumnStyles the MappingName is the name of each Property I want
to display

is this correct

cheers

guy

"Cor Ligthert" wrote:
Guy,

One of the possiblilities (what is mostly the problem in this) is that you
have not set the mappingname of your datagridtablestyle and/or the
datagridcolumnstyles.

I hope this helps?

Cor

"guy" <gu*@discussions.microsoft.com>
..> I have a datagrid with tablestyles and columnstyles set up using the
designer, there are 4 columns, bount to 4 of the properties of an object

held
in an arraylist

the binding works fine, the data displaying correctly and is editable,
however the table and columnstyles are ignored when displaying, the grid

just
using the default formatting and displays all properties of the object. I
have checked that the grid has the correct table and columnstyles after
binding.

any ideas where I can look?

guy


Nov 21 '05 #7

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

Similar topics

2
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...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
14
by: Brett Sinclair | last post by:
Hello everybody I'm still on the learning curve here...and from what I read, I created inherited datagrid class so I could have icons, combobox...etc in the columns of my datagrid. The grid...
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
4
by: Jeff | last post by:
I am stuck on trying to generate two columns headers for a datagrid on form load. I can use a datatable as the datasource and get the results I want, but I want to set different column widths and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.