Mike or someone,
I'm in desperate need of help on this. I'm a newb, so here goes:
I've got an ultrawingrid that I've set one of the column styles to be a CheckBox in the grid InitializeLayout event:
.Bands(0).Columns(_dsMyDataSet.ACTIVE_FLGColumn.Ordinal).Style = ColumnStyle.CheckBox
When the grid is loaded and displayed the checkbox in the AddRow has the NULL value. I'm using the BeforeRowActivated event to disable some items on the form when the user enters the addrow of the grid:
With dgMyGrid
If .Rows(0).IsAddRow Then
'Do Stuff Here
End If
One of the actions I need to perform here is to set the value of the checkbox to True or Checked. I don't HAVE to do it in this event, but my requirement calls for it to be checked. At this point I've tried everything I know to do to set the default value to no avail.
Please, some advice or assistance.
Hi,
What is the DataType of the column?
Is it a bound column or an unbound column?
What is your AllowAddNew property set to? Is this a TemplateAddRow that displays in the grid all the time? Or is this an AddRow that shows up when you click on an AddNew button or something like that?
Any of this can be changed if need be to make it work.
mattoxm said:The in the DataSet, the column is of type System.String
This is probably why you are having so much trouble. Why use a checkbox for a string column? The checkbox expects a boolean.
Try handling the InitializeTemplateAddRow event and do something like this:
e.Row.Cells["My Checkbox Column].Value = true.ToString();
I'm not sure that will work, though. You might have to make the column a boolean, or else hide the real column and use an unbound boolean column as a sort've stand-in.
I have the solution worked out and an actual reason why this has caused me so much trouble in the first place. I'll post it up, but I'm working under a crushing deadline right now and don't have the time to actually word it so other people who may come across the same issue will understand what my problem was.
I WILL post a follow up.