I'm now getting the error 'DataItem denotes a 'property' where a 'method' was expected again! My code is :
public int GetSelIndex(string strCallType)
{
int intLoop;
//Loop through each row in the DataSet
DataTable dt = ddlDataSet.Tables["CallTypes"];
for (intLoop = 0; intLoop >= dt.Rows.Count-1; intLoop ++)
{
if (Convert.ToInt32(strCallType) == Convert.ToInt32((string)dt.Rows[intLoop]["CallType"]))
{
return intLoop;
}
}
return -1;
}
And the related asp is :
<asp:TemplateColumn HeaderText="CallType">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "CallType"

%>
</ItemTemplate>
<EditItemTemplate>
<asp

ropDownList runat="server" id="lstCallTypes"
DataValueField="CallType"
DataTextField="CallType"
DataSource='<%# GetCallTypes() %>'
SelectedIndex='<%# GetSelIndex(Container.DataItem("CallType"

) %>'
/>
</EditItemTemplate>
</asp:TemplateColumn>
This is really driving me up the wall! What am I doing wrong here?
Thanks,
Mike