asp.net - For Each GridviewRow Loop, with where clause? -


is there easier way of using code:

for each gvrow gridviewrow in gvgridviewexample.rows     if gvrow.rowtype = datacontrolrowtype.datarow         'do     end if next 

such when using ienumerable theoritically (psuedo code style) add a:

gvgridviewexample.where(function(chr) chr.row = datarow) 

i wondered if there easier way of coding out?

thanks,

firstcape

apart fact first snippet is simple , clear, rows property of gridview returns only datarows. don't need check type @ all.

msdn

the rows property (collection) used store data rows in gridview control.

only rows rowtype property set datacontrolrowtype.datarow stored in rows collection. gridviewrow objects represent header, footer, , pager rows not included in collection.

you can have different types in events rowcreated or rowdatabound. if want access header, footer or pager outside of these events can use appropriate properties of gridview headerrow or footerrow.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -