473,385 Members | 2,028 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,385 software developers and data experts.

DataGridBoolColumn inaccessable

I have a DataGrid on a form in my application that is bound to an xml file
and I have set the table style to contain a few columns with one editable
one, a DataGridBoolColumn.

I set DataGrid.ReadOnly to True and the DataGridBoolColumn.ReadOnly to false
but I still cannot access the check box. When I click on the box nothing
happens.

If I set DataGrid.ReadOnly to True then I get the option to add a new line
on the grid, which I don't want, and the cell with the checkbox in it acts
very strange. By strange I mean that selecting the checkbox takes a couple
of steps, you have to select the cell then you are allowed to select the
checkbox.

How can I get the column to show the checkbox and have it selectable, but
not have the new entry row show up and not have the rest of the grid
editable.

Thanks,

B.J.
Nov 21 '05 #1
1 1577
The only way I know how to do what you want is to use a DataView. Then I
think you'd have to load the xml into a DataTable, set the DataTable to a
DataView, then bind it to the DataGrid. Set teh DataView.AllowNew property
to be false. This willl stop the new row from showing up and you don't have
to change the DataGrid.ReadOnly property. Just set all the
DataGridColumns.ReadOnly to true except the ones you wanted. That's how I
did it.

Good Luck
Chris
"B.J. Raiford" <bj********@hotmail.com> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
I have a DataGrid on a form in my application that is bound to an xml file
and I have set the table style to contain a few columns with one editable
one, a DataGridBoolColumn.

I set DataGrid.ReadOnly to True and the DataGridBoolColumn.ReadOnly to
false
but I still cannot access the check box. When I click on the box nothing
happens.

If I set DataGrid.ReadOnly to True then I get the option to add a new line
on the grid, which I don't want, and the cell with the checkbox in it acts
very strange. By strange I mean that selecting the checkbox takes a
couple
of steps, you have to select the cell then you are allowed to select the
checkbox.

How can I get the column to show the checkbox and have it selectable, but
not have the new entry row show up and not have the rest of the grid
editable.

Thanks,

B.J.

Nov 21 '05 #2

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

Similar topics

1
by: cmelnick | last post by:
I created an interface, IMyInterface and placed it in namespace MyPackage. Something like this: namespace MyPackage { interface IMyInterface { // Stuff } } This interface as well as some...
1
by: Erald Kulk | last post by:
I have a problem with a datagridboolcolumn that drives me almost crazy. I have a sql server table with several columns of which one is a column called ok which is a bit with default value 0. In...
2
by: PeterZ | last post by:
Hi, In the past I've successfully databound a conventional Winforms checkbox to a number column in an Oracle table, where 1 represents true and 0 represents false. The checkbox would be ticked...
4
by: Ubi | last post by:
Hi, my code is: myDataTBL.Columns.Add("checked",System.Type.GetType("System.Boolean")); DataGridBoolColumn cs1 = new DataGridBoolColumn(); cs1.NullValue=false; cs1.TrueValue=true;...
2
by: James Goodman | last post by:
I have a number of bool columns within a datagrid, but they dont work as expected. The underlying table is Access 2000. The datatype for the underlying fields is Yes/No. I am attempting to...
1
by: Edward Koucherian | last post by:
I'm getting the incorrect display value on my DataGrid column. The field is numeric (1) in the SQL database table The Code is txtCol = New DataGridBoolColumn txtCol.MappingName = "MyCol"...
2
by: nate axtell | last post by:
I'm trying to create a custom DataGridBoolColumn. I inherit DataGridColumnStyle and create a public CheckBox variable. This columnType will be mapped to a dataTable boolean column. What are the...
0
by: Ryan Liu | last post by:
Hi, I have a strange problem, should be very simple, take me days I couldn't finger out. Really appreciate if you can help me fine the problem. I am trying to use DataGridBoolColumn, but I...
0
by: Brett Romero | last post by:
I've created a DataGrid DataGridBoolColumn column in a tablestyle and mapped it correctly to a datatable. Problem is the column is always grayed and I can't uncheck it. I have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...

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.