The details will require another web service call based on the location selected. I think I'm following you but let me show what I've done so far.
I've created the webpart (ascx), added the properties in code, added the webpart and properties to Site Manager>Development>Web Parts, added a transformation. Here is my simple code for my webpart (of course I've added some properties as well for paging, transformations, etc)
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Locations.ascx.cs" Inherits="CMSWebParts_Test_Locations" %>
<cms:LocalizedLabel ID="lblCity" runat="server" ResourceString="locations.city" />
<asp:TextBox ID="TextBox1" runat="server" />
<cms:LocalizedDropDownList ID="ddlStates" runat="server">
<asp:ListItem Text="IA" Value="IA" />
<asp:ListItem Text="MN" Value="MN" />
<asp:ListItem Text="WI" Value="WI" />
</cms:LocalizedDropDownList>
<cms:LocalizedLinkButton ID="btnSearch" runat="server" ResourceString="locations.search" OnClick="btnSearch_Click" /><br /><br />
<cms:CMSRepeater ID="repItems" runat="server" />
#region "Methods"
/// <summary>
/// Content loaded event handler
/// </summary>
public override void OnContentLoaded()
{
base.OnContentLoaded();
SetupControl();
}
/// <summary>
/// Initializes the control properties
/// </summary>
protected void SetupControl()
{
if (this.StopProcessing)
{
// Do nothing
}
else
{
// Document properties
repItems.NestedControlsID = NestedControlsID;
// Pager
repItems.EnablePaging = EnablePaging;
repItems.PageSize = PageSize;
repItems.PagerControl.PagerPosition = PagerPosition;
repItems.PagerControl.QueryStringKey = QueryStringKey;
repItems.PagerControl.PagingMode = PagingMode;
repItems.PagerControl.BackNextLocation = BackNextLocation;
repItems.PagerControl.ShowFirstLast = ShowFirstLast;
repItems.PagerControl.PagerHTMLBefore = PagerHTMLBefore;
repItems.PagerControl.PagerHTMLAfter = PagerHTMLAfter;
repItems.PagerControl.ResultsLocation = ResultsPosition;
repItems.PagerControl.PageNumbersSeparator = PageNumbersSeparator;
// Transformation properties
repItems.TransformationName = TransformationName;
repItems.SelectedItemTransformationName = SelectedItemTransformationName;
repItems.AlternatingTransformationName = AlternatingTransformationName;
// Public properties
repItems.HideControlForZeroRows = HideControlForZeroRows;
repItems.ZeroRowsText = ZeroRowsText;
repItems.ItemSeparator = ItemSeparator;
}
}
/// <summary>
/// Reloads data.
/// </summary>
public override void ReloadData()
{
base.ReloadData();
SetupControl();
repItems.ReloadData(true);
}
/// <summary>
/// OnPrerender override (Set visibility).
/// </summary>
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
Visible = !repItems.StopProcessing;
if (DataHelper.DataSourceIsEmpty(repItems.DataSource) && (repItems.HideControlForZeroRows))
{
Visible = false;
}
}
#endregion
#region "Events"
/// <summary>
/// Gets the data from the webservice and binds it to the repeater
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
MyWebService.RetailStructure.RetailStructureService rss = new MyWebService.RetailStructure.RetailStructureService();
MyWebService.RetailStructure.ServiceCallResult scr = rss.GetStoreDataByProximityToCityAndState("Kentico", TextBox1.Text.Trim(), ddlStates.SelectedValue);
if (!scr.HasErrors)
{
repItems.DataSource = scr.DataSetResults.Tables[0];
repItems.DataBind();
}
}
#endregion
Transformation:
<div style="padding: 5px;">
<div style="float: left; width: 50%;">
#<%# Eval("StoreNumber") %> </b> <br />
<%#Eval("Address1") %><br />
<%#Eval("City") %>,
<%#Eval("ST") %>
<%#Eval("Zip") %>
</div>
<div style="float: right; width: 50%;">
<a href="#">Directions</a><br />
<a href='#'>Store Info</a><br />
<a href='#'>Add to My Stores</a>
</div>
<div style="clear: both;"></div>
</div>
This all works great and displays everything I wanted with 2 exceptions:
* Unable to get a link to work to view the details. Those would be different ascx files I'm guessing or a transformation, not sure.
* Unable to get paging to work