public object GetGroupByValue(UltraGridGroupByRow groupbyRow, UltraGridRow row)
    {
        string val = "";

        // Get the default value from the groupbyRow.
        if (groupbyRow.Value == null)
        {
            val = "";
        }
        else
        {
            if (groupbyRow.Value.GetType().ToString() == "System.Drawing.Bitmap")
            {
                //val = Infragistics.Win.FormattedLinkLabel.FormattedLinkEditor.EncodeImage((Image)groupbyRow.Value);
                val = groupbyRow.ToolTipText.ToString();
            }
            else
            {
                val = groupbyRow.Value.ToString();
            }
        }

        // If it is longer than 2 characters truncate it.
        //if (val.Length > 2)
        //    val = val.Substring(0, 2);

        // Convert the string to uppercase for display in the group-by row's description.
        return(val.ToUpper());
    }
    public bool DoesGroupContainRow(UltraGridGroupByRow groupbyRow, UltraGridRow row)
    {
        // Get the related cell's value as a string.
        string cellValue = row.Cells[groupbyRow.Column].Value.ToString();

        // If it is longer than 2 characters truncate it.
        if (cellValue.Length > 2)
        {
            cellValue = cellValue.Substring(0, 2);
        }

        // Do a case insensitive compare.
        return(0 == string.Compare(groupbyRow.Value.ToString(), cellValue, true));
    }
示例#3
0
 private DataSet SelectedGroupByRows(DataSet ds, UltraGridGroupByRow group)
 {
     foreach (UltraGridRow row in group.Rows)
     {
         UltraGridGroupByRow row2 = row as UltraGridGroupByRow;
         if (row2 != null)
         {
             this.SelectedGroupByRows(ds, row2);
         }
         else if (row.Selected)
         {
             DataSetUtil.AddRelatedRows(ds, ((DataRowView)row.ListObject).Row);
         }
     }
     return(ds);
 }
示例#4
0
        public DataSet GetSelectedRows()
        {
            DataSet ds = Activator.CreateInstance <T>();

            foreach (UltraGridRow row in this.m_Grid.Rows)
            {
                UltraGridGroupByRow group = row as UltraGridGroupByRow;
                if (group != null)
                {
                    this.SelectedGroupByRows(ds, group);
                }
                else if (row.Selected && (row.ListObject != null))
                {
                    DataSetUtil.AddRelatedRows(ds, ((DataRowView)row.ListObject).Row);
                }
            }
            return(ds);
        }