Default sort column and insert as first row

3 replies. Last post: November 13, 2012 8:42 PM by Bernard Xiang
Tags :
  • (None)

Hi,

  • is it possible set a default ordering in the web grid, like to specify a column and descending order for that column?
  • is it possible to insert a new row as first row of the grid instead of as last row of the grid?

Thanks in advance,

Vince

All Replies

Hi Vince,

It is possible for you to specify sort method for column inside WebGrid. Just add this code inside RootTable tag then WebGrid will be sorted when initialize or on row change.

<RootTable>
...
	<SortedColumns>
		<ISWebGrid:WebGridGroup ColumnMember="CustomerID" SortOrder="Descending" />
	</SortedColumns>
</RootTable>

But I didn't think the 2nd scenario could be achieve for Databound WebGrid. As far as I know, after inserting data, WebGrid will take the data from database and show it as the order in the database. Actually, database will put the new row in the last data. So the new row will be appear in the last row of WebGrid. Hope this helps.

Regards,
Bernard

Hi Bernard,

with the sort I was able to have the behavior I need.

Thanks,

Daniele

Hi Daniele,

Glad that you have solved your problem. If you have any further question, please don't hesitate to ask us.

Regards,
Bernard

All times are GMT -5. The time now is 5:46 AM.
Previous Next