473,320 Members | 2,041 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,320 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 1063
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.