Skip to content

Commit

Permalink
Merge pull request kwwwvagaa#4 from kwwwvagaa/master
Browse files Browse the repository at this point in the history
同步
  • Loading branch information
LeoYoungHub committed Nov 8, 2019
2 parents 1b7ef39 + 8b7440e commit b60631b
Show file tree
Hide file tree
Showing 47 changed files with 2,146 additions and 1,195 deletions.
1 change: 1 addition & 0 deletions HZH_Controls/HZH_Controls/Controls/Checkbox/UCCheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public override Font Font
get { return _ForeColor; }
set
{
base.ForeColor = value;
label1.ForeColor = value;
_ForeColor = value;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions HZH_Controls/HZH_Controls/Controls/ComboBox/UCComboxGridPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,20 @@ public List<object> DataSource
/// The string last search text
/// </summary>
private string strLastSearchText = string.Empty;
/// <summary>
/// The m page
/// </summary>
UCPagerControl m_page = new UCPagerControl();


/// <summary>
/// Initializes a new instance of the <see cref="UCComboxGridPanel" /> class.
/// </summary>
public UCComboxGridPanel()
{
InitializeComponent();
this.ucDataGridView1.Page = m_page;
this.ucDataGridView1.IsCloseAutoHeight = false;
this.txtSearch.txtInput.TextChanged += txtInput_TextChanged;
this.ucDataGridView1.ItemClick += ucDataGridView1_ItemClick;
m_page.ShowSourceChanged += m_page_ShowSourceChanged;
}



/// <summary>
/// Handles the ItemClick event of the ucDataGridView1 control.
/// </summary>
Expand Down Expand Up @@ -172,7 +169,7 @@ private void Search(string strText)
m_page.StartIndex = 0;
if (!string.IsNullOrEmpty(strText))
{
strText = strText.ToLower();
strText = strText.ToLower().Trim();
List<object> lst = m_dataSource.FindAll(p => m_columns.Any(c => (c.Format == null ? (p.GetType().GetProperty(c.DataField).GetValue(p, null).ToStringExt()) : c.Format(p.GetType().GetProperty(c.DataField).GetValue(p, null))).ToLower().Contains(strText)));
m_page.DataSource = lst;
}
Expand All @@ -182,5 +179,10 @@ private void Search(string strText)
}
m_page.Reload();
}

void m_page_ShowSourceChanged(object currentSource)
{
this.ucDataGridView1.DataSource = currentSource;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,23 @@ public class DataGridViewColumnEntity
/// </summary>
/// <value>The text align.</value>
public ContentAlignment TextAlign { get { return _TextAlign; } set { _TextAlign = value; } }
/// <summary>
/// 自定义的单元格控件,一个实现IDataGridViewCustomCell的Control
/// </summary>
/// <value>The custom cell.</value>
private Type customCellType = null;
public Type CustomCellType
{
get
{
return customCellType;
}
set
{
if (!typeof(IDataGridViewCustomCell).IsAssignableFrom(value) || !value.IsSubclassOf(typeof(System.Windows.Forms.Control)))
throw new Exception("行控件没有实现IDataGridViewCustomCell接口");
customCellType = value;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HZH_Controls.Controls
{
public interface IDataGridViewCustomCell
{
/// <summary>
/// 绑定行关联的数据
/// </summary>
/// <param name="obj">The object.</param>
void SetBindSource(object obj);
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b60631b

Please sign in to comment.