本文整理汇总了C#中System.Windows.Controls.DataGridRow.GetIndex方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridRow.GetIndex方法的具体用法?C# DataGridRow.GetIndex怎么用?C# DataGridRow.GetIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.DataGridRow
的用法示例。
在下文中一共展示了DataGridRow.GetIndex方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetIndexpasien
private string GetIndexpasien(DataGridRow row)
{
DataRowView v = (DataRowView)dgTerapi.Items[row.GetIndex()];
return (string)v[0].ToString();
}
示例2: _buildRowHeader
private void _buildRowHeader(DataGridRow row) {
if (this._owner != null) {
if ((this.HeadersVisibility & DataGridHeadersVisibility.Row) == DataGridHeadersVisibility.Row) {
var rowIndex = row.GetIndex();
Int64 startRow = 0;
if (this._owner.PageSize > 0)
startRow = (this._owner.PageCurrent - 1) * this._owner.PageSize;
var maxRownum = "" + (startRow + ((this._owner.PageSize > 0) ? this._owner.PageSize : this._owner.DS.Count()));
var maxRownumLen = maxRownum.Length;
var numFmt = new String('0', maxRownumLen);
// ReSharper disable FormatStringProblem
var rnum = String.Format("{0:" + numFmt + "} ", startRow + rowIndex + 1);
// ReSharper restore FormatStringProblem
if (!this._owner.SuppressMultiselection && this._owner.Multiselection) {
var v_hpan = new StackPanel();
v_hpan.HorizontalAlignment = HorizontalAlignment.Right;
v_hpan.Orientation = Orientation.Horizontal;
v_hpan.FlowDirection = FlowDirection.LeftToRight;
var v_htxt = new TextBlock();
v_htxt.Text = rnum;
v_hpan.Children.Add(v_htxt);
var rowData = (CRTObject)row.DataContext;
var v_hcbx = new CheckBox();
var v_is_selected = this._owner.Selection.CheckSelected(rowData);
if (this._owner.Selection.Inversion)
v_hcbx.IsChecked = !v_is_selected;
else
v_hcbx.IsChecked = v_is_selected;
v_hpan.Children.Add(v_hcbx);
v_hcbx.Checked += (s1, e1) => this._doOnRowCheckedChanged(rowData, true);
v_hcbx.Unchecked += (s1, e1) => this._doOnRowCheckedChanged(rowData, false);
rowData.ExtObject = v_hcbx;
row.Header = v_hpan;
} else
row.Header = rnum;
//}
}
}
}
示例3: GetIndexObat
private string GetIndexObat(DataGridRow row)
{
DataRowView v = (DataRowView)dgObat.Items[row.GetIndex()];
return (string)v[0].ToString();
}
示例4: UpdateRow
/// <summary>
/// Updates the specified row.
/// </summary>
/// <param name="row">DataGridRow</param>
private void UpdateRow(DataGridRow row)
{
BugTraceObject loadingItem = (BugTraceObject)row.DataContext;
BugTraceObject selectedItem = null;
string selectedHeader = null;
if (this.BugTraceView.CurrentCell != null &&
this.BugTraceView.CurrentCell.Item is BugTraceObject)
{
selectedItem = (BugTraceObject)this.BugTraceView.CurrentCell.Item;
selectedHeader = (string)this.BugTraceView.CurrentCell.Column.Header;
}
if (this.SearchTextBox.Text.Length > 0 &&
this.SearchQueryCache.ContainsKey(this.SearchTextBox.Text))
{
int rowId = row.GetIndex();
if (this.SearchQueryCache[this.SearchTextBox.Text].Contains(rowId))
{
this.RestoreRow(row);
}
else
{
this.FadeRow(row);
}
}
else if (selectedItem != null && selectedHeader != null &&
((selectedHeader.Equals("Type") &&
!loadingItem.Type.Equals(selectedItem.Type)) ||
(selectedHeader.Equals("Machine") &&
!loadingItem.Machine.Equals(selectedItem.Machine)) ||
(selectedHeader.Equals("State") &&
!loadingItem.MachineState.Equals(selectedItem.MachineState)) ||
(selectedHeader.Equals("Action") &&
!loadingItem.Action.Equals(selectedItem.Action)) ||
(selectedHeader.Equals("Target Machine") &&
!loadingItem.TargetMachine.Equals(selectedItem.TargetMachine))))
{
if (this.IsTraceViewCollapsed)
{
this.CollapseRow(row);
}
else
{
this.FadeRow(row);
}
}
else
{
this.RestoreRow(row);
}
}
示例5: _buildRowHeader
private void _buildRowHeader(DataGridRow row) {
if (this._owner != null) {
if ((this.HeadersVisibility & DataGridHeadersVisibility.Row) == DataGridHeadersVisibility.Row) {
//if (row.Header == null) {
Int32 v_row_index = row.GetIndex();
Int64 v_start_row = 0;
if (this._owner._jsClient.pageSize > 0)
v_start_row = (this._owner._jsClient.pageCurrent - 1) * this._owner._jsClient.pageSize;
String v_max_rownum = "" + (v_start_row + ((this._owner._jsClient.pageSize > 0) ? this._owner._jsClient.pageSize : this._owner._jsClient.DS.Count()));
var v_max_rownum_len = v_max_rownum.Length;
String v_num_fmt = new String('0', v_max_rownum_len);
String v_rnum = String.Format("{0:" + v_num_fmt + "} ", v_start_row + v_row_index + 1);
if (this._owner._jsClient.jsMetadata.multiselection) {
var v_hpan = new StackPanel();
v_hpan.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
v_hpan.Orientation = Orientation.Horizontal;
v_hpan.FlowDirection = System.Windows.FlowDirection.LeftToRight;
var v_htxt = new TextBlock();
v_htxt.Text = v_rnum;
v_hpan.Children.Add(v_htxt);
var v_row_data = row.DataContext as CRTObject;
var v_hcbx = new CheckBox();
var v_is_selected = this._owner._multiselection.CheckSelected(v_row_data);
if (this._owner._multiselection.Inversion)
v_hcbx.IsChecked = !v_is_selected;
else
v_hcbx.IsChecked = v_is_selected;
v_hpan.Children.Add(v_hcbx);
v_hcbx.Checked += new RoutedEventHandler((s1, e1) => {
this._doOnRowCheckedChanged(v_row_data, true);
});
v_hcbx.Unchecked += new RoutedEventHandler((s1, e1) => {
this._doOnRowCheckedChanged(v_row_data, false);
});
v_row_data.ExtObject = v_hcbx;
row.Header = v_hpan;
} else
row.Header = v_rnum;
//}
}
}
}
示例6: GetIndexKaryawan
//@Bahar : Ambil ID Karyawan dari DataGrid yang diselect
private string GetIndexKaryawan(DataGridRow row)
{
DataRowView v = (DataRowView)dgUsers.Items[row.GetIndex()];
return (string)v[0].ToString();
}