Connections greyed out when trying to connect two webparts for passing valuesparameter
-
Hi guys, It hasn't been too long since I have started development with Sharepoint so please forgive me in case of my ignorance :) I'm trying to basically connect two webparts with the Provider and Consumer where the provider has a SPGridView of products where I wanna click on SerialNumber field (a linkbutton) and go to the products details page where the details would come based on that serial number of course. So I want to simply pass that serial number over to the other web part. The problem is that when I that when I add these two web parts on a page and click on the arrow button to get to "Connections" menu, it is greyed out with the message: "The web part you are connecting from does not allow authoring of connections" Here is my check list of possible problems:- - The site does allow connection - Browser is IE9 which should be compatible I guess :) - NOT SURE if webpart zone disallows connections coz I don't know how to check that yet. - The webparts itself should allow the connections I think. Here's the code sections for you though: The Interface for provider/consumer
public interface IProduct
{
string _ProductSelected
{
get;} }
From Provider Web part
protected void lnkSerial_OnClick(object sender, EventArgs e)
{
if (sender != null)
{
_SelectedSerialNumber = ((LinkButton)sender).CommandArgument;} else { } } \[ConnectionProvider("Product Serial Number passing provider")\] public IProduct ProviderMethod() { return this; } public void ProvideSerialNumber() { } string IProduct.\_ProductSelected { get { return \_SelectedSerialNumber; } }
From Consumer Web Part
[ConnectionConsumer("Product As Realized Consumer")]
public void LoadProductAsRealizedDetails(IProduct providerInterface)
{
_Product = providerInterface;
ProductAsRealized product = RealizedProductMethods.GetProductAsRealized(_Product._ProductSelected);
//product}
Please tell me if you see something wrong or have any ideas for this. The trouble is that the basic example I followed for doing this works just fine on the same
-
Hi guys, It hasn't been too long since I have started development with Sharepoint so please forgive me in case of my ignorance :) I'm trying to basically connect two webparts with the Provider and Consumer where the provider has a SPGridView of products where I wanna click on SerialNumber field (a linkbutton) and go to the products details page where the details would come based on that serial number of course. So I want to simply pass that serial number over to the other web part. The problem is that when I that when I add these two web parts on a page and click on the arrow button to get to "Connections" menu, it is greyed out with the message: "The web part you are connecting from does not allow authoring of connections" Here is my check list of possible problems:- - The site does allow connection - Browser is IE9 which should be compatible I guess :) - NOT SURE if webpart zone disallows connections coz I don't know how to check that yet. - The webparts itself should allow the connections I think. Here's the code sections for you though: The Interface for provider/consumer
public interface IProduct
{
string _ProductSelected
{
get;} }
From Provider Web part
protected void lnkSerial_OnClick(object sender, EventArgs e)
{
if (sender != null)
{
_SelectedSerialNumber = ((LinkButton)sender).CommandArgument;} else { } } \[ConnectionProvider("Product Serial Number passing provider")\] public IProduct ProviderMethod() { return this; } public void ProvideSerialNumber() { } string IProduct.\_ProductSelected { get { return \_SelectedSerialNumber; } }
From Consumer Web Part
[ConnectionConsumer("Product As Realized Consumer")]
public void LoadProductAsRealizedDetails(IProduct providerInterface)
{
_Product = providerInterface;
ProductAsRealized product = RealizedProductMethods.GetProductAsRealized(_Product._ProductSelected);
//product}
Please tell me if you see something wrong or have any ideas for this. The trouble is that the basic example I followed for doing this works just fine on the same