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

DataGrid Object Help

I have a dataGrid whose datasource is a populated
dataTable object. The dataTable consists of two columns
and data is often cleared and repopulated during user
interaction. I have two questions:

1. Does anyone know how to programmatically set a
column to a specific width (percentage or pixels, etc)?
2. Does anyone know how to show a subset of a
DataTable's columns?
3. Does anyone know how to force a mouse click event
to highlight (select) the entire row as if it were
clicked at the leftmost column?

Gary

Nov 20 '05 #1
3 873
Cor
Hi Garry,

Have a look at datagridtablestyles and inside that the gridcolumnstyles
Can do for you, more than you expect now I think

I hope this helps,

Cor

1. Does anyone know how to programmatically set a
column to a specific width (percentage or pixels, etc)?
2. Does anyone know how to show a subset of a
DataTable's columns?
3. Does anyone know how to force a mouse click event
to highlight (select) the entire row as if it were
clicked at the leftmost column?


Nov 20 '05 #2
Hi,

The answer to questions # 1 & 2 is to add a tablestyle to your grid.
http://msdn.microsoft.com/library/de...asicprimer.asp

The answer to # 3.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q689q

Ken
--------------------
"Gary" <gr********@gfnet.com> wrote in message
news:01****************************@phx.gbl...
I have a dataGrid whose datasource is a populated
dataTable object. The dataTable consists of two columns
and data is often cleared and repopulated during user
interaction. I have two questions:

1. Does anyone know how to programmatically set a
column to a specific width (percentage or pixels, etc)?
2. Does anyone know how to show a subset of a
DataTable's columns?
3. Does anyone know how to force a mouse click event
to highlight (select) the entire row as if it were
clicked at the leftmost column?

Gary

Nov 20 '05 #3
Ken

Thanks for your response. I was able to implement my
desired functionality.

One note, however, the article located at
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/dv_vstechart/html/vbtchformattingwindowsformsdatagridvi
sualbasicprimer.asp did not make it clear that the
obj.MappingName properties being set, are being set to
values that map directly to table names and column
names. I may have missed some important explanatory text
somewhere in the article and thought the string
assignments were arbitrary.

I just wanted to give you some feedback. Again, thanks
for your help.

Gary
-----Original Message-----
Hi,

The answer to questions # 1 & 2 is to add a tablestyle to your grid.http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/dv_vstechart/html/vbtchformattingwindowsformsdatagridvi
sualbasicprimer.asp
The answer to # 3.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q689q

Ken
--------------------


Nov 20 '05 #4

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

Similar topics

3
by: Stephen | last post by:
I've got a datagrid with a remove button and I would like to add some code in the code behind page so as whenthe button is clicked the corresponding row in the datagrid is removed. The Datagrid is...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
5
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
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: Agnes | last post by:
I understand it is impossible, but still curious to know "Can I freeze several column in the datagrid, the user can only scroll the first 3 columns (not verical), for the rest of the coulumn, it is...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
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...
4
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
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: 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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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?

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.