Thank you for the example you posted. I can now see how this works. I've realized my issue is that I'm generating the grid dynamically and therein I'm having the issue. So here is an excerpt from my code, at the point that I'm generating a GridBoundColumn:
GridBoundColumn col = new GridBoundColumn();
col.DataField = item.ColumnName;
col.UniqueName = item.ColumnName;
col.SortExpression = item.ColumnName;
col.HeaderText = item.HeaderName;
col.HeaderStyle.Width = Unit.Pixel(item.ColumnWidth);
col.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
col.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
col.DataType = typeof(int);
As you can see from the second-to-the-last line, I'm setting a datatype of int. This is not working. Somehow, I need to set a datatype of System.Int32. I've tested this on another file where the grid is declared normally and I set the DataType to System.64, like so:
<telerik:GridBoundColumn DataField="WorkOrderID" HeaderText="WO ID"
HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="80"
UniqueName="WorkOrderID" SortExpression="WorkOrderID" FilterControlWidth="40px" DataType="System.Int64" />
This will not work. When I switch to System.Int32 though, it does work. IN my situation above though, I'm generating the grid dynamically and I can't seem to figure out how to do this. The best answer I've found so far is to use: col.DataType = typeof(int);
This does not work.How do I do this? And please do not point me to the following link. There is nothing there about DataType.
Thank you in advance Marin.