FineUI 官方论坛
标题: Grid问题求教 [打印本页]
作者: wntdsou 时间: 2014-2-28 08:35
标题: Grid问题求教
前台:
<f:Grid ID="Grid1" ShowHeader="false" EnableFrame="true" EnableCollapse="true" Width="800px"
ShowBorder="true" runat="server" EnableCheckBoxSelect="True" DataKeyNames="Id"
PageSize="10" AllowPaging="true" IsDatabasePaging="true" OnPageIndexChange="Grid1_PageIndexChange"
OnRowCommand="Grid1_RowCommand" OnRowDataBound="Grid1_RowDataBound">
<Columns>
<f:RowNumberField EnablePagingNumber="true" Width="80px" HeaderText="序号" />
<f:RenderField Width="300px" DataField="Name" HeaderText="名称">
</f:RenderField>
<f:TemplateField ID="tfLocked">
<ItemTemplate>
<f
inkButtonField ColumnID="lockedField" TextAlign="Center" HeaderText="锁定状态" Icon="Lock" ToolTip="锁定" CommandName="LockStatus" />
</ItemTemplate>
</f:TemplateField>
<f
inkButtonField ColumnID="editField" TextAlign="Center" Icon="
encil" ToolTip="编辑"
CommandName="Edit" Width="50px" HeaderText="编辑" />
<f
inkButtonField ColumnID="deleteField" TextAlign="Center" Icon="
encilDelete"
ToolTip="删除" ConfirmText="确认要删除?" ConfirmTarget="Top" CommandName="Delete"
Width="50px" HeaderText="删除" />
</Columns>
</f:Grid>
后台:
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
//根据ID查找LinkButtonField一直为空
FineUI.LinkButtonField lbf= row.FindControl("lockedField") as FineUI.LinkButtonField;
}
求教后台怎么用代码来改变前台LinkButtonField的相关属性,比如图标、ToolTip和CommandName
作者: asdfsdgd 时间: 2014-2-28 11:57
- FineUI.LinkButtonField lbf= Grid1.FindControl("lockedField") as FineUI.LinkButtonField;
复制代码
应该是Grid1.FindControl。不是row.FindControl。
作者: wntdsou 时间: 2014-3-8 11:58
谢谢,而且放在RowDataBound事件中也错了,应该放在PreRowDataBound里面
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/) |
Powered by Discuz! X3.4 |