Is there a way to add a new row in the first row under the header of a datagrid, instead of adding the new row at the bottom in the footer? If so, please provide a code sample of how to do it.
Thanks for responding. Personally I have no problem with having the add row in the footer. My boss is the one who would like it at the top because the data grid is more than 40 columns wide and each week a new row is added and now that we're in to week 22 or thereabouts you can no longer see the column names in the header. Any ideas for a simple solution?
Is there a way to have the scroll bars appear on the left side of the datgrid?
ca8msm....
Would you provide a code sample using an achor tag to make the page appear at 'the relevant point'? My problem is not being able to see the header row when adding a new row at the bottom of the datagrid.
What about having two table rows in the header and making the bottom one textboxes and a button. You would probably need to use a datalist for this though (but datalists rock).
You can do it another way - if you add an empty row to your datasource at position 0, you can hide if you are not in "insert" mode or show it if you are. e.g.
you know, now that I am thinking about this more...it really doesn't matter if your inserting records at the top of the grid. when the grid rebinds itself, that newly added record will go straight to the bottom of the grid. to avoid that, you would have to sort by the record ID DESC; so the last record ends up at the top.
i thought i could add my suggestions also to this particular point:
>>Is there a way to add a new row in the first row under the header of a datagrid
there is a javascipt based solution for this too, the datagrid that is outputted is a table right? and using JS (DOM) one can control the tabe structure itself, therefore adding a first row that way would be simple (the row must always be inserted at position 1, i.e. below the header row).
i can give u a sample, but that is only if the poster is interesed in a JS solution.
the drawbacks:
1. If JS is disabled then it wont work.
2. State cannot be preserved for rows created by JS(but it can be overcome easily).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.