本人菜鸟。在用户控件加了gridview,源码已写好了,为什么编辑里什么也没有?求大神帮忙!

解决方案 »

  1.   


    <%@ Control Language="C#" CodeFile="EmpNumberNew.ascx.cs"  Inherits ="Zznode.OA.Webs.MR.EmpNumberNew"%>
    <link href="../lynn.css" type="text/css" rel="stylesheet"/><asp:GridView ID="GridView2" Runat="server" Width="100%" DataSourceID="odsBranchStaticNew"
    AutoGenerateColumns="False" CssClass="table" OnRowDataBound="GridView2_RowDataBound" ShowFooter="True" OnInit="GridView2_Init" OnLoad="GridView2_Load" AllowPaging="False">
        <HeaderStyle CssClass="Table_header" Font-Size=12px></HeaderStyle>
        <Columns>
            <asp:BoundField HeaderText="职能" DataField="FunName">
                <ItemStyle Width="8%" HorizontalAlign=Center></ItemStyle>
            </asp:BoundField>
            <asp:BoundField HeaderText="总人数" HtmlEncode="False" DataField="Number">
                <ItemStyle Width="8%" HorizontalAlign=Center></ItemStyle>
            </asp:BoundField>
                    <asp:BoundField HeaderText="比例" HtmlEncode="False" DataField="bili">
                <ItemStyle Width="8%" HorizontalAlign=Center></ItemStyle>
            </asp:BoundField>
            <asp:BoundField HeaderText="部门(结构)" DataField="Dep_JG">
                <ItemStyle Width="10%" HorizontalAlign=Center></ItemStyle>
            </asp:BoundField>
            <asp:BoundField HeaderText="人数" HtmlEncode="False" DataField="number2">
                <ItemStyle Width="5%" HorizontalAlign=Center></ItemStyle>
            </asp:BoundField>
                    <asp:BoundField HeaderText="编制" HtmlEncode="False" DataField="allownumber" Visible="False">
                <ItemStyle Width="5%" HorizontalAlign=Center></ItemStyle>
            </asp:BoundField>
            <asp:BoundField HeaderText="部门人员(行政)" DataField="Dep_JG"></asp:BoundField>
            </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="odsBranchStaticNew" Runat="server" TypeName="Zznode.OA.DA.MrBaseInf"
    SelectMethod="GetStaffNumberStaticNew">
    </asp:ObjectDataSource>
      

  2.   

    你新建一个aspx页面把你这段代码放进去
    测试下,正如楼上所说的,