0

I need to get selected index value from the dropdownlist and sort it on the GridView.

The code above can only sort by column.

Anybody has any idea how to add the column with the selectedValue into the Sort?

dv.RowFilter = "NOID = '" + ddl.SelectedValue.ToString() + "'";
dv.Sort = "NOID = '" + ddl.SelectedItem + "'" + " " + "ASC";

i do not want this -

dv.Sort = "ID ASC";
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by __avd
0

Sort property requires a column/field name on which sorting can be done.

dv.Sort = "NOID"; // NOID is a field/column name
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.