繁体   English   中英

GridView列调整大小问题与updatepanel

[英]Gridview Column Resize issue with updatepanel

我想为asp.net gridview自动调整列功能的大小。 我正在使用colResizable-1.3.min.js进行列大小调整功能及其正常工作。 但是,当我尝试使用更新面板添加gridview时,jQuery无法正常工作。 它只是在回发请求上工作。

谢谢

   <script>
   //On Page Load
        $(function () {
             $('#<%=gvInv_ReceiveVoucherItem.ClientID %>').colResizable({
                liveDrag: true,
                gripInnerHtml: "<div class='grip'></div>",
                draggingClass: "dragging",
                postbackSafe: true,
                partialRefresh: true              
        });
        });

    //On UpdatePanel Refresh
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm != null) {
        prm.add_endRequest(function (sender, e) {
            if (sender._postBackSettings.panelsToUpdate != null) {
                $('#<%=gvInv_ReceiveVoucherItem.ClientID %>').colResizable({
                    liveDrag: true,
                    gripInnerHtml: "<div class='grip'></div>",
                    draggingClass: "dragging",
                    postbackSafe: true,
                    partialRefresh: true
                });
            }
        });
    };
</script>    

      </Columns>                             
                        </asp:GridView>
                    </asp:Panel>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM