|
调试了一下,需要为下拉列表的列增加 RenderFunction,更新后的代码如下所示:- <form id="form1" runat="server">
- <x:PageManager ID="pm" runat="server" />
- <x:Grid runat="server" ID="g_AdvancedSearch" ShowHeader="false" AllowCellEditing="true"
- Height="300">
- <Toolbars>
- <x:Toolbar ID="Toolbar2" runat="server">
- <Items>
- <x:Button ID="btn_Add" Text="新增条件" Icon="DatabaseAdd" runat="server" EnablePostBack="false">
- </x:Button>
- <x:Button ID="btnDelete" Text="删除选中行" Icon="Delete" EnablePostBack="false" runat="server">
- </x:Button>
- </Items>
- </x:Toolbar>
- </Toolbars>
- <Columns>
- <x:RenderField ColumnID="rf_Logic" FieldType="String" RendererFunction="renderDDL" HeaderText="逻辑" Width="100">
- <Editor>
- <x:DropDownList ID="ddl_Logic" runat="server" Required="true">
- <x:ListItem Text="并且" Value="and" />
- <x:ListItem Text="或者" Value="or" />
- </x:DropDownList>
- </Editor>
- </x:RenderField>
-
- </Columns>
- </x:Grid>
- </form>
- <script>
- var ddlGenderID = '<%= ddl_Logic.ClientID %>';
- function renderDDL(value, metadata, record, rowIndex, colIndex) {
- return X(ddlGenderID).x_getTextByValue(value);
- }
- </script>
复制代码 |
|