S
Steven
Hello All,
I have a program that implements two custom web parts, one as a
provider webpart and another as a consumer webpart.
The provider webpart contains a gridview control. When a row is
selected it then populates the consumer webparts textbox with
description data. The consumer webpart contains a text box for editing
the data (DescriptionContentText) and a button to update the
description received from the provider web part
(UpdateDescriptionContent). The event handle for the button click event
is connected in the consumer webparts CreateChildControl() method.
The problem is that this event is firing before the connection between
the two webparts has been created. Therefore when the event handler is
called, it checks if the provider (descriptionProvider) has been
created, always finds it set to null, and therefore never updates the
description field in the gridView (in the Web Part Provider)
Event Handler:
void UpdateDescriptionContent_Click(object sender, EventArgs e)
{
if (descriptionProvider != null)
{
descriptionProvider.Description =
DescriptionContentText.Text;
}
}
When I debug the program the methods to connect the web parts is always
called right after the button click event fires and before the
PreRender event is called. How then is it possible to cause the button
click to update the providers data?
Cheers for any help.
I have a program that implements two custom web parts, one as a
provider webpart and another as a consumer webpart.
The provider webpart contains a gridview control. When a row is
selected it then populates the consumer webparts textbox with
description data. The consumer webpart contains a text box for editing
the data (DescriptionContentText) and a button to update the
description received from the provider web part
(UpdateDescriptionContent). The event handle for the button click event
is connected in the consumer webparts CreateChildControl() method.
The problem is that this event is firing before the connection between
the two webparts has been created. Therefore when the event handler is
called, it checks if the provider (descriptionProvider) has been
created, always finds it set to null, and therefore never updates the
description field in the gridView (in the Web Part Provider)
Event Handler:
void UpdateDescriptionContent_Click(object sender, EventArgs e)
{
if (descriptionProvider != null)
{
descriptionProvider.Description =
DescriptionContentText.Text;
}
}
When I debug the program the methods to connect the web parts is always
called right after the button click event fires and before the
PreRender event is called. How then is it possible to cause the button
click to update the providers data?
Cheers for any help.