前台:
<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
|