J
Jeff
Hi all!
IDE: VS 2003 (C# standard)
OS : XP Pro
In my program I have an array of the class Details (the Details.cs code is
listed below)
In my program I got a linklabel controll (LinkLabel1) and I want to bind the
Url property of Details to the LinkLabel1 controll!
I want to bind the Url property to LinkLabel1, in such a way that the
LinkLabel1_LinkClicked event can opens a IE, based on the Url in Details.
I have tryed this technique:
LinkLabel1.DataBindings.Add("Links",allDetails, "Url");
But the program crashes with the error message "Cannot bind to property
'Links' because it is read only."
I've read in the help file about LinkLabel, from this I understand that the
Links property of LinkLabel can't hold a collection of links but the
property LinkCollection can...
Can anyone give me a tips about how to bind (if it's possible) the Url
property of the class Details to the LinkLabel controll
My program binds the other properties of Details (strProductName and
imgImage) without any problems
allDetails:
allDetails = new
Details(pi.Details.ProductName,ImageFromUrl(pi.Details.ImageUrlMedium)
,pi.Details.Url);
//The Details class
using System;
using System.Drawing;
namespace myBooks
{
/// <summary>
/// Summary description for Details.
/// </summary>
public class Details
{
private string strProductName;
private Image imgImage;
private string strUrl;
public string Url {
get{
return strUrl;
}
set {
strUrl = value;
}
}
public string ProductName
{
get {
return strProductName;
}
set {
strProductName = value;
}
}
public Image CoverImage
{
get{
return imgImage;
}
set {
imgImage = value;
}
}
public Details(string productName, Image imageUrl, string Url)
{
this.strProductName = productName;
this.imgImage = imageUrl;
this.strUrl = Url;
}
}
}
Regards!
Jeff
IDE: VS 2003 (C# standard)
OS : XP Pro
In my program I have an array of the class Details (the Details.cs code is
listed below)
In my program I got a linklabel controll (LinkLabel1) and I want to bind the
Url property of Details to the LinkLabel1 controll!
I want to bind the Url property to LinkLabel1, in such a way that the
LinkLabel1_LinkClicked event can opens a IE, based on the Url in Details.
I have tryed this technique:
LinkLabel1.DataBindings.Add("Links",allDetails, "Url");
But the program crashes with the error message "Cannot bind to property
'Links' because it is read only."
I've read in the help file about LinkLabel, from this I understand that the
Links property of LinkLabel can't hold a collection of links but the
property LinkCollection can...
Can anyone give me a tips about how to bind (if it's possible) the Url
property of the class Details to the LinkLabel controll
My program binds the other properties of Details (strProductName and
imgImage) without any problems
allDetails:
allDetails = new
Details(pi.Details.ProductName,ImageFromUrl(pi.Details.ImageUrlMedium)
,pi.Details.Url);
//The Details class
using System;
using System.Drawing;
namespace myBooks
{
/// <summary>
/// Summary description for Details.
/// </summary>
public class Details
{
private string strProductName;
private Image imgImage;
private string strUrl;
public string Url {
get{
return strUrl;
}
set {
strUrl = value;
}
}
public string ProductName
{
get {
return strProductName;
}
set {
strProductName = value;
}
}
public Image CoverImage
{
get{
return imgImage;
}
set {
imgImage = value;
}
}
public Details(string productName, Image imageUrl, string Url)
{
this.strProductName = productName;
this.imgImage = imageUrl;
this.strUrl = Url;
}
}
}
Regards!
Jeff