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

datagrid cell readonly posible?

JJ
Hi

does anyone know how to make a datagrid CELL readonly
Nov 20 '05 #1
1 1093
Hi,

Add a tablestyle to a grid. Set the datagridtextboxcolumn readonly
property to false.
Private Sub SetupGrid()

Dim ts As New DataGridTableStyle

ts.MappingName = "Categories"

Dim colPhoto As New DataGridTextBoxColumn

With colPhoto

..MappingName = "Picture"

..HeaderText = "Photo"

..Width = 150

End With

Dim colName As New DataGridTextBoxColumn

With colName

..MappingName = "CategoryName"

..HeaderText = "Name"

..Width = 80

End With

Dim colDescription As New DataGridTextBoxColumn

With colDescription

..MappingName = "Description"

..HeaderText = "Description"

..Width = 80

..ReadOnly = True

End With

ts.GridColumnStyles.Add(colPhoto)

ts.GridColumnStyles.Add(colName)

ts.GridColumnStyles.Add(colDescription)

DataGrid1.TableStyles.Add(ts)

ts = Nothing

colDescription = Nothing

colName = Nothing

colPhoto = Nothing

End Sub

Ken
-------------------------
"JJ" <ji********@hotmail.com> wrote in message
news:CA**********************************@microsof t.com...
Hi,

does anyone know how to make a datagrid CELL readonly?

Nov 20 '05 #2

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

Similar topics

0
by: Job Lot | last post by:
I have an Expense Data Entry form which contains a DataGrid showing various expense categories. There are three columns Description, Cash Exp, Credit Exp, where Description column is readonly. ...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
14
by: scorpion53061 | last post by:
In this code what do I have to do to get the read only and Height property to work? this is going into a datagrid. Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor =...
8
by: Scott Meddows | last post by:
I have a datagrid control that I've inherited from the base datagrid control (Source below). I am applying a datatable style onto the datatable that I assign as my datasource. All of my column...
4
by: John Smith | last post by:
Hi All; I am using the HeaderAndDataAlignColumn class from Ken Tucker. I have customized it for a wider row. I reposition the DrawString method so the text is centered vertically in the row. ...
2
by: Flack | last post by:
Hey guys, I have a DataGrid and DataTable field in my class : private ImageDataGrid dataGrid1; //ImageDataGrid extends dataGrid and just overides OnMouseDown private DataTable dt = new...
6
by: Doug Bell | last post by:
Hi I have a DataGrid with some hidden columns and also some read Only and some ComboBox Columns. Sandard Tabbing through the Datagrid sees the focus go to the hidden columns requiring further...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.