I am defining a RadGrid in a user control with the following definition in the .ascx:
I am dynamically creating and adding each column with this:
This creates a mostly working grid. The problem is that on the call to the grid1DS data source, a filter expression is returned with an empty expression for the DataField value (e.g. filtering on a name field for "Contains" John):
(it[""].ToString().Contains("John"))
Normally, it[""] would be it["DataField identifier"]. So apparently the DataField isn't being properly set in the browser, despite being properly defined in the code above (confirmed by breakpoints.)
So - thoughts, solutions?
<telerik:RadGrid ID="grid1" OnNeedDataSource="grid1DS" PageSize="20" AllowPaging="True" AutoGenerateColumns="False" AllowSorting="True" CellSpacing="-1" GridLines="Both" Style="text-align: left;" OnSelectedIndexChanged="grid1_SelectedIndexChanged" AllowFilteringByColumn="True" EnableViewState="true" runat="server"> <MasterTableView EnableColumnsViewState="true"></MasterTableView> <PagerStyle Mode="NextPrevAndNumeric" HorizontalAlign="Left" /> <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true"> <Resizing AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="true" ClipCellContentOnResize="false" EnableRealTimeResize="true" AllowResizeToFit="true" /> <Selecting AllowRowSelect="True" /> </ClientSettings></telerik:RadGrid>I am dynamically creating and adding each column with this:
Dim dscol As DataColumn
Dim col As Telerik.Web.UI.GridBoundColumn
...
col = New GridBoundColumn()col.DataField = dscol.ColumnNamecol.UniqueName = dscol.ColumnNamecol.HeaderText = dscol.ColumnNamecol.Resizable = Truecol.SortExpression = col.DataFieldcol.AllowFiltering = Truegrid1.Columns.Add(col)This creates a mostly working grid. The problem is that on the call to the grid1DS data source, a filter expression is returned with an empty expression for the DataField value (e.g. filtering on a name field for "Contains" John):
(it[""].ToString().Contains("John"))
Normally, it[""] would be it["DataField identifier"]. So apparently the DataField isn't being properly set in the browser, despite being properly defined in the code above (confirmed by breakpoints.)
So - thoughts, solutions?
