473,465 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataGrid cell question

I created a custom DataGrid. When the user clicks in any of the cells, the
text is highlighted, even so the text is not editable (read only).
How can I avoid that? I want nothing to happen when the user clicks on a
cell.

Here is some sample code from my grid.

Dim tb3 As DataGridTextBoxColumn
tb3 = New DataGridTextBoxColumn
tb3.HeaderText = "Room"
tb3.MappingName = "room_desc"
tb3.NullText = ""
tb3.Width = 120
tb3.ReadOnly = True
ts.GridColumnStyles.Add(tb3)
Thank you for your help,

Steve
Nov 20 '05 #1
2 817
To accomplish this you'll have to override the Edit event in the
DataGridTextBox column. There is some example code at this link:

http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q758q
"Steve" <sf*****@flintind-remove.com> wrote in message
news:u7*************@TK2MSFTNGP12.phx.gbl...
I created a custom DataGrid. When the user clicks in any of the cells, the
text is highlighted, even so the text is not editable (read only).
How can I avoid that? I want nothing to happen when the user clicks on a
cell.

Here is some sample code from my grid.

Dim tb3 As DataGridTextBoxColumn
tb3 = New DataGridTextBoxColumn
tb3.HeaderText = "Room"
tb3.MappingName = "room_desc"
tb3.NullText = ""
tb3.Width = 120
tb3.ReadOnly = True
ts.GridColumnStyles.Add(tb3)
Thank you for your help,

Steve

Nov 20 '05 #2
Thank you scott, that was very helpful.

Steve

"Scott" <sc*****@yahoo.com> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
To accomplish this you'll have to override the Edit event in the
DataGridTextBox column. There is some example code at this link:

http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q758q
"Steve" <sf*****@flintind-remove.com> wrote in message
news:u7*************@TK2MSFTNGP12.phx.gbl...
I created a custom DataGrid. When the user clicks in any of the cells, the text is highlighted, even so the text is not editable (read only).
How can I avoid that? I want nothing to happen when the user clicks on a
cell.

Here is some sample code from my grid.

Dim tb3 As DataGridTextBoxColumn
tb3 = New DataGridTextBoxColumn
tb3.HeaderText = "Room"
tb3.MappingName = "room_desc"
tb3.NullText = ""
tb3.Width = 120
tb3.ReadOnly = True
ts.GridColumnStyles.Add(tb3)
Thank you for your help,

Steve


Nov 20 '05 #3

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

Similar topics

4
by: Terry | last post by:
Hey, Having somewhat of an issue, I have a datagrid which is giving me issues. The Datagrid is setup for the user to double click the row, the row is selected and data within that row populates a...
0
by: Randy | last post by:
Hello, I have two questions... I have a datagrid. I'm capturing the cell via HitTestInfo. The first question is fairly simple. I'm using an example of how to capture the row/column I found on the...
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...
4
by: Kristoffer Arfvidson | last post by:
Im trying to get access to a table in codebehind, because the information in this table is different depending on what it says in the database... So, either I have to access it from codebehind,...
2
by: itgMan | last post by:
hello friends, i have a question about datagrid, i have binded a datagrid with a datatable from values that came from a comma seperated values (.CSV) file i have created textboxes in all...
1
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to...
13
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value....
4
by: Suzanne | last post by:
Hi all, I'm having problems with datagrids and the currentcellchanged event. My problem is this: I have a datagrid on a form, if the user changes the text in a cell on the datagrid then tries to...
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...
1
by: adi busu via DotNetMonster.com | last post by:
Hi I need an event that could help me to update the datagrid current cell data every time it is changed. i tried with currentCellChanged but when i leave the datagrid this event does not occure...
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...
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...
1
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
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.