By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,596 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

dropdownlist index in an editable datagrid

P: n/a
I have an editable datagrid
one of itz column is a dropdownlist
<ItemTemplate> <asp:Label ID=lblAreaWebsiteID Runat=server
DataBinder.Eval(Container.DataItem,"WebsiteName")% >'></asp:Label>
<asp:DropDownList ID="ddlWebsiteName_edit" Runat=server
DataSource="<%# PopulateWebsiteID()%>" DataTextField="name"

I want to set the dropdownindex on the ddl to the seleced index in edit

what i do rite now is
public void SetDropDownIndexForWebite(object sender,System.EventArgs e)
DropDownList ed;
ed = (DropDownList)sender;
ed.SelectedIndex = ed.Items.IndexOf(ed.Items.FindByText(name));

protected void dgAreaList_Edit(object sender,DataGridCommandEventArgs
dgAreaList.ShowFooter= false;
dgAreaList.EditItemIndex= e.Item.ItemIndex;
Label lblAreaWebsiteID =
name = lblAreaWebsiteID.Text;

but it doesnt work.

Jan 3 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.