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

DataTable and DataGrid

hello,

i have dataGrid and Created a DataTable which will be the dataGrid Source.

how can design my coulmns ( i want to set the width for example)?

and i can i set a dataSet for my DataTable?

thank you
Nov 16 '05 #1
2 5554
Hello Gidi,

Assuming you mean the WinForms datagrid:
You can control the width of the data grid columns by populating the
DataGridTableStyle's Columns collection manually with the appropriate
DataGridColumnStyle-derived classes such as DataGridTextBoxColumn and
setting properties such as Width on the column styles.

The "Customizing the Windows Forms DataGrid" article by Dr. Clay Burch,
available in MSDN, has a lot of detail on this.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Gidi" <sh*****@hotmail.com.dontspam> wrote in message
news:51**********************************@microsof t.com...
hello,

i have dataGrid and Created a DataTable which will be the dataGrid Source.

how can design my coulmns ( i want to set the width for example)?

and i can i set a dataSet for my DataTable?

thank you


Nov 16 '05 #2
Thanks Dimitry,
that i know, the onlt problem is that i tried with no success to connect my DataGridTableStyle to my DataTable and because of that i can't use it.

what can i do?

"Dmitriy Lapshin [C# / .NET MVP]" wrote:
Hello Gidi,

Assuming you mean the WinForms datagrid:
You can control the width of the data grid columns by populating the
DataGridTableStyle's Columns collection manually with the appropriate
DataGridColumnStyle-derived classes such as DataGridTextBoxColumn and
setting properties such as Width on the column styles.

The "Customizing the Windows Forms DataGrid" article by Dr. Clay Burch,
available in MSDN, has a lot of detail on this.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Gidi" <sh*****@hotmail.com.dontspam> wrote in message
news:51**********************************@microsof t.com...
hello,

i have dataGrid and Created a DataTable which will be the dataGrid Source.

how can design my coulmns ( i want to set the width for example)?

and i can i set a dataSet for my DataTable?

thank you


Nov 16 '05 #3

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

Similar topics

1
by: Dr. Len | last post by:
Hi all! In my app I implemented a separate worker thread that handles network communication using Net.Sockets. It needs to make updates to a DataTable object, which is displayed to the user by a...
0
by: Emerson | last post by:
The following assumes a System.Windows.Forms.DataGrid with a System.Data.DataTable set as the DataSource. I'm programming in C# Here's my scenario I click in a cell on a DataGrid. I enter some...
9
by: VMI | last post by:
We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the...
2
by: Bajgon | last post by:
Hello, I have got a DataGrid and a DataTable, which is its DataSource. I can use DataTable.Rows.Find(key_value) method to locate any row in the DataTable, using values of key column. The...
2
by: ven | last post by:
Hello i have a dynamic datatable in my page. I wanna to write data to textboxes and after click on button "ADD data" i want to refresh datagrid on page... Here is my code : ' Insert page code...
3
by: Tim::.. | last post by:
I currently have the following datagrid but want to turn the name and email column into a hyperlink in the codebehind! Can someone please tell me how I achieve this! Thanks Private Sub...
4
by: bijoy | last post by:
My page has a Listbox called Rooms, a text field called chairPerson and a button called Add. When Add is clicked, the script needs to display the selected info in a datagrid. For example, if...
0
by: Becker | last post by:
I have a datatable that I use to display running processes. These running processes are spawned as different threads. I use the readerwriterlock class to ensure that when I write to the datatable,...
3
by: Datatable Dataset Datagrid help | last post by:
Hi I am somewhat confused, I am new at VB.net I use XML data, I have a datagrid, I created a datatable so that I can create a custom format like true is this graphic false is this graphic and...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.