Obout 网格过滤包含由模板填充的文本的列
我正在尝试过滤已绑定到模板的 Obout Grid 中的列。
Background
列的 DataField
只是 History
表的外键 ID,该表包含某个对象的基本状态(例如名称、资产标签、序列号、附加信息等)如果用户要更改对象的某个状态(例如附加信息),则新记录将添加到History
表中,这条新记录就是前面提到的外键所引用的。
在列上的数据绑定期间,我将最近的历史状态与前一个历史状态进行比较,并返回已更改内容的英文描述(例如“此设备的附加信息字段已被修改”),以便可以显示它作为每行中的文本。
问题
网格本身似乎只过滤客户端上作为原始数据绑定一部分的数据(在本例中,只是历史记录的外键 ID)。 我可以按此数字进行过滤,但它实际上并未显示在列视图中,因为它已被英文描述替换。
网格标记
<cc1:Grid ID="grdHistory" runat="server" AutoGenerateColumns="False" DataSourceID="dsHistory" AllowFiltering="true">
<Columns>
<!-- other columns snipped -->
<cc1:Column DataField="DeviceHistoryID" HeaderText="Event description" Width="450" Wrap="true"
Index="3">
<TemplateSettings TemplateId="tplEventDescription" />
</cc1:Column>
</Columns>
<Templates>
<cc1:GridTemplate ID="tplEventDescription" runat="server">
<Template>
<%# FormatEventDescription(Container.DataItem) %>
</Template>
</cc1:GridTemplate>
</Templates>
</cc1:Grid>
FormatEventDescription(Hashtable Records)
是返回我希望过滤的对象状态更改的英文版本的函数。
问题
有没有办法根据栏目中的英文描述进行过滤? 在这一点上,任何见解(设计缺陷等)都是受欢迎的。 我已经尝试过筛选他们的所有文档,甚至尝试就这个问题联系他们的支持人员,但尚未收到回复。
I am attempting to filter a column in an Obout Grid that has been bound to a template.
Background
The DataField
of the column is simply a foreign key ID to a History
table that contains what are essentially states of a certain object (such as Name, Asset Tag, Serial Number, Additional Info., etc.) If a user were to change a certain state of the object (e.g. Additional Info), a new record would be added to the History
table, and this new record is what is referenced by the aforementioned foreign key.
During databinding on the column, I am comparing the most recent history state with the one immediately prior, and returning an English description of what has changed (e.g. "The additional info field of this device has been modified") so that it can be displayed as text in each row.
The Problem
The grid itself seems to only filter the data on the client-side that was part of the original databind (in this case, simply the foreign key ID to the history record). I am able to filter by this number, though it does not actually show up in the column view because it has been replaced by the English description.
Grid Markup
<cc1:Grid ID="grdHistory" runat="server" AutoGenerateColumns="False" DataSourceID="dsHistory" AllowFiltering="true">
<Columns>
<!-- other columns snipped -->
<cc1:Column DataField="DeviceHistoryID" HeaderText="Event description" Width="450" Wrap="true"
Index="3">
<TemplateSettings TemplateId="tplEventDescription" />
</cc1:Column>
</Columns>
<Templates>
<cc1:GridTemplate ID="tplEventDescription" runat="server">
<Template>
<%# FormatEventDescription(Container.DataItem) %>
</Template>
</cc1:GridTemplate>
</Templates>
</cc1:Grid>
FormatEventDescription(Hashtable Records)
is the function that returns the English version of the changes to the object's state that I wish to filter on.
Question
Is there a way to filter by the English description in the column? At this point, any insight (design flaws, etc.) is welcome. I have tried both sifting through all of their documentation and even attempted to contact their support regarding this issue but have yet to receive a response.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 Obout 的第 3 方控件了解不多,但似乎是 .net GridView 控件的子类。 因此,您可能会再次问这个问题,但在 Obout 一词所在的位置使用 gridview,因为显然没有多少人使用该特定控件。
在简单扫描了网格的事件之后,我想您可以尝试使用 RowDataBound 事件来进行必要的转换。
您还可以使用
datasource
的Selected
事件来转换数据。如果您能够更早地将数据转换为其最终可读状态,您也许能够在发生的事件链中更早地对其进行过滤。
I don't know much about the Obout's 3rd Party control, but appears to be subclassed from the .net GridView control. So you might ask the question again, but instead use gridview where the word Obout is, because apparently not many people use that particular control.
After briefly scanning the events of the grid, I think you might try using the
RowDataBound
event to do the necessary transforms.Also you might be able to use the
Selected
event of thedatasource
to transform the data.If you are able to transform the data to it's final readable state earlier, you may be able to filter it earlier in the chain of events that occur.