Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   sort dataview by column index (http://www.velocityreviews.com/forums/t121414-sort-dataview-by-column-index.html)

wapsiii 03-12-2006 12:58 PM

sort dataview by column index
 
is it possible to sort a dataview by a column index?

Instead of this:
dv.Sort = "Id";

I'd like to do this:
dv.Sort = 0; // where 0 is column index

/M

=?Utf-8?B?RWx0b24gVw==?= 03-12-2006 03:59 PM

RE: sort dataview by column index
 
Hi wapsiii,

Dataview sort Expression is similar to sql query sort (without ORDER BY). It
takes column name (or names). If you really want to use column index, I
suggest you use following way:

dv.Sort = dv.Table.Columns[col_index].ColumnName;


HTH

Elton Wang

"wapsiii" wrote:

> is it possible to sort a dataview by a column index?
>
> Instead of this:
> dv.Sort = "Id";
>
> I'd like to do this:
> dv.Sort = 0; // where 0 is column index
>
> /M
>



All times are GMT. The time now is 01:52 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.