DataGridView LinkBut​​ton打开PathURL [英] DataGridView LinkButton open PathURL

查看:86
本文介绍了DataGridView LinkBut​​ton打开PathURL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在datagridview中有三列.

Hi,

In datagridview have three columns.

======================================================
ImageType|| imageurl(linkButton)|| delete(button)||
======================================================
Face ||d:\Temp\Face.jpg || delete||
FullImage ||d:\Temp\FullImage .jpg || delete||
======================================================


// 
// ImageType // 

this.ImageType.HeaderText = "ImageType";
 this.ImageType.Name = "ImageType"; 
// 

// Attachment //

this.Attachment.HeaderText = "Attachment"; 
this.Attachment.Name = "Attachment"; 
this.Attachment.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.Attachment.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; 
this.Attachment.Width = 130; 
// 

// DeleteImg // 

this.DeleteImg.FillWeight = 50F; 
this.DeleteImg.HeaderText = "Delete"; this.DeleteImg.Name = "DeleteImg"; 
this.DeleteImg.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.DeleteImg.Width = 50; 

// code : 
if (File.Exists(imagePath)) { string result = Path.GetFileNameWithoutExtension(imagePath); string[] row = new string[] { result, imagePath }; dataGridViewAttachment.Rows.Add(row); }



如何编写代码以打开此pathUrl(d:\ Temp \ Face.jpg)的图像.
Karthikeyan,



how to write code to open image this pathUrl(d:\Temp\Face.jpg ).
Karthikeyan,

推荐答案

在gridviewrow命令上获取唯一ID并执行response.redirect("http://.../face.jpg",false)
on the gridviewrowcommand get the unique id and do response.redirect("http://.../face.jpg", false)


这篇关于DataGridView LinkBut​​ton打开PathURL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆