SVN r1181
SVN-Revision: r1181
This commit is contained in:
@@ -2128,10 +2128,19 @@ namespace Lskj.Control
|
||||
gridControl.GridView.DoubleClick -= new EventHandler(OnGridCompleted);
|
||||
if (gridControl is TreeGridControlEx)
|
||||
{
|
||||
TreeGridControlEx treeGridControlEx = gridControl as TreeGridControlEx;
|
||||
treeGridControlEx.SetGridViewDataSource(table, false);
|
||||
dataRowCount = (treeGridControlEx.TreeListObj.DataSource as DataTable).Rows.Count;
|
||||
//treeGridControlEx.TreeListObj.ExpandAll();
|
||||
|
||||
if (gridControl is TreeBandedGridControlEx)
|
||||
{
|
||||
TreeBandedGridControlEx treeGridControlEx = gridControl as TreeBandedGridControlEx;
|
||||
treeGridControlEx.SetGridViewDataSource(table, false);
|
||||
dataRowCount = (treeGridControlEx.TreeListObj.DataSource as DataTable).Rows.Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeGridControlEx treeGridControlEx = gridControl as TreeGridControlEx;
|
||||
treeGridControlEx.SetGridViewDataSource(table, false);
|
||||
dataRowCount = (treeGridControlEx.TreeListObj.DataSource as DataTable).Rows.Count;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Lskj.Control
|
||||
/// 获取模块配置
|
||||
/// </summary>
|
||||
public ModuleModel moduleModel;
|
||||
public TreeList TreeListObj { get { return gcMain; } }
|
||||
public TreeList TreeListObj { get { return gcMain; } }
|
||||
|
||||
/// <summary>
|
||||
/// 树表格固定菜单
|
||||
@@ -81,6 +81,10 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
private List<string> DateColumnNames = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 上次选中行
|
||||
/// </summary>
|
||||
private int lastNodeIndex;
|
||||
|
||||
public TreeBandedGridControlEx()
|
||||
{
|
||||
@@ -96,11 +100,47 @@ namespace Lskj.Control
|
||||
this.SetGridRowHeightAndFont();
|
||||
}
|
||||
this.gcMain.PopupMenuShowing += new PopupMenuShowingEventHandler(OnPopupMenuShowing);
|
||||
|
||||
this.gcMain.NodesReloaded += OnNodesReloaded;
|
||||
//InitializeTreeMethod();
|
||||
//this.gcMain.OptionsBehavior.EnableFiltering = true;
|
||||
//this.gcMain.OptionsFind.AlwaysVisible = true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 节点加载完成后
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnNodesReloaded(object sender, EventArgs e)
|
||||
{
|
||||
//根据记录展开对应节点
|
||||
foreach (TreeListNode treeListNode in treeListNodes)
|
||||
{
|
||||
TreeListNode treeListNode1 = this.gcMain.Nodes.TreeList.FindNodeByID(treeListNode.Id);
|
||||
if (treeListNode1 != null) treeListNode1.Expanded = true;
|
||||
}
|
||||
this.TreeListObj.FocusedNode = this.TreeListObj.GetNodeByVisibleIndex(lastNodeIndex);
|
||||
if ((Expansion + "").Equals("1"))
|
||||
{
|
||||
this.gcMain.ExpandAll();
|
||||
}
|
||||
else if ((Expansion + "").Equals("2"))
|
||||
{
|
||||
this.gcMain.ExpandToLevel(0);
|
||||
}
|
||||
else if ((Expansion + "").Equals("3"))
|
||||
{
|
||||
this.gcMain.CollapseAll();
|
||||
}
|
||||
|
||||
//if (selectRowHandler)
|
||||
//{
|
||||
// this.TreeListObj.FocusedNode = this.TreeListObj.GetNodeByVisibleIndex(lastNodeIndex);
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改筛选框筛选日期类型列的条件(日期=xxx 替换wei 日期>=xxx && 日期<xxx+1)
|
||||
/// </summary>
|
||||
@@ -2041,6 +2081,10 @@ namespace Lskj.Control
|
||||
this.gcMain.Columns.Clear();
|
||||
}
|
||||
TreeListNode lastNode = this.TreeListObj.FocusedNode;
|
||||
|
||||
lastNodeIndex = 0;
|
||||
if (selectRowHandler) lastNodeIndex = this.TreeListObj.GetVisibleIndexByNode(this.TreeListObj.FocusedNode);
|
||||
|
||||
GetTreeExpanded();
|
||||
this.gcMain.DataSource = table;
|
||||
this.SetAutoColumns();
|
||||
@@ -2064,6 +2108,10 @@ namespace Lskj.Control
|
||||
this.gcMain.Columns.Clear();
|
||||
}
|
||||
TreeListNode lastNode = this.TreeListObj.FocusedNode;
|
||||
|
||||
lastNodeIndex = 0;
|
||||
if (selectRowHandler) lastNodeIndex = this.TreeListObj.GetVisibleIndexByNode(this.TreeListObj.FocusedNode);
|
||||
|
||||
this.AdapterObj = adapter;
|
||||
DataSet dataSet = new DataSet();
|
||||
//adapter.Fill(dataSet, "SetGridViewDataSource");
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
public partial class TreeGridControlEx : GridControlEx
|
||||
{
|
||||
public TreeList TreeListObj { get { return gcMain; } }
|
||||
public TreeList TreeListObj { get { return gcMain; } }
|
||||
|
||||
/// <summary>
|
||||
/// 树表格固定菜单
|
||||
@@ -72,7 +72,7 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// 上次选中行
|
||||
/// </summary>
|
||||
private int lastNodeIndex;
|
||||
private int lastNodeIndex;
|
||||
|
||||
/// <summary>
|
||||
/// 日期类型控件名称
|
||||
@@ -2501,11 +2501,11 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DbCommandBuilder cb = SqlHelper.dbFactory.CreateCommandBuilder();
|
||||
cb.DataAdapter = this.AdapterObj;
|
||||
//SqlCommandBuilder cb = new SqlCommandBuilder(this.AdapterObj);
|
||||
|
||||
|
||||
GetTreeExpanded();
|
||||
|
||||
this.gcMain.DataSource = dataSet.Tables[0];
|
||||
@@ -3875,7 +3875,7 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void TreeListObj_CustomDrawNodeIndicator(object sender, CustomDrawNodeIndicatorEventArgs e)
|
||||
private void TreeListObj_CustomDrawNodeIndicator(object sender, CustomDrawNodeIndicatorEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user