Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding Controls After DataSource Change
Message
From
25/07/2006 07:43:29
Rex Mahel
Realm Software, Llc
Ohio, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01139026
Message ID:
01139619
Views:
12
Kevin,


ddlInstrument.BindingSource = "Instrument";
ddlInstrument.BindingSourceDisplayMember = "Name";
ddlInstrument.BindingSourceValueMember = "InstrumentId";
ddlInstrument.BindingValueSource = "oMusicianInstrumentXRef.MyDataRow";
ddlInstrument.BindingValueSourceMember = "InstrumentId";

What I am trying to do is be able to make changes to the GridView records without saving the individual records back to the base tables until I save the entire page.

I populate MyDataRow with the following code:
public void GetMusicianInstrumentFromDataTableByMusicianInstrumentID(int? musicianInstrumentID)
{
	if (this.DataSet != null)
	{
		DataRow() drs = this.DataSet.Tables[this.TableName].Select("MusicianInstrumentId = " + musicianInstrumentID.ToString());
		this.MyDataRow = drs[0];
	}
}
Is seems to change the MyDataRow property, but not the dropdownlist values. What do I need to do to rebind the DDL?

Thanks


>Rex,
>
>>I've told this story before, but here goes. I have a business object that populates a GridView. I subclassed the business object and added a DataRow property that I populate with the selected DataRow from the GridView. I bind the data in the DataRow to mmDropDownList objects. My problem is that when I select a new row, I can't get the new values to populate into the mmDropDowns. I use the following method:
>>
>>
>>	protected void gdvInstruments_SelectedIndexChanged(object sender, EventArgs e)
>>	{
>>		int musicianInstrumentID = (int)this.gdvInstruments.SelectedDataKey.Value;
>>		this.oMusicianInstrumentXRef.GetMusicianInstrumentFromDataTableByMusicianInstrumentID(musicianInstrumentID);
>>		this.BindControl(this.ddlInstrument);
>>		this.BindControl(this.ddlGenre);
>>		this.BindControl(this.ddlExperience);
>>	}
>>
>
>It's hard to completely understand the scenario from here, but how are you binding the data in the DataRow to the mmDropDownList objects?
>
>Best Regards,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform