Tuesday, August 23, 2011

Dropdown in GridView

1. Setting the value of dropdown in row databound
// Retrieve the underlying data item. In this example
// the underlying data item is a DataRowView object.
DataRowView rowView = (DataRowView)e.Row.DataItem;

// Retrieve the state value for the current row.
String state = rowView["state"].ToString();

// Retrieve the DropDownList control from the current row.
DropDownList list = (DropDownList)e.Row.FindControl("StatesList");

2.How can you access and display the row index of a gridview item as the command argument

 commandargument='<%#DataBinder.Eval(Container, "DataItemIndex")%>'



Ref:
1. Setting value of dropdown

2. For all operations

No comments:

Post a Comment

Devops links

  Build Versioning in Azure DevOps Pipelines