如题
解决方案 »
- C# 水晶报表照片的怎么显示出来?
- 图片框在一个有背景图片的窗体上刷新的问题~!
- 由asp.net提交到asp页面,中文乱码的问题。。。
- 巨难的问题:如何控制foreach循环语句终止?
- 我有一段 JavaScript 不知道那位老大能帮我看看,
- 求助,winform 选择下级,则其上级自动填充到表,并自动汇总
- 二维码打印求救。。。100分
- 请问下怎么判断是否有数据,如有数据填充数据集,没有的话就不用填充数据集了
- C# 如何以存在的Excel模板导出所需要的表格(保持模板格式并需要添加数据库数据),数据从Access数据库导出;最好能在程序中添加打印预览功能(分可以加)
- ===C#派生类的问题===
- webrequest和axwebbrowser可以配合一起用吗
- 字符串操作!c# 大家帮我一下把 !不是很难
cb.Value = "2";
private ComboBox combo = null;
private Panel p = null;private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 1)
{
dataGridView1.BeginEdit(true);
}
} private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 1)
{
try
{ dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = combo.Text; if (p != null)
{
p.Hide();
p = null;
}
}
catch
{
}
finally
{
}
}
} private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
if (e.ColumnIndex == 1)
{
int row = e.RowIndex;
int column = e.ColumnIndex; Rectangle r = dataGridView1.GetCellDisplayRectangle(column, row, false); if (p == null)
{
p = new Panel();
p.BackColor = Color.White;
p.Parent = dataGridView1;
//combo.KeyPress += new KeyPressEventHandler(combo_KeyPress);
if (dataGridView1.Rows[row].Cells[column].Value != null)
{
combo.Text = dataGridView1.Rows[row].Cells[column].Value.ToString();
}
else
{
combo.Text = "";
}
combo.Dock = DockStyle.Top;
combo.Parent = p;
} p.Width = r.Width - 1;
p.Height = r.Height;
p.Top = r.Top;
p.Left = r.Left; p.Show();
}
} private void dataGridView1_Scroll(object sender, ScrollEventArgs e)
{
if (p != null)
{
p.Hide();
}
}