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

Is it possible to reapply a form-based tablestyle for a datagrid?


Hi all,

I have a datagrid on a form which I have set the datasource (through the form
designer) to be a dataset that I have added to the form, also through the
form designer. I then have added a tablestyle which is mapped to the relevant
table in the dataset that is associated to the datagrid and I get pre-drawn
column headings for my datagrid.

Problem is I am losing these headings when I bind data to the datagrid from
another source (as part of a button click event). The reason this happens is
I have my own user class that inherits from the CollectionBase. I then bind
this user class to my datagrid and the public properties within my user class
appear on the datagrid as the headings thus overwritting the pre-drawn
headings.

What I would like to achieve is to reapply the tablestyle that I had setup
for the datagrid in the form designer orginally. Is this possible?

Is there an alternative way to achieve what I want while keeping my user
class ?

Any help is appreciated.
regards,

Mac
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200507/1
Nov 21 '05 #1
2 1083
Hi,

Use Collection for the tablestyle's mapping name when you bind
the grid to an collection. Use Arraylist for the mapping name when you bind
to an arraylist. I would try the Name of your user class for the mapping
name

Ken
--------------
"Mac via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message
news:51***********@DotNetMonster.com...

Hi all,

I have a datagrid on a form which I have set the datasource (through the
form
designer) to be a dataset that I have added to the form, also through the
form designer. I then have added a tablestyle which is mapped to the
relevant
table in the dataset that is associated to the datagrid and I get pre-drawn
column headings for my datagrid.

Problem is I am losing these headings when I bind data to the datagrid from
another source (as part of a button click event). The reason this happens is
I have my own user class that inherits from the CollectionBase. I then bind
this user class to my datagrid and the public properties within my user
class
appear on the datagrid as the headings thus overwritting the pre-drawn
headings.

What I would like to achieve is to reapply the tablestyle that I had setup
for the datagrid in the form designer orginally. Is this possible?

Is there an alternative way to achieve what I want while keeping my user
class ?

Any help is appreciated.
regards,

Mac
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200507/1
Nov 21 '05 #2

Hi Ken,

Thank you for your suggestion. I am a bit confused as to what to actually do.
Are you able to provide me with a code snippet?

I assume what I have to do is after I populate the datagrid, I need to
reapply the tablestyle. But in looking at the attributes for the datagrid and
the further sub-attributes for the tablestyles there is none to actually set
the tablestyle only to add a new tablestyle.

Is there a way to actually add a tablestyle that alredy exists in the
collection?

regards,

Mac
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200507/1
Nov 21 '05 #3

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

Similar topics

2
by: Gert Schumann | last post by:
I want to delete just parts of tables, so I can't use 'TRUNCATE'. As I want to delete about millions of lines, I need a very big rollback segment. The best way would be to delete without using...
20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
2
by: Nick Gilbert | last post by:
Hi I have a number of pages where it is valid for the user to enter HTML. On these pages, I have turned off RequestValidation ("ValidateRequest = false" in the page directive) so that the...
14
by: foxchan | last post by:
A Newbie question. Is it possible? Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim oNewForm As Form1 'if already create a form...
8
by: tranky | last post by:
i hope you can help me! It's possible create a moveable panel in vb.net? Click with mouse over it and move it everywhere!?!? It's possible? thank u!
3
by: Patrick A | last post by:
All, My form "FRM_Main" contains 2 subforms, each an instance of the form "FRM_Testators" The object name of instance 1 of the form is "SFRM_Clients". The object name of instance 2 of the form...
10
by: mbatestblrock | last post by:
I dont know if this is possible.. I have a form frmCustomers with a subform sfrmCustomers and in the subform I have a unbound text field in the footer txtCOUNT with the control source of ...
7
by: Robert S. | last post by:
Searching some time now for documents on this but still did not find anything about it: Is it possible to replace the entry screen of MS Office Access 2007 - that one presenting that default...
3
by: soapshack | last post by:
I'm trying to capture the values that are currently being Autofiltered by the user so I can re-apply them after I'm done with the code. Basically, if I can capture these four or five main column's...
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: 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
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
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,...
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
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...
0
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...
0
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,...

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.