Search code examples
c#asp.netsharepointweb-parts

Sharepoint connected web parts question


I have one web part (the provider) which displays insurance claims in a gridview. When user clicks on one this value(case number) is passed via IWebPartField interface to another web part(consumer) which displays detailed info about the claim. So far so good. I can select different claims in the provider and the details show up in the consumer just fine. The moment I add a TextBox to the consumer, the consumer no longer recognizes the case number passed. I need the user to be able to enter a value in the textbox and click a button to update that claim info. I can debug and attach to process and it looks like it is getting the case in the callback function, etc, but when it is setting parameters for the stored proc in CreateChildControls, it is null. Comment out the TextBox and it works fine.

Any clues as to what is going on? Brand new to Sharepoint web parts...any help appreciated!

thanks, PhilJ


Solution

  • It may be an issue with the way that ShaprePoint renders the controls, so the textbox might not have actually been created at the time you need it. Try adding in a call to EnsureChildControls() in either the OnLoad() or the Render() events.