hi!
I've added a checkbox column to my grid, but i can't change it's value - if i click it nothing happens, the cell doesn't activate. Here's the code :
_locDataSet.Tables[0].Columns.Add("Select", typeof(bool),"false");
LOCValuesGrid.DisplayLayout.Bands[0].Columns[2].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox;
LOCValuesGrid.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(LOCValuesGrid_AfterCellUpdate);
Any ideas?
Thanks!
What do you mean by "doesn't activate"? Is it disabled or just the event doesn't fire?
If it is disabled, that depends if this value is writable or not in the data source.
If the event doesn't fire, AfterCellUpdate is fired only after the cell exit edit mode (for example, when you set the focus to another cell). For an immediate event, use the CellChange event but look in the Text property since the Value is the old one.
It does not allow clicking on it - here's an image after i click on the checkbox
Probably the way you set it to false is causing the problem. BTW, this column is considered bound from the grid aspect.
I've set it to false like this, nothing fancy:
_locDataSet.Tables[0].Columns["Select"].ReadOnly = false;
p.s. : bound to what ?
Sorry but I'm not using datasets so often.
The grid column is bound to the datatable column. The grid does not care if this column is bound to a database or not. Unbound column is a column that does not exist in the datatable.
Ok, so if i want to add an unbound column that will hold a checkbox how should i proceed?
I only need to be able the select rows by checking a checkbox.
Open the grid designer, got to columns and click on 'Add unbound column". Set its type to boolean.
Try to run the version utility to upgrade your project.
Thanks Amir!
This was it.
Another small question.
I've used the trial NetAdvantage to build an app, and yesterday i bought the licence for it. I've uninstalled the old NetAdvantage, installed the new downloaded one with the registered with the cd key. Now when i run the app i don't get the "is availabe for x more days of use" message, but i still get the "this was created with a demo versino of netadvantage message".
What should i do?
If you set this column cell activation to AllowEdit and it still doesn't work, you probably disabled the edit to the whole grid before that.
Hi Amir!
I tried to add an unbound column programmatically like this :
MGRValuesGrid.DisplayLayout.Bands[0].Columns.Add( "Select");MGRValuesGrid.DisplayLayout.Bands[0].Columns["Select"].DataType = typeof(Boolean);
but the result is the same as in the above situation - cannot check the checkbox.