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

DataGrid and Tablestyles

Hiya,

I have a table which without any tablestyles and associated columns displays
all the columns of the table as you would expect.
If I add a tablestyle and one column which I then add the TableStyle to the
grid no columns at all show. This grid is visible and i can see the current
position in the grid and the insertion point in the left column but my added
style and it's column don't show. The column is not null, has a wide width
and a column header which is set to visible=true.

//setup command and dataadapter etc..removed for brevity
System.Data.DataSet ds = new DataSet("T_Data");
da.Fill(ds, "T_Data");
grdData.DataSource = ds.Tables["T_Data"];
grdData.Visible = ds.Tables[0].Rows.Count > 0?true:false;
dgstyle1.MappingName = "T_Data";
grdData.TableStyles.Add(dgstyle1);
dgstyle1 is obviously the TableStyle which is added in VSNET's designer and
the column which has a mapping name to the one of the columns in the table
was also added through the designer. I've also tried doing it manually as
well but it's exactly the same!

Removing the last 2 lines will show the entire table as in all the columns
and the column names as the titles. This was working fine until I changed
the Dock style of the grid, undid it and bam...it refused to work. I've
since removed the entire grid and put it all back in again but I still
cannot get the columns to show when I have a TableStyle applied.
I have already pulled all my hair out so to save me starting on my chest and
then...I don't even want to think about it. So please help!

Nev
Nov 16 '05 #1
1 3291
ok I've worked it out finally, it was me and the column names I was using
(mapping names on the columns) I had them back to front so it wasn't
matching anything..doh.
thank God, as the hair pulling was getting painfull.

"nevin" <nevin@[diespam]myself.com> wrote in message
news:40**********************@mercury.nildram.net. ..
Hiya,

I have a table which without any tablestyles and associated columns displays all the columns of the table as you would expect.
If I add a tablestyle and one column which I then add the TableStyle to the grid no columns at all show. This grid is visible and i can see the current position in the grid and the insertion point in the left column but my added style and it's column don't show. The column is not null, has a wide width
and a column header which is set to visible=true.

//setup command and dataadapter etc..removed for brevity
System.Data.DataSet ds = new DataSet("T_Data");
da.Fill(ds, "T_Data");
grdData.DataSource = ds.Tables["T_Data"];
grdData.Visible = ds.Tables[0].Rows.Count > 0?true:false;
dgstyle1.MappingName = "T_Data";
grdData.TableStyles.Add(dgstyle1);
dgstyle1 is obviously the TableStyle which is added in VSNET's designer and the column which has a mapping name to the one of the columns in the table
was also added through the designer. I've also tried doing it manually as
well but it's exactly the same!

Removing the last 2 lines will show the entire table as in all the columns
and the column names as the titles. This was working fine until I changed
the Dock style of the grid, undid it and bam...it refused to work. I've
since removed the entire grid and put it all back in again but I still
cannot get the columns to show when I have a TableStyle applied.
I have already pulled all my hair out so to save me starting on my chest and then...I don't even want to think about it. So please help!

Nev

Nov 16 '05 #2

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

Similar topics

0
by: Michael Schindler | last post by:
I can see my values date and values "S" in the datagrid but if i want save i get the error the cells are null..but i can see. If i chanche the date from 03.03.2003 to manuell 03.03.2003 and...
2
by: michael walser | last post by:
display checkbox in datagrid. I find that there are 3 status: checked - check box with click icon unchecked - blank in check box unknown - click icon but color in gray..... How can I set the...
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.
3
by: Stan Sainte-Rose | last post by:
Hi, I have a winform with 1 datagrid and several datagridtablesStyles mapping different datatables. Is it possible to select a specific DataGridTableStyle for the datagrid ? Or do I have to...
17
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...
0
by: Jorge | last post by:
Hello All I am trying to preserve the width of column in a datagrid made by the user. On form load i use this <code> Me.DataGrid2.TableStyles("artenc").GridColumnStyles (0).Width = 30...
0
by: Asgorath | last post by:
Hello All I am trying to preserve the width of column in a datagrid on form load i use this <code> Me.DataGrid2.TableStyles("artenc").GridColumnStyles(0).Width = 30...
7
by: Doug Bell | last post by:
Hi, How can I determine the number of columns in a DataGrid? What I am trying to do is to build a function that will resize the last column to fill the remaining space in the DataGrid....
0
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...
6
by: Doug Bell | last post by:
Hi I have a DataGrid with some hidden columns and also some read Only and some ComboBox Columns. Sandard Tabbing through the Datagrid sees the focus go to the hidden columns requiring further...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.