Howdy,
I have tons of grids in our application. Every grid except one presents a Boolean or bit from SQL as a checkbox. This one gird that does not work shows True and False. When you click in the cell it then turns into a checkbox. How do I make it look like a checkbox like have on every other grid? I am not setting any special setting on the other grids for it to work.
Thanks,M
The grid will automatically show a checkbox for any field whose DataType is boolean. I'm not sure about a bit field, but as long as it's a Boolean in DotNet, it will default to CheckBox Style.
If it's not doing that, the something you are doing is overriding it. The obvious things to check would the Style or EditorComponent property of the column or cells.
From my experience with other grids in our application the 'bit' field, or the SQL equiv. of Boolean always translates to a checkbox. But the behavior on this one grid is such that the cell shows the word True and False. However when I click in the cell, it shows as a checkbox.
If I asked you how can I configure the cell to behave like that, how would I even do it?
Thanks,M.
Hello,
Unfortuantely the grid does not have this built in and would need some code to be set like the sample demonstrates to achieve the behavior you desire. You can submit a feature request on our ideas website.
I am not sure if you are actually reading my post.
Let me say this again.
I have a grid. I have no special code on that grid other than what I said in the previous post about the cell click action.
When the grid loads, it displays any Boolean value with test True/False.
When I click in the cell, I get a checkbox.
EVERY OTHER GRID IN MY ENTIRE APPLICATION OF WHICH THERE ARE 100 OF THEM AT LEAST DOES NOT BEHAVE THIS WAY.
Why, and how to I get it so that the grid only displays a checkbox JUST LIKE THE REST OF THE GRIDS DO.
I asked how would you even get a grid to behave this way so I could double check the settings of the grid to see that I don't have anything strange set.
Thanks,
M.
I apologize for the misunderstanding but from your earlier post I made a sample of how you would achieve clicking a cell to display a checkbox. You can make sure that a column in the grid displays checkboxes by setting the Style property on the cooresponding column to 'Checkbox'.
UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns[0]; column.Style = ColumnStyle.CheckBox
UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns[0];
column.Style = ColumnStyle.CheckBox
Please attach a solution project that contains two grids with columns behaving differently that demonstrates the behavior and we can certainly investigate this further. Let me know if you have any questions.
It is really hard for me to attach my project as it is a heavily integrated system with a couple hundred thousand lines of code + Database.
Sorry, 1st post is the picture when you click in the cell, here it is when out of the cell.
Still the same!
It's quite strange if you are not setting this style to anything else at any point. In my sample you can see that I had to use a few events to set up this behavior for a boolean column. What is the type for your "Taxable?" column?
Hi,
In SQL it is:
Bit, Not Null Default 0
The grid has it as a Boolean.
I haven't reproduced the issue yet but I created a more simplfied sample that connects the UltraGrid to a local SQL Server Compact database file. I included a button to toggle the column style and the field in the dbo is a bit type.
Let me know if you have any questions. Please, if you can attempt to reproduce the behavior with this sample; send it back to us so I can investigate this further. Thanks.
Hi Mike,
Sorry I know this is a year old but we got busy with some other stuff but this is still an issue. Could there be some other setting that would create behavior in this way? How would I even get it to be this way if I wanted to?