I'm testing v2011.1 in Chrome, Firefox and Safari.
All seems to work fine with the exception of checkboxes in WebGrids. Inspecting the HTML code of the page I've discovered that the onpropertychange event is used to catch checkbox changes. That event in not supported in browser different from IE and the onchange event should be used instead.
My application forces page.clienttarget="uplevel" on every page. If I remove this assignment, the onchange event is correctly used when rendering the control, but other ASP.NET controls in the page looks very badly. If I keep that assignment, all work fine but checkboxes in grids.
The browser property on grids is set to Auto.
My question is: how can I force the UltraWebGrid to use the onchange event for checkboxes when rendering the control?
Thanks in advance.
Pier Alberto
Hi Pier,
As far as I can understand, you want to handle the onchange event of a checkbox ( I assume you have an input element of type checkbox). I presume you are using a templated column for your grid.
I am attaching a sample which features an UltraWebGrid with a templated checkbox column with the onchange event handled on the client. The sample uses the Northwind DB.
Please tell me if this helps.
Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support
Thanks Petar for you answer.
My problem was related to the way standard checkbox columns are rendered in Firefox and Chrome when clientarget is forced to "uplevel".
In this case, the rendereed HTML code uses the OnPropertyChange to trap the checkbox changes.
This event is not supported in Firefox and Chrome, so the grid doesn't handle checkbox changes correctly.
I solved the problem by using the Render event of the page where I substitute the "OnPropertyChange" keyword with "OnChange".
Hello Pier,
We are facing the same kind of issue while editing checkbox in ultrawebgrid. Could you please share the code which you have used for fix the issue.
Thanks
Venkata.
Hi Venkata,
it's actually a very simple solution, you've just to override the Render method of the control, like this:
Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter) Dim controlstring As System.IO.StringWriter Dim controlWriter As HtmlTextWriter Dim control As String controlstring = New System.IO.StringWriter() controlWriter = New HtmlTextWriter(controlstring) MyBase.Render(controlWriter) control = controlstring.ToString() control = control.Replace("onpropertychange=", "onchange=") output.Write(control)End Sub
Anyway, I suggest you not to invest further in UltraWebGrid since it has been discontinued and to guarantee compatibility with modern browsers you have to deal with several workarounds like the one above, hoping that any new browser version won't introduce new problems.
I'm too in the process of migrating my web app's UltraWebGrid based grids to the new WebDataGrid object.
Best regards.