Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > edit datagrid with dropdownlist

Reply
Thread Tools

edit datagrid with dropdownlist

 
 
Mike P
Guest
Posts: n/a
 
      08-21-2003
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



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Ravikanth[MVP]
Guest
Posts: n/a
 
      08-21-2003
Hi

Please look into the following URL:
http://www.4guysfromrolla.com/webtech/050801-1.shtml

Ravikanth[MVP]


>-----Original Message-----
>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
>
>
>
>*** Sent via Developersdex http://www.developersdex.com

***
>Don't just participate in USENET...get rewarded for it!
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Snapshot restraint - edit, edit, edit Alan Browne Digital Photography 24 05-10-2005 10:15 PM
Snapshot restraint - edit, edit, edit Patrick Digital Photography 0 05-06-2005 10:53 PM
Edit All Function for DataGrid, and Moving the Edit Function in a DataGrid Schultz ASP .Net 3 02-14-2005 04:47 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM
copying value of DDL in a Datagrid "pre-edit command" to value in "post edit command" San Diego Guy ASP .Net 0 08-07-2003 08:59 PM



Advertisments