473,800 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 programmaticall y 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 886
Cor
Hi Garry,

Have a look at datagridtablest yles and inside that the gridcolumnstyle s
Can do for you, more than you expect now I think

I hope this helps,

Cor

1. Does anyone know how to programmaticall y 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********@gfn et.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 programmaticall y 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/vbtchformatting windowsformsdat agridvi
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/vbtchformatting windowsformsdat agridvi
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
3056
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 populated by the items in an arraylist shown in the code below. When the button is clicked I would also like the code to remove the items from the Arraylist. I've very little experience working with datagrids and arraylists so im finding this...
2
4338
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 how to use this code? please help! http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20862953.html
1
4343
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 (watch the layout, some have child controls):
5
5914
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 changing the size of the form The code is at the following location in the January, 2004 help ms-help://MS.VSCC.2003/MS.MSDNQTR.2004JAN.1033/cpref/html/frlrfSystemWindowsFormsDataGridClassTopic.ht You can also find it by doing a search for...
14
1844
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 will be used to populate information coming from a Webservice. (No datasets - No datareaders). So, I do not know see how to use the "datasource".
6
2751
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 freeze.
13
2498
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 them. In a plain vanilla DataGrid, when you click on the RowHeader, the appropriate row changes colors. I ASSUME this should be done in the Paint (or PaintText) override of the DataGridColumnStyle in question. My problem is that I don't know...
3
2522
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 others. One of the custom format is as follows: dsmessages_dt.Columns.Add("Image", GetType(Image)) I had a problem of when I used a checkbox in the grid that was bound to the datatable that it would not update my dataset. So I created another...
4
2138
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 Delete button on the end of each row. I am unable to gain access to the event when the button is clicked. I don't fully understand how the click gets connected to the C# code,
9
2730
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 code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10273
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.