FineUI给表格行内链接设置弹出窗体

FineUI的表格链接可以设置相应的弹出窗体,这样我们可以借此实现对表格行相关的信息查询、编辑等功能。

前台代码:

<f:Grid ID="Grid1" Width="800px" DataKeyNames="Id,Name" runat="server" Title="表格">
    <Columns>
        <f:BoundField DataField="Name" HeaderText="姓名" />
        <f:TemplateField HeaderText="性别">
            <ItemTemplate>
                <%# GetGender(Eval("Gender")) %>
            </ItemTemplate>
        </f:TemplateField>
        <f:TemplateField HeaderText="操作">
            <ItemTemplate>
                <a href="javascript:<%# GetEditUrl(Eval("ID")) %>">编辑</a>
            </ItemTemplate>
        </f:TemplateField>
    </Columns>
</f:Grid>
<f:Window ID="Window1" Title="用户信息" Hidden="true" EnableIFrame="true" runat="server"
    CloseAction="HidePostBack"
    EnableMaximize="true" EnableResize="true" OnClose="Window1_Close" Target="Top"
    IsModal="False" Width="850px" Height="450px">
</f:Window>

后台代码:

#region BindGrid

private void BindGrid()
{
    DataTable table = DataSourceUtil.GetDataTable();

    Grid1.DataSource = table;
    Grid1.DataBind();
}

#endregion

protected string GetEditUrl(object id)
{
    return Window1.GetShowReference("UserInfo.aspx?id=" + id, "编辑信息");
}

protected void Window1_Close(object sender, EventArgs e)
{
    BindGrid();
}

 

posted @ 2017-06-04 12:14  Arlar  阅读(705)  评论(0编辑  收藏  举报