本文整理汇总了C#中DevExpress.SetRowCellValue方法的典型用法代码示例。如果您正苦于以下问题:C# DevExpress.SetRowCellValue方法的具体用法?C# DevExpress.SetRowCellValue怎么用?C# DevExpress.SetRowCellValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevExpress
的用法示例。
在下文中一共展示了DevExpress.SetRowCellValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GridViewCheck
public void GridViewCheck(DevExpress.XtraGrid.Views.Grid.GridView gridView, string p, int id)
{
if (p == "user")
{
List<Users> listRelated = new List<Users>();
listRelated = WcfServiceLocator.Create<IUsersManage>().FindRelatedUsersForUserGroup(id); //找出和指定用户组关联的用户
for (int i = 0; i < gridView.RowCount; i++)
{
var check = listRelated.Exists(delegate(Users user)
{
if (user.id == (int)gridView.GetRowCellValue(i, "id")) return true;
return false;
});
gridView.SetRowCellValue(i, "isChecked", check);
}
}
if (p == "role")
{
List<Users> listRelated = new List<Users>();
listRelated = WcfServiceLocator.Create<IRoleManage>().findRelatedUser(id); //找出和指定角色关联的用户
for (int i = 0; i < gridView.RowCount; i++)
{
var check = listRelated.Exists(delegate(Users user)
{
if (user.id == (int)gridView.GetRowCellValue(i, "id")) return true;
return false;
});
gridView.SetRowCellValue(i, "isChecked", check);
}
}
if (p == "rolewithgroup")
{
List<Group> listRelated = new List<Group>();
listRelated = WcfServiceLocator.Create<IRoleManage>().findRelatedGroup(id); //找出和指定角色关联的用户
for (int i = 0; i < gridView.RowCount; i++)
{
var check = listRelated.Exists(delegate(Group group)
{
if (group.Id == (int)gridView.GetRowCellValue(i, "Id")) return true;
return false;
});
gridView.SetRowCellValue(i, "isChecked", check);
}
}
}
示例2: addChildRow
public static void addChildRow(DevExpress.XtraGrid.Views.Grid.GridView view, int indexRow)
{
int newRowHandle = view.FocusedRowHandle;
object newRow = view.GetRow(newRowHandle);
if (view.GroupedColumns.Count > 0)
{
for (int i = 0; i < view.GroupedColumns.Count; i++)
{
view.SetRowCellValue(newRowHandle, view.GroupedColumns[i], indexRow);
}
}
}
示例3: ClickGridCheckBox
private GridView _view; //表格对象
#endregion Fields
#region Methods
/// <summary>
/// 单击表格空间列头按钮
/// </summary>
/// <param name="gridView"></param>
/// <param name="fieldName"></param>
/// <param name="currentStatus"></param>
/// <returns></returns>
public bool ClickGridCheckBox(DevExpress.XtraGrid.Views.Grid.GridView gridView, bool currentStatus)
{
bool result = false;
if (gridView != null)
{
gridView.ClearSorting();//禁止排序
gridView.PostEditor();
DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo info;
Point pt = gridView.GridControl.PointToClient(Control.MousePosition);
info = gridView.CalcHitInfo(pt);
if (info.InColumn && info.Column != null && info.Column.FieldName == _column.FieldName)
{
for (int i = 0; i < gridView.RowCount; i++)
{
gridView.SetRowCellValue(i, _column, !currentStatus);
}
return true;
}
}
return result;
}