Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Frank Kurka #1
Would like to load a datagrid already in edit mode instead of having the user click the edit button
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.
Frank Kurka Guest
-
How to load datagrid in edit mode?
Hi, Is there any way I can load a datagrid in edit mode (example : 2nd row should be in edit mode whe the page loads for the first time) when a... -
Edit button not converting to edit mode
Okay, scratch my last post. I just tried it again and it didn't seem to do it again. Now I am begining to think it has something to do with the... -
Edit button not converting to edit mode
I am running into this issue. I am still trying to pinpoint what is causing it but am having a hard time. -
Edit button not converting to edit mode
Hi I have the same problem. I cannot find any anwsers to this yet. MM is silent - which is not good. M -
DataGrid contains no data after postback of edit button click...
This is specifically what is going on in my application:... -
Elton Wang #2
Would like to load a datagrid already in edit mode instead of having the user click the edit button
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
[email]elton_wang@hotmail.com[/email]
it puts the datagrid in edit mode.>-----Original Message-----
>Now my asp.net datagrid shows an edit button and clickingsome 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).>
>Thanks in advance.
>
>Elton Wang Guest
-
Frank Kurka #3
Re: Would like to load a datagrid already in edit mode instead of having the user click the edit button
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" <anonymous@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
> [email]elton_wang@hotmail.com[/email]
>
>> it puts the datagrid in edit mode.> >-----Original Message-----
> >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).> >
> >Thanks in advance.
> >
> >
Frank Kurka Guest
-
Elton Wang #4
Re: Would like to load a datagrid already in edit mode instead of having the user click the edit button
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
in a "normal state".>-----Original Message-----
>Well, there are 2 ideas here (both related to datagrid)
>
>1) when a datagrid is built and loaded .. it is alreadyclick to reload it>You can add template edit with a button that the user canclicks on it.>and rerender it in an edit state, but only after the user(like forms used>
>I would like the datagrid loaded already in an edit statethe page even loaded>to do) ..as if the user had clicked edit alredy, beforewithout having to>so the user can do ahead and edit whenhe firsty sees itedit (or update)>click the edit button first.
>
>2) For the second idea .. I am just trying to move theelse on the page ...>button outside the datagrid so it canappear somehweredatalists) where there is>
>This is really about single record datagrids (and(only one involved)>only one record involved ... no need for one per rowin message>
>Hope this is clearer .. hard to explain sometimes ...
>
>"Elton Wang" <anonymous@discussions.microsoft.com> wrotewhich>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 specifyclicking>> 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
>> [email]elton_wang@hotmail.com[/email]
>>
>>>> >-----Original Message-----
>> >Now my asp.net datagrid shows an edit button anddatagrid>> it puts the datagrid in edit mode.>> 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>>> have).>> >
>> >Thanks in advance.
>> >
>> >
>
>.
>Elton Wang Guest
-
Frank Kurka #5
Re: Would like to load a datagrid already in edit mode instead of having the user click the edit button
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" <anonymous@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
>
>> in a "normal state".> >-----Original Message-----
> >Well, there are 2 ideas here (both related to datagrid)
> >
> >1) when a datagrid is built and loaded .. it is already> click to reload it> >You can add template edit with a button that the user can> clicks on it.> >and rerender it in an edit state, but only after the user> (like forms used> >
> >I would like the datagrid loaded already in an edit state> the page even loaded> >to do) ..as if the user had clicked edit alredy, before> without having to> >so the user can do ahead and edit whenhe firsty sees it> edit (or update)> >click the edit button first.
> >
> >2) For the second idea .. I am just trying to move the> else on the page ...> >button outside the datagrid so it canappear somehwere> datalists) where there is> >
> >This is really about single record datagrids (and> (only one involved)> >only one record involved ... no need for one per row> in message> >
> >Hope this is clearer .. hard to explain sometimes ...
> >
> >"Elton Wang" <anonymous@discussions.microsoft.com> wrote> which> >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> clicking> >> 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
> >> [email]elton_wang@hotmail.com[/email]
> >>
> >>
> >> >-----Original Message-----
> >> >Now my asp.net datagrid shows an edit button and> datagrid> >> 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> >> >> have).
> >> >
> >> >Thanks in advance.
> >> >
> >> >
> >
> >.
> >
Frank Kurka Guest
-
Elton Wang #6
Re: Would like to load a datagrid already in edit mode instead of having the user click the edit button
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
row.>-----Original Message-----
>Nope .. that is not it ... Not multi row at all - singleis still within>
>In the case you are describing ....the drop down list boxsomewhere else on the>the geographic region of the datagrid.
>
>That means the buttons will be within the datagrid notelse on the page ->page.
>
>I want to put the update, edit, etc buttons somewhereevent parameters that>outside of the datagrid and its template area.
>
>The code for update, etc .. is looking for object anddatagrid, but are>are not available to buttons and links outside of theeffect "simulate" that>provided by buttons within the datagrid.
>
>The other case, is realted in that .. I want to inwhich i'm assuming>the edit button was pressed on the pages initial load ..datagrid and call>could be done if I can get the propre reference to thein message>some method to put it in the "edit sate"
>
>Is that any clearer?
>
>(Thanks for trying)
>
>
>"Elton Wang" <anonymous@discussions.microsoft.com> wrotecan>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
>>
>>>> in a "normal state".>> >-----Original Message-----
>> >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 useruser>> click to reload it>> >and rerender it in an edit state, but only after thestate>> clicks on it.>> >
>> >I would like the datagrid loaded already in an editwrote>> (like forms used>> the page even loaded>> >to do) ..as if the user had clicked edit alredy, before>> without having to>> >so the user can do ahead and edit whenhe firsty sees it>> edit (or update)>> >click the edit button first.
>> >
>> >2) For the second idea .. I am just trying to move the>> else on the page ...>> >button outside the datagrid so it canappear somehwere>> datalists) where there is>> >
>> >This is really about single record datagrids (and>> (only one involved)>> >only one record involved ... no need for one per row>> >
>> >Hope this is clearer .. hard to explain sometimes ...
>> >
>> >"Elton Wang" <anonymous@discussions.microsoft.com>specified>> 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 ainto>> which>> >> row (clicked) into edit state. So how do you specify>> >> row will be edited, especially you want to directly(implies>> clicking>> >> edit state from page load?
>> >>
>> >> Hope you can give more detailed info about your idea.
>> >>
>> >> Elton Wang
>> >> [email]elton_wang@hotmail.com[/email]
>> >>
>> >>
>> >> >-----Original Message-----
>> >> >Now my asp.net datagrid shows an edit button and>> >> it puts the datagrid in edit mode.
>> >> >
>> >> >I would like to:
>> >> >
>> >> >1) possilby load the page already in edit modeit in>> >> some kind of OnLoad command to the datagrid to putedit,>> >> edit mode before it is rendered and sent)
>> >> >
>> >> >and
>> >> >
>> >> >2) have a button outside the datagrid to initiatehave a>> >> update , etc. that does not require the button to>>> datagrid>> >> datagrid as the parent (as the buttons inside the>> >> have).
>> >> >
>> >> >Thanks in advance.
>> >> >
>> >> >
>> >
>> >
>> >.
>> >
>
>.
>Elton Wang Guest
-
Frank Kurka #7
Re: Would like to load a datagrid already in edit mode instead of having the user click the edit button
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.
"Elton Wang" <anonymous@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
>
>> row.> >-----Original Message-----
> >Nope .. that is not it ... Not multi row at all - single> is still within> >
> >In the case you are describing ....the drop down list box> somewhere else on the> >the geographic region of the datagrid.
> >
> >That means the buttons will be within the datagrid not> else on the page -> >page.
> >
> >I want to put the update, edit, etc buttons somewhere> event parameters that> >outside of the datagrid and its template area.
> >
> >The code for update, etc .. is looking for object and> datagrid, but are> >are not available to buttons and links outside of the> effect "simulate" that> >provided by buttons within the datagrid.
> >
> >The other case, is realted in that .. I want to in> which i'm assuming> >the edit button was pressed on the pages initial load ..> datagrid and call> >could be done if I can get the propre reference to the> in message> >some method to put it in the "edit sate"
> >
> >Is that any clearer?
> >
> >(Thanks for trying)
> >
> >
> >"Elton Wang" <anonymous@discussions.microsoft.com> wrote> can> >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> user> >> click to reload it
> >> >and rerender it in an edit state, but only after the> state> >> clicks on it.
> >> >
> >> >I would like the datagrid loaded already in an edit> wrote> >> (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" <anonymous@discussions.microsoft.com>> specified> >> 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> into> >> >> row (clicked) into edit state. So how do you specify
> >> which
> >> >> row will be edited, especially you want to directly> (implies> >> >> edit state from page load?
> >> >>
> >> >> Hope you can give more detailed info about your idea.
> >> >>
> >> >> Elton Wang
> >> >> [email]elton_wang@hotmail.com[/email]
> >> >>
> >> >>
> >> >> >-----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> it in> >> >> some kind of OnLoad command to the datagrid to put> edit,> >> >> edit mode before it is rendered and sent)
> >> >> >
> >> >> >and
> >> >> >
> >> >> >2) have a button outside the datagrid to initiate> have a> >> >> update , etc. that does not require the button to> >> >> >> datagrid as the parent (as the buttons inside the
> >> datagrid
> >> >> have).
> >> >> >
> >> >> >Thanks in advance.
> >> >> >
> >> >> >
> >> >
> >> >
> >> >.
> >> >
> >
> >.
> >
Frank Kurka Guest
-
Ian #8
Re: Would like to load a datagrid already in edit mode instead of having the user click the edit button
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
Ian Guest
-
Matt #9
Re: Would like to load a datagrid already in edit mode instead of having the user click the edit button
"Frank Kurka" <fkxws@fkx.com> wrote in message
news:ee1HB4hNFHA.3928@TK2MSFTNGP09.phx.gbl...[trim]> 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.
Matt Guest



Reply With Quote

