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
Hello,
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.
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.
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.
Hi MD,
I asked that question (how would you even do it) because I was trying to point out it would take some lines of code to achieve the functionality of what the grid is currently doing. I wanted to see though to see if I had anything remotely similar on the init of that grid of which I don't. No valuelist, no editor....just binding a view to the grid's datasource and setting activation and selection.
Maybe it is this though?
CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
Going to try and comment that out and see what happens!
The most efficient way I can think of to have your column display true and false and then a checkbox when a given cell is active would be to use a ValueList and toggle the ColumnStyle enumeration from 'Checkbox' to 'Edit' in the AfterCellActivate and BeforeCellDeativate events.
I attached a sample demonstrating this. Keep in mind that the sample is designed to have the end-user to click once to activate the cell and then click again to update the checkbox. Let me know if you have any questions.