Click here to Skip to main content
14,865,688 members
Home / Discussions / ASP.NET


AnswerRe: Problem with CSS on ASP.Net Pin
Abhishek Sur18-Sep-09 11:31
professionalAbhishek Sur18-Sep-09 11:31 
QuestionBinding newly created row to a gridview. Pin
dayakar_dn18-Sep-09 10:42
Memberdayakar_dn18-Sep-09 10:42 
AnswerRe: Binding newly created row to a gridview. Pin
Abhishek Sur18-Sep-09 11:33
professionalAbhishek Sur18-Sep-09 11:33 
QuestionHow to keep Session alive while going from unsecure to secure pages? Pin
chintanstrings18-Sep-09 10:39
Memberchintanstrings18-Sep-09 10:39 
QuestionCascade Master Pages properties [modified] Pin
Dirso18-Sep-09 9:09
MemberDirso18-Sep-09 9:09 
AnswerRe: Cascade Master Pages properties Pin
Christian Graus18-Sep-09 12:25
protectorChristian Graus18-Sep-09 12:25 
QuestionRow Filter Pin
anushh18-Sep-09 8:48
Memberanushh18-Sep-09 8:48 
AnswerRe: Row Filter Pin
Manas Bhardwaj18-Sep-09 9:41
professionalManas Bhardwaj18-Sep-09 9:41 
anushh wrote:
How to filter top 4 records from a dataset using rowfilter property in codebehind page

No, the RowFilter property was not designed to do that. It is more analogous to the WHERE clause of an SQL statement.
Why dont you do it at the SQL Server itself?

Anyways, you may also try to use this approach:

private DataView GetTopDataViewRows(DataView dv, Int32 n)
	DataTable dt = dv.Table.Clone(); 

	for (int i = 0; i < n-1; i++)
		if (i>= dv.Count)
	return new DataView(dt, dv.RowFilter, dv.Sort, dv.RowStateFilter); 

Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

GeneralRe: Row Filter Pin
Abhishek Sur18-Sep-09 11:37
professionalAbhishek Sur18-Sep-09 11:37 
GeneralRe: Row Filter Pin
Manas Bhardwaj18-Sep-09 11:43
professionalManas Bhardwaj18-Sep-09 11:43 
GeneralRe: Row Filter Pin
Abhishek Sur18-Sep-09 11:48
professionalAbhishek Sur18-Sep-09 11:48 
GeneralRe: Row Filter Pin
Manas Bhardwaj18-Sep-09 11:54
professionalManas Bhardwaj18-Sep-09 11:54 
GeneralRe: Row Filter Pin
Abhishek Sur18-Sep-09 11:58
professionalAbhishek Sur18-Sep-09 11:58 
Questionfilter datagrid rows nested within datalist Pin
janetb9918-Sep-09 7:46
Memberjanetb9918-Sep-09 7:46 
Questionmaintaining session Pin
laziale18-Sep-09 6:41
Memberlaziale18-Sep-09 6:41 
AnswerRe: maintaining session Pin
Christian Graus18-Sep-09 11:38
protectorChristian Graus18-Sep-09 11:38 
QuestionDefault Positioning Pin
Alireza Loghmani18-Sep-09 4:11
MemberAlireza Loghmani18-Sep-09 4:11 
AnswerRe: Default Positioning Pin
sashidhar18-Sep-09 5:42
Membersashidhar18-Sep-09 5:42 
Questionproblems with webservices Pin
shankbond18-Sep-09 3:40
Membershankbond18-Sep-09 3:40 
AnswerRe: problems with webservices Pin
Abhishek Sur18-Sep-09 5:26
professionalAbhishek Sur18-Sep-09 5:26 
GeneralRe: problems with webservices Pin
shankbond18-Sep-09 5:43
Membershankbond18-Sep-09 5:43 
GeneralRe: problems with webservices Pin
Abhishek Sur19-Sep-09 7:08
professionalAbhishek Sur19-Sep-09 7:08 
GeneralRe: problems with webservices Pin
shankbond21-Sep-09 1:22
Membershankbond21-Sep-09 1:22 
QuestionLooping to find LoginView controls Pin
NoirWD18-Sep-09 3:34
MemberNoirWD18-Sep-09 3:34 
QuestionDatatable Concatination Pin
sekannak18-Sep-09 2:56
Membersekannak18-Sep-09 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.