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

DataGrid control question

Dear all

Does anybody know how to set a cell as read only in DataGrid control. My situation is the cell editable/read only decided by another column's value on the same row. Thanks inadvance

Christina
Jul 21 '05 #1
3 1066
You can set the datacolumn that it's bound to to read-only or you can apply
a DataGridTableStyle From there, youi'll need to apply a
DataGridColumnStyle. It provides a Read-Only property
http://www.knowdotnet.com/articles/cgrid.html

HTH,

Bill
www.devbuzz.com
www.knowdotnet.com
"Christina" <an*******@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
Dear all,

Does anybody know how to set a cell as read only in DataGrid control. My situation is the cell editable/read only decided by another column's value
on the same row. Thanks inadvance.
Christina

Jul 21 '05 #2
Ryan

Thanks for your response. By using DataGridColumnStyle I can set up the whole column as read-only. How can I set up only one cell in the column as read only, and other cells in this column are still editable? Could you please attach a short sample code to me. Thank you very much for your help

Christin

----- William Ryan eMVP wrote: ----

You can set the datacolumn that it's bound to to read-only or you can appl
a DataGridTableStyle From there, youi'll need to apply
DataGridColumnStyle. It provides a Read-Only propert
http://www.knowdotnet.com/articles/cgrid.htm

HTH

Bil
www.devbuzz.co
www.knowdotnet.co
"Christina" <an*******@discussions.microsoft.com> wrote in messag
news:60**********************************@microsof t.com..
Dear all
Does anybody know how to set a cell as read only in DataGrid control. M situation is the cell editable/read only decided by another column's valu
on the same row. Thanks inadvance Christin


Jul 21 '05 #3
It doesn't work for individual cells. You're going to have to trap
currentcellchanged or some other event and undo whatever tehy change b/c i
don't believe there's a property that you can set.
"Christina" <an*******@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
Ryan,

Thanks for your response. By using DataGridColumnStyle I can set up the whole column as read-only. How can I set up only one cell in the column as
read only, and other cells in this column are still editable? Could you
please attach a short sample code to me. Thank you very much for your help.
Christina

----- William Ryan eMVP wrote: -----

You can set the datacolumn that it's bound to to read-only or you can apply a DataGridTableStyle From there, youi'll need to apply a
DataGridColumnStyle. It provides a Read-Only property
http://www.knowdotnet.com/articles/cgrid.html

HTH,

Bill
www.devbuzz.com
www.knowdotnet.com
"Christina" <an*******@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
> Dear all,
>> Does anybody know how to set a cell as read only in DataGrid
control. My
situation is the cell editable/read only decided by another column's value on the same row. Thanks inadvance. >> Christina


Jul 21 '05 #4

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

Similar topics

2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
2
by: Sky | last post by:
Hello: Another question about trying to wring functionality from a DataGrid... Have a DB table of "Contacts" -- 14 or more fields per record Show in datagrid -- but only 5 columns (First,Last,...
10
by: Jennyfer J Barco | last post by:
Hello, I have a datagrid that brings some information from a query. I need to have a checkbox in each row so the user can select the rows he wants to reprint. Is it possible to have a checkbox...
0
by: Gujju | last post by:
Hi all, Have a question from the following post to create user control in a Datagrid.... http://www.dotnet247.com/247reference/msgs/45/225337.aspx I have a question.... I can create the...
3
by: Skowronek | last post by:
What is the best method to obtain a data value from a parent datagriditem from a child datagrid - datagrid footer item command event handler? Here is the layout of my asp.net controls ...
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...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
7
by: Mark B | last post by:
Can someone write some VB.Net example code for me that does this: 1) Creates a gridview control with the results of a SQL stored procedure that has 1 parameter (text) 2) Adds an extra column...
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...

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.