|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Would like to load a datagrid already in edit mode instead of having the user click the edit buttonNow my asp.net datagrid shows an edit button and clicking it puts the datagrid in edit mode.
I would like to: 1) possilby load the page already in edit mode (implies some kind of OnLoad command to the datagrid to put it in edit mode before it is rendered and sent) and 2) have a button outside the datagrid to initiate edit, update , etc. that does not require the button to have a datagrid as the parent (as the buttons inside the datagrid have). Thanks in advance. Hi Frank,
It's not clear what your idea is. What you mentioned inside button can invoke a specified row (clicked) into edit state. So how do you specify which row will be edited, especially you want to directly into edit state from page load? Hope you can give more detailed info about your idea. Elton Wang elton_w***@hotmail.com >-----Original Message----- it puts the datagrid in edit mode.>Now my asp.net datagrid shows an edit button and clicking > some kind of OnLoad command to the datagrid to put it in >I would like to: > >1) possilby load the page already in edit mode (implies edit mode before it is rendered and sent) > update , etc. that does not require the button to have a >and > >2) have a button outside the datagrid to initiate edit, datagrid as the parent (as the buttons inside the datagrid have). Show quoteHide quote > >Thanks in advance. > > Well, there are 2 ideas here (both related to datagrid)
1) when a datagrid is built and loaded .. it is already in a "normal state". You can add template edit with a button that the user can click to reload it and rerender it in an edit state, but only after the user clicks on it. I would like the datagrid loaded already in an edit state (like forms used to do) ..as if the user had clicked edit alredy, before the page even loaded so the user can do ahead and edit whenhe firsty sees it without having to click the edit button first. 2) For the second idea .. I am just trying to move the edit (or update) button outside the datagrid so it canappear somehwere else on the page ... This is really about single record datagrids (and datalists) where there is only one record involved ... no need for one per row (only one involved) Hope this is clearer .. hard to explain sometimes ... Show quoteHide quote "Elton Wang" <anonym***@discussions.microsoft.com> wrote in message news:024d01c534c3$c98e9940$a401280a@phx.gbl... > Hi Frank, > > It's not clear what your idea is. > > What you mentioned inside button can invoke a specified > row (clicked) into edit state. So how do you specify which > row will be edited, especially you want to directly into > edit state from page load? > > Hope you can give more detailed info about your idea. > > Elton Wang > elton_w***@hotmail.com > > > >-----Original Message----- > >Now my asp.net datagrid shows an edit button and clicking > it puts the datagrid in edit mode. > > > >I would like to: > > > >1) possilby load the page already in edit mode (implies > some kind of OnLoad command to the datagrid to put it in > edit mode before it is rendered and sent) > > > >and > > > >2) have a button outside the datagrid to initiate edit, > update , etc. that does not require the button to have a > datagrid as the parent (as the buttons inside the datagrid > have). > > > >Thanks in advance. > > > > If I understand correctly, you actually want a Multi-row
updating datagrid. In that case you can directly put textbox, dropdownlist, and checkbox in TemplateColumn + ItemTemplate tags (except key column). So the whole datagrid is editable. Then you have a normal button on page to implement updating operation. HTH Elton Wang >-----Original Message----- in a "normal state".>Well, there are 2 ideas here (both related to datagrid) > >1) when a datagrid is built and loaded .. it is already >You can add template edit with a button that the user can click to reload it>and rerender it in an edit state, but only after the user clicks on it.> (like forms used>I would like the datagrid loaded already in an edit state >to do) ..as if the user had clicked edit alredy, before the page even loaded>so the user can do ahead and edit whenhe firsty sees it without having to>click the edit button first. edit (or update)> >2) For the second idea .. I am just trying to move the >button outside the datagrid so it canappear somehwere else on the page ...> datalists) where there is>This is really about single record datagrids (and >only one record involved ... no need for one per row (only one involved)Show quoteHide quote > >Hope this is clearer .. hard to explain sometimes ... > >"Elton Wang" <anonym***@discussions.microsoft.com> wrote in message >news:024d01c534c3$c98e9940$a401280a@phx.gbl... >> Hi Frank, >> >> It's not clear what your idea is. >> >> What you mentioned inside button can invoke a specified >> row (clicked) into edit state. So how do you specify which >> row will be edited, especially you want to directly into >> edit state from page load? >> >> Hope you can give more detailed info about your idea. >> >> Elton Wang >> elton_w***@hotmail.com >> >> >> >-----Original Message----- >> >Now my asp.net datagrid shows an edit button and clicking >> it puts the datagrid in edit mode. >> > >> >I would like to: >> > >> >1) possilby load the page already in edit mode (implies >> some kind of OnLoad command to the datagrid to put it in >> edit mode before it is rendered and sent) >> > >> >and >> > >> >2) have a button outside the datagrid to initiate edit, >> update , etc. that does not require the button to have a >> datagrid as the parent (as the buttons inside the datagrid >> have). >> > >> >Thanks in advance. >> > >> > > > >. > Nope .. that is not it ... Not multi row at all - single row.
In the case you are describing ....the drop down list box is still within the geographic region of the datagrid. That means the buttons will be within the datagrid not somewhere else on the page. I want to put the update, edit, etc buttons somewhere else on the page - outside of the datagrid and its template area. The code for update, etc .. is looking for object and event parameters that are not available to buttons and links outside of the datagrid, but are provided by buttons within the datagrid. The other case, is realted in that .. I want to in effect "simulate" that the edit button was pressed on the pages initial load .. which i'm assuming could be done if I can get the propre reference to the datagrid and call some method to put it in the "edit sate" Is that any clearer? (Thanks for trying) Show quoteHide quote "Elton Wang" <anonym***@discussions.microsoft.com> wrote in message news:0bf201c5353c$a0c3e5f0$a601280a@phx.gbl... > If I understand correctly, you actually want a Multi-row > updating datagrid. In that case you can directly put > textbox, dropdownlist, and checkbox in TemplateColumn + > ItemTemplate tags (except key column). So the whole > datagrid is editable. Then you have a normal button on > page to implement updating operation. > > HTH > > Elton Wang > > > >-----Original Message----- > >Well, there are 2 ideas here (both related to datagrid) > > > >1) when a datagrid is built and loaded .. it is already > in a "normal state". > >You can add template edit with a button that the user can > click to reload it > >and rerender it in an edit state, but only after the user > clicks on it. > > > >I would like the datagrid loaded already in an edit state > (like forms used > >to do) ..as if the user had clicked edit alredy, before > the page even loaded > >so the user can do ahead and edit whenhe firsty sees it > without having to > >click the edit button first. > > > >2) For the second idea .. I am just trying to move the > edit (or update) > >button outside the datagrid so it canappear somehwere > else on the page ... > > > >This is really about single record datagrids (and > datalists) where there is > >only one record involved ... no need for one per row > (only one involved) > > > >Hope this is clearer .. hard to explain sometimes ... > > > >"Elton Wang" <anonym***@discussions.microsoft.com> wrote > in message > >news:024d01c534c3$c98e9940$a401280a@phx.gbl... > >> Hi Frank, > >> > >> It's not clear what your idea is. > >> > >> What you mentioned inside button can invoke a specified > >> row (clicked) into edit state. So how do you specify > which > >> row will be edited, especially you want to directly into > >> edit state from page load? > >> > >> Hope you can give more detailed info about your idea. > >> > >> Elton Wang > >> elton_w***@hotmail.com > >> > >> > >> >-----Original Message----- > >> >Now my asp.net datagrid shows an edit button and > clicking > >> it puts the datagrid in edit mode. > >> > > >> >I would like to: > >> > > >> >1) possilby load the page already in edit mode (implies > >> some kind of OnLoad command to the datagrid to put it in > >> edit mode before it is rendered and sent) > >> > > >> >and > >> > > >> >2) have a button outside the datagrid to initiate edit, > >> update , etc. that does not require the button to have a > >> datagrid as the parent (as the buttons inside the > datagrid > >> have). > >> > > >> >Thanks in advance. > >> > > >> > > > > > > >. > > OK single row.
So suppose there are 10 rows in a datagrid. When in page load, how do you know which row the user wants to select to edit, before the user click any button? Although there is only one row involved, the important question is that which row is involved. What I mentioned dropdownlist is not for row selection. It's the same as textbox for a field data, only limit the data in select range. HTH Elton Wang >-----Original Message----- is still within>Nope .. that is not it ... Not multi row at all - single row. > >In the case you are describing ....the drop down list box >the geographic region of the datagrid. somewhere else on the> >That means the buttons will be within the datagrid not >page. else on the page -> >I want to put the update, edit, etc buttons somewhere >outside of the datagrid and its template area. event parameters that> >The code for update, etc .. is looking for object and >are not available to buttons and links outside of the datagrid, but are>provided by buttons within the datagrid. effect "simulate" that> >The other case, is realted in that .. I want to in >the edit button was pressed on the pages initial load .. which i'm assuming>could be done if I can get the propre reference to the datagrid and callShow quoteHide quote >some method to put it in the "edit sate" > >Is that any clearer? > >(Thanks for trying) > > >"Elton Wang" <anonym***@discussions.microsoft.com> wrote in message >news:0bf201c5353c$a0c3e5f0$a601280a@phx.gbl... >> If I understand correctly, you actually want a Multi-row >> updating datagrid. In that case you can directly put >> textbox, dropdownlist, and checkbox in TemplateColumn + >> ItemTemplate tags (except key column). So the whole >> datagrid is editable. Then you have a normal button on >> page to implement updating operation. >> >> HTH >> >> Elton Wang >> >> >> >-----Original Message----- >> >Well, there are 2 ideas here (both related to datagrid) >> > >> >1) when a datagrid is built and loaded .. it is already >> in a "normal state". >> >You can add template edit with a button that the user can >> click to reload it >> >and rerender it in an edit state, but only after the user >> clicks on it. >> > >> >I would like the datagrid loaded already in an edit state >> (like forms used >> >to do) ..as if the user had clicked edit alredy, before >> the page even loaded >> >so the user can do ahead and edit whenhe firsty sees it >> without having to >> >click the edit button first. >> > >> >2) For the second idea .. I am just trying to move the >> edit (or update) >> >button outside the datagrid so it canappear somehwere >> else on the page ... >> > >> >This is really about single record datagrids (and >> datalists) where there is >> >only one record involved ... no need for one per row >> (only one involved) >> > >> >Hope this is clearer .. hard to explain sometimes ... >> > >> >"Elton Wang" <anonym***@discussions.microsoft.com> wrote >> in message >> >news:024d01c534c3$c98e9940$a401280a@phx.gbl... >> >> Hi Frank, >> >> >> >> It's not clear what your idea is. >> >> >> >> What you mentioned inside button can invoke a specified >> >> row (clicked) into edit state. So how do you specify >> which >> >> row will be edited, especially you want to directly into >> >> edit state from page load? >> >> >> >> Hope you can give more detailed info about your idea. >> >> >> >> Elton Wang >> >> elton_w***@hotmail.com >> >> >> >> >> >> >-----Original Message----- >> >> >Now my asp.net datagrid shows an edit button and >> clicking >> >> it puts the datagrid in edit mode. >> >> > >> >> >I would like to: >> >> > >> >> >1) possilby load the page already in edit mode (implies >> >> some kind of OnLoad command to the datagrid to put it in >> >> edit mode before it is rendered and sent) >> >> > >> >> >and >> >> > >> >> >2) have a button outside the datagrid to initiate edit, >> >> update , etc. that does not require the button to have a >> >> datagrid as the parent (as the buttons inside the >> datagrid >> >> have). >> >> > >> >> >Thanks in advance. >> >> > >> >> > >> > >> > >> >. >> > > > >. > Hi:
You can control how many rows are involved by carefully constucting the sql that pulls the row from the database .. so that there is only ... or you can make a datagrid using a datasource that only has 1 record .. that is not the real issue so let's not get hung up on that. Also, the button issue is involved for both datagird (1 to n records) or datalist (1 to n records) . the template buttons for edit, update, cancel etc are geographically located within the confines of the datagrid and not necessarily where a designer would wnat them (say all on the left) Becasuse the standard code that supports edit, update, save, etc expects that the ovject and event are passed in .. any button outside the data object can't pass that info in .. so you can't call the routines from a button outside the data container. The solution should be to somehow get a reference to the datagrid, or to hidden versions fo the buttons, or something .. but I haven't been able to figure it out. The other idea, of rendering the datagrid already in edit mode is similar .. acting as if the user already clicked on edit before loading the page. Show quoteHide quote "Elton Wang" <anonym***@discussions.microsoft.com> wrote in message news:074101c5356f$b4285030$a401280a@phx.gbl... > OK single row. > > So suppose there are 10 rows in a datagrid. When in page > load, how do you know which row the user wants to select > to edit, before the user click any button? > > Although there is only one row involved, the important > question is that which row is involved. > > What I mentioned dropdownlist is not for row selection. > It's the same as textbox for a field data, only limit the > data in select range. > > HTH > > Elton Wang > > > >-----Original Message----- > >Nope .. that is not it ... Not multi row at all - single > row. > > > >In the case you are describing ....the drop down list box > is still within > >the geographic region of the datagrid. > > > >That means the buttons will be within the datagrid not > somewhere else on the > >page. > > > >I want to put the update, edit, etc buttons somewhere > else on the page - > >outside of the datagrid and its template area. > > > >The code for update, etc .. is looking for object and > event parameters that > >are not available to buttons and links outside of the > datagrid, but are > >provided by buttons within the datagrid. > > > >The other case, is realted in that .. I want to in > effect "simulate" that > >the edit button was pressed on the pages initial load .. > which i'm assuming > >could be done if I can get the propre reference to the > datagrid and call > >some method to put it in the "edit sate" > > > >Is that any clearer? > > > >(Thanks for trying) > > > > > >"Elton Wang" <anonym***@discussions.microsoft.com> wrote > in message > >news:0bf201c5353c$a0c3e5f0$a601280a@phx.gbl... > >> If I understand correctly, you actually want a Multi-row > >> updating datagrid. In that case you can directly put > >> textbox, dropdownlist, and checkbox in TemplateColumn + > >> ItemTemplate tags (except key column). So the whole > >> datagrid is editable. Then you have a normal button on > >> page to implement updating operation. > >> > >> HTH > >> > >> Elton Wang > >> > >> > >> >-----Original Message----- > >> >Well, there are 2 ideas here (both related to datagrid) > >> > > >> >1) when a datagrid is built and loaded .. it is already > >> in a "normal state". > >> >You can add template edit with a button that the user > can > >> click to reload it > >> >and rerender it in an edit state, but only after the > user > >> clicks on it. > >> > > >> >I would like the datagrid loaded already in an edit > state > >> (like forms used > >> >to do) ..as if the user had clicked edit alredy, before > >> the page even loaded > >> >so the user can do ahead and edit whenhe firsty sees it > >> without having to > >> >click the edit button first. > >> > > >> >2) For the second idea .. I am just trying to move the > >> edit (or update) > >> >button outside the datagrid so it canappear somehwere > >> else on the page ... > >> > > >> >This is really about single record datagrids (and > >> datalists) where there is > >> >only one record involved ... no need for one per row > >> (only one involved) > >> > > >> >Hope this is clearer .. hard to explain sometimes ... > >> > > >> >"Elton Wang" <anonym***@discussions.microsoft.com> > wrote > >> in message > >> >news:024d01c534c3$c98e9940$a401280a@phx.gbl... > >> >> Hi Frank, > >> >> > >> >> It's not clear what your idea is. > >> >> > >> >> What you mentioned inside button can invoke a > specified > >> >> row (clicked) into edit state. So how do you specify > >> which > >> >> row will be edited, especially you want to directly > into > >> >> edit state from page load? > >> >> > >> >> Hope you can give more detailed info about your idea. > >> >> > >> >> Elton Wang > >> >> elton_w***@hotmail.com > >> >> > >> >> > >> >> >-----Original Message----- > >> >> >Now my asp.net datagrid shows an edit button and > >> clicking > >> >> it puts the datagrid in edit mode. > >> >> > > >> >> >I would like to: > >> >> > > >> >> >1) possilby load the page already in edit mode > (implies > >> >> some kind of OnLoad command to the datagrid to put > it in > >> >> edit mode before it is rendered and sent) > >> >> > > >> >> >and > >> >> > > >> >> >2) have a button outside the datagrid to initiate > edit, > >> >> update , etc. that does not require the button to > have a > >> >> datagrid as the parent (as the buttons inside the > >> datagrid > >> >> have). > >> >> > > >> >> >Thanks in advance. > >> >> > > >> >> > > >> > > >> > > >> >. > >> > > > > > > >. > >
Show quote
Hide quote
"Frank Kurka" <fk***@fkx.com> wrote in message [trim]news:ee1HB4hNFHA.3928@TK2MSFTNGP09.phx.gbl... > Hi: > > You can control how many rows are involved by carefully constucting the > sql > that pulls the row from the database .. so that there is only ... or you > can > make a datagrid using a datasource that only has 1 record .. that is not > the > real issue so let's not get hung up on that. Also, the button issue is > involved for both datagird (1 to n records) or datalist (1 to n records) . > the template buttons for edit, update, cancel etc are geographically > located > within the confines of the datagrid and not necessarily where a designer > would wnat them (say all on the left) Then just before you call: DataGrid1.DataSouce = mycollection; //this is the line you need DataGrid1.EditItemIndex = 0; //could be 1 instead, but guessing 0 since index. DataGrid1.DataBind(); If you've been building your datagrid solely using point and click you have to have a hunt in the code behind for where databind() occurs, expand the web generated code bit. The long and short of it is that, prior to the initial DataBind, you
need to figure out which row you want to be in edit mode. Once you know that simply set the DataGrid.EditItemIndex to the index of that row and DataBind() and voila, that row will be in Edit mode. Ian
populating a datagrid
How can I display hashtable key values in a web page? assigning itemtemplate, edititemtemplate programmatically Label text from template column is blank in ItemCommand event problem exporting datagrid to excel Trying to implement master/detail with 2 datagrids Logic custom replacement of EditCommandColumn can i use dynamic variable inside a dataadapter and bind to datagrid How to pull the data out from two table and bind to repeater |
|||||||||||||||||||||||