SortCommand Event in DataGrid

M

Manav

Hi,

I am creating a datagrid control at runtime. When i set the
AutoGenerateColumns property to true the sortcommnd event gets fired but
when i set the same property to false the sortcommand event doesnot get
fired itself. Does anybody have any idea about it


Cheers,
Manav
 
S

Scott Mitchell [MVP]

Manav, do you set the SortExpression property for each of the columns you
are adding to the DataGrid? To indicate that an explicitly added column
is "sortable" you need to set its SortExpression property explicitly.
(When using AutoGenerateColumns="True", the SortExpression is
automatically set to the name of the field being bound to the column...)

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top