I have a grid with the definition below. I would like to use client binding given the page's requirements, but I am currently having multiple issues.
Thanks!
<ig:WebDataGrid ID="wdgPlanningAddIncreases" runat="server" AutoGenerateColumns="False" EnableClientRendering="true" AltItemCssClass="rowAlternateGrid" EnableTheming="False" ItemCssClass="rowStyleGrid" DataKeyFields="IncreaseInst" BorderColor="Gray" BorderStyle="None" DefaultColumnWidth="100px" BorderWidth="1px" CellSpacing="1" HeaderCaptionCssClass="headerGrid" ClientIDMode="Static" Height="125px" CssClass="ui-widget-content"> <Columns> <ig:BoundDataField DataFieldName="IncreaseDate" DataFormatString="{0:d}" DataType="System.DateTime" Key="IncreaseDate" CssClass="gridCenterAlign"> <Header Text="Increase Date" CssClass="gridCenterAlign" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="IncreaseTypeText" DataType="System.String" Key="IncreaseTypeText" CssClass="gridCenterAlign"> <Header Text="Increase Type" CssClass="gridCenterAlign" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="IncreaseAmount" DataType="System.String" CssClass="gridRightAlign" Key="IncreaseAmount"> <Header Text="Increase Amount" CssClass="gridRightAlign" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="IncreaseFrequencyTypeText" DataType="System.String" CssClass="gridCenterAlign" Key="IncreaseFrequencyTypeText"> <Header Text="Frequency" CssClass="gridCenterAlign" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="NewScheduledAmount" DataType="System.Decimal" DataFormatString="{0:C2}" CssClass="gridRightAlign" Key="NewScheduledAmount" Width="150px"> <Header Text="Amount" CssClass="gridRightAlign" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="IncreaseInst" DataType="System.Int32" Hidden="True" Key="IncreaseInst"> <Header Text="IncreaseInst" /> </ig:BoundDataField> </Columns> <Behaviors> <ig:Selection CellClickAction="Row" CellSelectType="Single" RowSelectType="Single" SelectedCellCssClass="rowSelectedGrid"> <SelectionClientEvents RowSelectionChanged="wdgPlanningAddIncreases_RowSelectionChanged" /> </ig:Selection> <ig:EditingCore Enabled="true"> </ig:EditingCore> </Behaviors> </ig:WebDataGrid>
Ok, I've come up with workarounds for issues 1 and 2, although I'd still be curious as to why the behavior is different with server vs client rendering.
For #1 I got rid of my ItemCssClass and AltItemCssClass and just modified ig_dataGrid.css to style the grid the way I want. I didn't want to do this as I have many UltraWebGrids that still use those css classes and didn't want to maintain two different sets of classes. But I can live with it.
For #2 I simply added a read-only property to the object I am binding to which exposes the date field as a string with the proper formatting. No big deal at all.
#3 is still a problem though. Any ideas?
Just found the answer to #3 as well in case it helps anyone out. The DefaultColumnWidth attribute causes hidden columns to be visible for client rendered grids. Taking that off and specifying the width explicitly on each column fixed the issue.
IG, you might want to log this as a minor bug.
Hello Peter,
The case created on your behalf is CAS-67625-VP4433
I will contact you through the support system.
Thanks, that's great news. I'll do that.
In my initial post, parts of my grid declaration got cut off on the right, but that first column does in fact have DataType="System.DateTime".
In this case I was not binding to an empty collection server side, but to an actual list of objects with some mock data in them. This is really a prototype/proof of concept for me so at the moment I'm still doing the server side binding and then the client binding after the fact upon a button click. Other than the css issues we've discussed, it's actually working out very nicely, and I'm excited about this new functionality.
Hi ppeters,
Thanks for bringing this issues to our attention. I have actually logged issue 1 and issue 3 as bugs. Their numbers are 79647 and 79646 respectively. It also appeared that column css wasn't being applied. That was fixed as part of 79646. I'd suggest getting in contact with Developer Support to have your case attached to these bugs so you can be notified when they make it into a Service Release.
As to your second issue. Were you binding to an empty collection on the server? It may not have been able to figure out the type of the column was DateTime. You could try to set DataType="System.DateTime"
regards,David Young