getting info to a UserControl?

  • Thread starter Thread starter HockeyFan
  • Start date Start date
H

HockeyFan

I'm having trouble getting information passed to a UserControl that I
wrote.
Within the control is an ObjectDataSource that populates a GridView on
the control. The Select method for the ObjectDataSource gets invoked
prior to almost anything else going on with the control, so the
GridView isn't available yet. No public properties seem to be
available yet. I put a hidden field on the control, but it's not
available yet.
Within that Select method, I need to get a value from the Repeater
item that the control is on. How might I do this? I'm just wanting
to pass an integer.
 
I'm having trouble getting information passed to a UserControl that I
wrote.
Within the control is an ObjectDataSource that populates a GridView on
the control. The Select method for the ObjectDataSource gets invoked
prior to almost anything else going on with the control, so the
GridView isn't available yet. No public properties seem to be
available yet. I put a hidden field on the control, but it's not
available yet.
Within that Select method, I need to get a value from the Repeater
item that the control is on. How might I do this? I'm just wanting
to pass an integer.


I think a public property could help

private int _selectid;

[Bindable(true), Category("Behavior"), Description("...")]
public int SelectId
{
get
{
return _selectid;
}
set
{
_selectid= value;
}
}

add this in your class

and use the _selectid in your SELECT
 
Back
Top