M
Mike P
I have a template column with a drop down list which should pass the
value selected by the user to a function which will return a value of
its place in the list...I keep getting the error 'denotes a 'property'
where a 'method' was expected'. Any ideas?
<asp:TemplateColumn HeaderText="CallType">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "CallType") %>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList runat="server" id="lstCallTypes"
DataValueField="CallType"
DataTextField="CallType"
DataSource='<%# GetCallTypes() %>'
SelectedIndex='<%#
GetSelIndex(Container.DataItem("CallType")) %>'
/>
</EditItemTemplate>
</asp:TemplateColumn>
private 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 (Int32.Parse(strCallType) =
Int32.Parse((string)dt.Rows[intLoop]["CallType"]))
{
return intLoop;
}
}
}
Thanks,
Mike
value selected by the user to a function which will return a value of
its place in the list...I keep getting the error 'denotes a 'property'
where a 'method' was expected'. Any ideas?
<asp:TemplateColumn HeaderText="CallType">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "CallType") %>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList runat="server" id="lstCallTypes"
DataValueField="CallType"
DataTextField="CallType"
DataSource='<%# GetCallTypes() %>'
SelectedIndex='<%#
GetSelIndex(Container.DataItem("CallType")) %>'
/>
</EditItemTemplate>
</asp:TemplateColumn>
private 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 (Int32.Parse(strCallType) =
Int32.Parse((string)dt.Rows[intLoop]["CallType"]))
{
return intLoop;
}
}
}
Thanks,
Mike