How to compare 2 datasets and assign that value to repeater
I have 2 datasets. 1 is assigned to dropdown and the other is assigned to repeater. If we select value from drop down, then values in repeater should be populated according to that value.
Initia开发者_开发百科lly I have assigned dataview to dropdown:
DataView dw = DataAccess.GetFirmID().Tables[0].DefaultView;
distinctDataTable = dw.ToTable(true, "FirmID");
ddlFirms.DataSource = distinctDataTable;
ddlFirms.DataValueField = "FirmID";
ddlFirms.DataBind();
In repeater:
LinkRepeater.DataSource = DataAccess.GetFirmID();
LinkRepeater.DataBind();
My question: if i change the "FirmID" value, according to that repeater value shoud be populated. Please help me out!
My understanding of your problem is that you want to change the data in a ASP.NET repeater when a certain value is selected in the dropdown.
You should set the AutoPostBack property of the dropdownlist to "true". Then, when the index is changed by the user, the page will postback with the new selected index. You'll want to make sure that the repeater uses the selected item from the dropdownlist to choose what to propagate.
精彩评论