override datagrid 的edit() 要怎么获得选定网格的值? protected override void Edit(CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible )
{
base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible); string address = instantText; //???一直取不到值
///?? string address=textbox.text.tostring(); 取道空值???
MessageBox.Show(address);
string exetion = Path.GetExtension(address);
System.Diagnostics.Process proc = new System.Diagnostics.Process();
if (exetion==".doc")
{
proc.StartInfo.FileName =@"winword.exe";
proc.StartInfo.Arguments = address;
try
{
proc.Start();
proc.WaitForExit();
}
catch (System.Exception exp)
{
string err = exp.Message;
}
}
if (exetion==".pdf")
{
proc.StartInfo.FileName = @"AcroRd.exe";
proc.StartInfo.Arguments = address;
try
{
proc.Start();
proc.WaitForExit();
}
catch (System.Exception exp)
{
string err = exp.Message;
}
}
}
{
base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible); string address = instantText; //???一直取不到值
///?? string address=textbox.text.tostring(); 取道空值???
MessageBox.Show(address);
string exetion = Path.GetExtension(address);
System.Diagnostics.Process proc = new System.Diagnostics.Process();
if (exetion==".doc")
{
proc.StartInfo.FileName =@"winword.exe";
proc.StartInfo.Arguments = address;
try
{
proc.Start();
proc.WaitForExit();
}
catch (System.Exception exp)
{
string err = exp.Message;
}
}
if (exetion==".pdf")
{
proc.StartInfo.FileName = @"AcroRd.exe";
proc.StartInfo.Arguments = address;
try
{
proc.Start();
proc.WaitForExit();
}
catch (System.Exception exp)
{
string err = exp.Message;
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货