copy a datagrid cell to another

Discussion in 'ASP .Net' started by =?Utf-8?B?THluZXJz?=, Aug 5, 2005.

  1. What I want to do, I have a datagrid with totals in one column and a text
    field in the next. What I would like to provide is a way for the user to
    click on an arrow under/next to the total amount that would then load into
    the text field. I know I could just use an edit button and have an event
    handle it, but that would take too much time with the posting and post back.
    I think what I want to do is write some kind of java script so that the copy
    is done on the client side. Does anybody have a suggestion for me, or an
    example how to do this?

    I am using ASP.NET with VB

    Thanks
    =?Utf-8?B?THluZXJz?=, Aug 5, 2005
    #1
    1. Advertising

  2. Add to the arrow an attribute onclick with a value containing the name of a
    Javascript function that traverses the browser DOM and copies the values from
    one control to the other.

    I modified my datagrid sample to do what you wanted and put the source code
    on my website at: http://www.societopia.net/samples/datagrid.aspx

    --
    Phillip Williams
    http://www.webswapp.com


    "Lyners" wrote:

    > What I want to do, I have a datagrid with totals in one column and a text
    > field in the next. What I would like to provide is a way for the user to
    > click on an arrow under/next to the total amount that would then load into
    > the text field. I know I could just use an edit button and have an event
    > handle it, but that would take too much time with the posting and post back.
    > I think what I want to do is write some kind of java script so that the copy
    > is done on the client side. Does anybody have a suggestion for me, or an
    > example how to do this?
    >
    > I am using ASP.NET with VB
    >
    > Thanks
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Aug 5, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?THluZXJz?=

    Lucas Tam Guest

    =?Utf-8?B?THluZXJz?= <> wrote in
    news::

    > . Does anybody have a suggestion for me, or an
    > example how to do this?
    >


    in Javascript, take a look at document.getElementById('ClientID').innerText
    (or innerHTML)

    And in ASP.NET take a look at the ClientID property.

    You can attach the Javascript during the datagrid's onItemDataBound event.

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Aug 5, 2005
    #3
  4. Thanks Phillip I got it to work. it was exacty what I was looking for. I did
    have something interesting happen though. I looked at your example and the
    title worked on your sample, then I tried to mimick the process in my page, i
    couldn't get the title on the image to work (mouse over and then a text box
    appears). So then I went back to your page to see what I was doing wrong, and
    the title stopped working in yours. is there a setting that I may have
    triggered with my development that told IE to not display titles?

    "Phillip Williams" wrote:

    > Add to the arrow an attribute onclick with a value containing the name of a
    > Javascript function that traverses the browser DOM and copies the values from
    > one control to the other.
    >
    > I modified my datagrid sample to do what you wanted and put the source code
    > on my website at: http://www.societopia.net/samples/datagrid.aspx
    >
    > --
    > Phillip Williams
    > http://www.webswapp.com
    >
    >
    > "Lyners" wrote:
    >
    > > What I want to do, I have a datagrid with totals in one column and a text
    > > field in the next. What I would like to provide is a way for the user to
    > > click on an arrow under/next to the total amount that would then load into
    > > the text field. I know I could just use an edit button and have an event
    > > handle it, but that would take too much time with the posting and post back.
    > > I think what I want to do is write some kind of java script so that the copy
    > > is done on the client side. Does anybody have a suggestion for me, or an
    > > example how to do this?
    > >
    > > I am using ASP.NET with VB
    > >
    > > Thanks
    =?Utf-8?B?THluZXJz?=, Aug 9, 2005
    #4
  5. "Lyners" wrote:

    > Thanks Phillip I got it to work. it was exacty what I was looking for. I did
    > have something interesting happen though. I looked at your example and the
    > title worked on your sample, then I tried to mimick the process in my page, i
    > couldn't get the title on the image to work (mouse over and then a text box
    > appears). So then I went back to your page to see what I was doing wrong, and
    > the title stopped working in yours. is there a setting that I may have
    > triggered with my development that told IE to not display titles?


    Hello Lyners,

    I am not aware of such a setting. The documentation for IE does not
    indicate a setting that might cause the title to not display:
    http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/img.asp

    I guess you can try placing an <img> tag with a title attribute in a simple
    HTML page and investigate further. It could be a simple typo somewhere in
    your aspx page that caused this. Let me know if you find something more to
    it than just a typo.

    --
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com




    >
    > "Phillip Williams" wrote:
    >
    > > Add to the arrow an attribute onclick with a value containing the name of a
    > > Javascript function that traverses the browser DOM and copies the values from
    > > one control to the other.
    > >
    > > I modified my datagrid sample to do what you wanted and put the source code
    > > on my website at: http://www.societopia.net/samples/datagrid.aspx
    > >
    > > --
    > > Phillip Williams
    > > http://www.webswapp.com
    > >
    > >
    > > "Lyners" wrote:
    > >
    > > > What I want to do, I have a datagrid with totals in one column and a text
    > > > field in the next. What I would like to provide is a way for the user to
    > > > click on an arrow under/next to the total amount that would then load into
    > > > the text field. I know I could just use an edit button and have an event
    > > > handle it, but that would take too much time with the posting and post back.
    > > > I think what I want to do is write some kind of java script so that the copy
    > > > is done on the client side. Does anybody have a suggestion for me, or an
    > > > example how to do this?
    > > >
    > > > I am using ASP.NET with VB
    > > >
    > > > Thanks
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Aug 9, 2005
    #5
  6. I checked out the MSDN page on title and the example that it has my PC
    doesn't allow me to see the title. I'll research what happened here.

    Thanks Phillip for your help.

    "Phillip Williams" wrote:

    >
    > "Lyners" wrote:
    >
    > > Thanks Phillip I got it to work. it was exacty what I was looking for. I did
    > > have something interesting happen though. I looked at your example and the
    > > title worked on your sample, then I tried to mimick the process in my page, i
    > > couldn't get the title on the image to work (mouse over and then a text box
    > > appears). So then I went back to your page to see what I was doing wrong, and
    > > the title stopped working in yours. is there a setting that I may have
    > > triggered with my development that told IE to not display titles?

    >
    > Hello Lyners,
    >
    > I am not aware of such a setting. The documentation for IE does not
    > indicate a setting that might cause the title to not display:
    > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/img.asp
    >
    > I guess you can try placing an <img> tag with a title attribute in a simple
    > HTML page and investigate further. It could be a simple typo somewhere in
    > your aspx page that caused this. Let me know if you find something more to
    > it than just a typo.
    >
    > --
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    >
    >
    > >
    > > "Phillip Williams" wrote:
    > >
    > > > Add to the arrow an attribute onclick with a value containing the name of a
    > > > Javascript function that traverses the browser DOM and copies the values from
    > > > one control to the other.
    > > >
    > > > I modified my datagrid sample to do what you wanted and put the source code
    > > > on my website at: http://www.societopia.net/samples/datagrid.aspx
    > > >
    > > > --
    > > > Phillip Williams
    > > > http://www.webswapp.com
    > > >
    > > >
    > > > "Lyners" wrote:
    > > >
    > > > > What I want to do, I have a datagrid with totals in one column and a text
    > > > > field in the next. What I would like to provide is a way for the user to
    > > > > click on an arrow under/next to the total amount that would then load into
    > > > > the text field. I know I could just use an edit button and have an event
    > > > > handle it, but that would take too much time with the posting and post back.
    > > > > I think what I want to do is write some kind of java script so that the copy
    > > > > is done on the client side. Does anybody have a suggestion for me, or an
    > > > > example how to do this?
    > > > >
    > > > > I am using ASP.NET with VB
    > > > >
    > > > > Thanks
    =?Utf-8?B?THluZXJz?=, Aug 9, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phillip Roncoroni
    Replies:
    14
    Views:
    1,089
    Toby A Inkster
    Apr 5, 2004
  2. Alex
    Replies:
    2
    Views:
    1,223
  3. Replies:
    26
    Views:
    2,113
    Roland Pibinger
    Sep 1, 2006
  4. Empire City
    Replies:
    3
    Views:
    407
    Empire City
    Apr 30, 2004
  5. Thomasa Gregg
    Replies:
    1
    Views:
    155
    Eliyahu Goldin
    Jun 9, 2004
Loading...

Share This Page