本文整理汇总了C#中System.Windows.Forms.DataGridViewCellValueEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewCellValueEventArgs类的具体用法?C# DataGridViewCellValueEventArgs怎么用?C# DataGridViewCellValueEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridViewCellValueEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewCellValueEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dgMyDesigner_CellValueNeeded
private void dgMyDesigner_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
for (int i = 0; i < totalRecords; i++)
{
if (e.RowIndex == i)
{
string employeeId = Convert.ToString(dgMyDesigner.Rows[e.RowIndex].Cells[0].Value);
if (e.ColumnIndex == 1)
{
e.Value = empManager.GetGroupNameByEmployeeId(employeeId);
}
if (e.ColumnIndex == 2)
{
e.Value = empManager.GetEmployeeById(employeeId).Name;
}
if (e.ColumnIndex == 3)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatus(employeeId, OrderStatus.OnChatting);
}
if (e.ColumnIndex == 4)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatus(employeeId, OrderStatus.Signed);
}
if (e.ColumnIndex == 5)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatus(employeeId, OrderStatus.NotSigned);
}
if (e.ColumnIndex == 6)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatus(employeeId, OrderStatus.Denied);
}
}
}
}
示例2: DatabaseGridView_CellValueNeeded
private void DatabaseGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
if (e.RowIndex >= 0 && e.ColumnIndex == 0)
{
e.Value = e.RowIndex + 1;
}
}
示例3: dgVisitContent_CellValueNeeded
private void dgVisitContent_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
if (e.ColumnIndex == 0)
{
e.Value = e.RowIndex + 1;//set serial number of the table rows.
}
}
示例4: dataGridView1_CellValueNeeded
private void dataGridView1_CellValueNeeded(object sender,
DataGridViewCellValueEventArgs e)
{
if (store.ContainsKey(e.RowIndex))
{
// Use the store if the e value has been modified
// and stored.
e.Value = store[e.RowIndex];
}
else if (newRowNeeded && e.RowIndex == numberOfRows)
{
if (dataGridView1.IsCurrentCellInEditMode)
{
e.Value = initialValue;
}
else
{
// Show a blank value if the cursor is just resting
// on the last row.
e.Value = String.Empty;
}
}
else
{
e.Value = e.RowIndex;
}
}
示例5: dgMySuordinate_CellValueNeeded
private void dgMySuordinate_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
for (int i = 0; i < totalRecords; i++)
{
if (e.RowIndex == i)
{
string employeeId = Convert.ToString(dgMySuordinate.Rows[e.RowIndex].Cells[0].Value);
if (e.ColumnIndex == 2)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.OnChatting);
}
if (e.ColumnIndex == 3)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.Signed);
}
if (e.ColumnIndex == 4)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.NotSigned);
}
if (e.ColumnIndex == 5)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.Denied);
}
if (e.ColumnIndex == 6)
{
e.Value = orderManager.GetLastMonthToCurrentMonthCountByOrderStatus(employeeId, OrderStatus.OnChatting);
}
}
}
}
示例6: dgUnSubordinate_CellValueNeeded
private void dgUnSubordinate_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
if (e.ColumnIndex == 0)
{
e.Value = (pageIndex - 1) * pageSize + e.RowIndex + 1;//set serial number of the table rows.
}
}
示例7: Watch_CellValueNeeded
private void Watch_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
switch (e.ColumnIndex)
{
case 0: e.Value = "Variable"; break;
case 1: e.Value = "3.14159 mV"; break;
case 2: e.Value = "0x00000000"; break;
case 3: e.Value = "100 ms"; break;
}
}
示例8: dataGridView1_CellValueNeeded
private void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
//this function will populate unbound grid row and column wise. debug it then u can understand how grid is populating.
e.Value = memoryCache.RetrieveElement(e.RowIndex, e.ColumnIndex);
//if (e.RowIndex == 14)
//{
// //here it populated all rows of the grid
// //label1.Text = "Data loading completed";
//}
}
示例9: dataGridView_CellValueNeeded
private void dataGridView_CellValueNeeded( object sender, DataGridViewCellValueEventArgs e )
{
if( pointList == null )
throw new InvalidOperationException( "cell value needed but point list is null" );
if( e.ColumnIndex == 0 )
e.Value = pointList[e.RowIndex].X;
else
e.Value = pointList[e.RowIndex].Y;
}
示例10: OnCellValueNeeded
protected override void OnCellValueNeeded(DataGridViewCellValueEventArgs e)
{
base.OnCellValueNeeded(e);
IList list = this.DataSource as IList;
int index = e.RowIndex;
if (list == null) { return; }
if (index < 0 || (index+1) > list.Count) { return; }
if (e.ColumnIndex == 0 )
{
e.Value = IsItemSelected(list[index]);
}
}
示例11: dataGrid_CellValueNeeded
// -----------------------------------------
// DataGrid Events
// read from internal ArrayList
public virtual void dataGrid_CellValueNeeded(DataGridView dg, DataGridViewCellValueEventArgs e)
{
if (e.RowIndex < dlist.Count)
{
cBaseItem d = (cBaseItem)dlist[e.RowIndex];
e.Value = d.RenderCell(e.ColumnIndex);
} else {
// if displaying new row
if (current_editrow != null)
{
cBaseItem d = current_editrow;
e.Value = d.RenderCell(e.ColumnIndex);
}
}
}
示例12: dataPaymentInfo_CellValueNeeded
private void dataPaymentInfo_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
Payment c = paymentInfo[e.RowIndex];
if (e.ColumnIndex == 2)
{
int i = 0;
for (; i < goodsInfo.Length; i++)
{
if (goodsInfo[i].Id == c.GoodsId)
{
e.Value = goodsInfo[i].Name;
break;
}
}
if (i == goodsInfo.Length) e.Value = "无";
}
}
示例13: dgvTemplates_CellValueNeeded
private void dgvTemplates_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
if (e.RowIndex >= 0 && e.RowIndex < templates.Count)
{
switch(e.ColumnIndex)
{
case 0:
e.Value = e.RowIndex;
break;
case 1:
e.Value = templates[e.RowIndex].name;
break;
case 2:
e.Value = templates[e.RowIndex].preferredAngleNoMore90;
break;
}
}
}
示例14: GetCellContentFromPoint
public CellContent GetCellContentFromPoint(int x, int y)
{
HitTestInfo hit = HitTest(x, y);
if (hit.Type == DataGridViewHitTestType.Cell)
{
DataGridViewCellValueEventArgs args = new DataGridViewCellValueEventArgs(hit.ColumnIndex, hit.RowIndex);
OnCellValueNeeded(args);
for (int i = 0; i < this.ColumnCount; ++i)
{
Rectangle r = this.GetColumnDisplayRectangle(i, false);
if (x > r.Left && x < r.Right)
{
return new CellContent(args.Value as string, r.Left);
}
}
}
return null;
}
示例15: dgIAList_CellValueNeeded
private void dgIAList_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
{
for (int i = 0; i < totalRecords; i++)
{
if (e.RowIndex == i)
{
string employeeId = Convert.ToString(dgMySuordinate.Rows[e.RowIndex].Cells[0].Value);
if (e.ColumnIndex == 1)
{
e.Value = i + 1;
}
if (e.ColumnIndex == 3)
{
e.Value = mySubordinateManager.GetVisitCount(employeeId);
}
if (e.ColumnIndex == 4)
{
e.Value = mySubordinateManager.GetInformationAssistantCount(employeeId);
}
if (e.ColumnIndex == 5)
{
e.Value = mySubordinateManager.GetCustomerCount(employeeId);
}
if (e.ColumnIndex == 6)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.OnChatting);
}
if (e.ColumnIndex == 7)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.Signed);
}
if (e.ColumnIndex == 8)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.NotSigned);
}
if (e.ColumnIndex == 9)
{
e.Value = orderManager.GetCurrentMonthCountByOrderStatusForSalesManager(employeeId, OrderStatus.Denied);
}
}
}
}