• DataWindow.NET 控件 实现点击列头排序


    1.定义字段        
                    Boolean ib_SetSort = true;
                    string is_SortType = "D";
          2.
                 /// <summary>dw排序
            ///
            /// </summary>
            /// <param name="sortDW">要排序的dw</param>
            private void DWSetSort(Sybase.DataWindow.DataWindowControl sortDW) //数据窗口排序
            {
                try
                {               
                    string is_OrderCol = "";
                    if (this.ib_SetSort == true)
                    {
                        string ls_CurObj = "";// ls_CurCol = "";
                        int li_LinePos = 0;
                        int ll_CurRowNumber = 0;
                        ls_CurObj = sortDW.ObjectUnderMouse.Gob.Name; //得出objectName
                        ll_CurRowNumber = sortDW.ObjectUnderMouse.RowNumber; //得出当前Row

                        //li_LinePos = Convert.ToInt32(sortDW.Describe(ls_CurObj + ".X")) + (Convert.ToInt32(sortDW.Describe(ls_CurObj + ".Width")) - 20);
                        if (sortDW.Describe(ls_CurObj + ".Band") == "header")
                        {
                            if (ll_CurRowNumber == 0 & sortDW.Describe(ls_CurObj + ".Text") != "!")
                            {
                                is_OrderCol = ls_CurObj.Substring(0, ls_CurObj.Length - 2);

                                if (is_SortType == "A")
                                {
                                    li_LinePos -= 20;
                                    //DataWindowSort(sortDW, li_LinePos, is_OrderCol, is_SortType);
                                    sortDW.SetSort(is_OrderCol + " " + is_SortType);
                                    sortDW.Sort();
                                    is_SortType = "D";
                                }
                                else
                                {
                                    //DataWindowSort(sortDW, li_LinePos, is_OrderCol, is_SortType);
                                    sortDW.SetSort(is_OrderCol + " " + is_SortType);
                                    sortDW.Sort();
                                    is_SortType = "A";
                                }
                            }

                        }

                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message,"排序错误!");
                }           
            }

            3.
                 private void dw_2_Click(object sender, EventArgs e)
                {
                     DWSetSort(dw_2);
                 }

  • 相关阅读:
    精确率、召回率、F1 值、ROC、AUC 各自的优缺点是什么?
    使用sklearn做单机特征工程
    机器学习算法比较
    CNN-卷积层和池化层学习
    卷积神经网络概念与原理
    CNN(卷积神经网络)、RNN(循环神经网络)、DNN(深度神经网络)概念区分理解
    技能|三次简化一张图:一招理解LSTM/GRU门控机制
    【转】TensorFlow四种Cross Entropy算法实现和应用
    http://blog.csdn.net/u014595019/article/details/52805444
    神经网络和深度学习简史(三)
  • 原文地址:https://www.cnblogs.com/Veky/p/3254104.html
Copyright © 2020-2023  润新知