I am using version 2009.1 to create a XamWebGrid in my code behind. I set the ItemSource to my datasource which is an Observable Collection. All columns are ReadOnly except for the first column which is a checkbox. The user can check or uncheck this -
The problem is that checking or unchecking seems to be a 2 click process: 1 click to activate the cell & a second click to change the value. How can I set this up so that the user only has to click once?
I have the following settings:
this.ctl_ResultsWebGrid.EditingSettings.AllowEditing = Infragistics.Silverlight.EditingType.Row;
this.ctl_ResultsWebGrid.EditingSettings.IsEnterKeyEditingEnabled = true;
this.ctl_ResultsWebGrid.EditingSettings.IsOnCellActiveEditingEnabled = true;
this.ctl_ResultsWebGrid.EditingSettings.IsF2EditingEnabled = true;
this.ctl_ResultsWebGrid.EditingSettings.IsMouseActionEditingEnabled = Infragistics.Silverlight.MouseEditingAction.SingleClick;
this.ctl_ResultsWebGrid.EnterEditMode();
Hi,
Using the CheckBox column, this isn't really possible, b/c we wanted to be able to support editing events, and if we didn't have this mechanism then we wouldn't know that the cell was entering or exiting edit mode.
However, you can still achieve this using a TemplateColumn with a CheckBox and binding to the IsChecked property. The only thing to note is that it won't participate in the editing events.
-SteveZ
Using a Templatecolumn with a checkbox solves the issue at cell level.. But a similar issue exists when the AllowFiltering mode is set to FilterRowTop (or Bottom)...
The row which allows you to filter shows a checkbox, which when clicked does not apply the filter immediately.... the filter is applied only after the focus from that cell changes..
Any way to resolve this?
I am building the XamWebGrid in my code behind not in Xaml. I am doing it this way because the number of columns needed in the grid is dictated by the data returned for each request.
I am having problems building the Template Column in the code behind because you cannot create a Data Template in the code behind in Silverlight. I found your August 2009 discussion on this where you said you'd have to have a predefined DataTemplate in the resources of your xaml, whether its your current page or app.xaml and then resolve the DataTemplate in the codebehind. I think this may work for me but I can't figure out how to do this. Can you show me a code example of how to define the Checkbox in a predefined Data Template? And then resolve it in the code behind?