PC Review


Reply
Thread Tools Rate Thread

copy a datagrid cell to another

 
 
=?Utf-8?B?THluZXJz?=
Guest
Posts: n/a
 
      5th Aug 2005
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      5th Aug 2005
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

 
Reply With Quote
 
Lucas Tam
Guest
Posts: n/a
 
      5th Aug 2005
=?Utf-8?B?THluZXJz?= <(E-Mail Removed)> wrote in
news:EB373241-8EE2-48BC-AD07-(E-Mail Removed):

> . 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 ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
=?Utf-8?B?THluZXJz?=
Guest
Posts: n/a
 
      9th Aug 2005
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

 
Reply With Quote
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      9th Aug 2005

"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/de...bjects/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

 
Reply With Quote
 
=?Utf-8?B?THluZXJz?=
Guest
Posts: n/a
 
      9th Aug 2005
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/de...bjects/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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid: Showing and Hiding and image in a datagrid cell. Linda Mason Microsoft C# .NET 0 24th Mar 2004 10:19 PM
DataGrid Cell: Custom Font/Backcolor/Format cell by cell (VB.NET) DraguVaso Microsoft ADO .NET 7 28th Jan 2004 09:04 PM
DataGrid Cell: Custom Font/Backcolor/Format cell by cell (VB.NET) DraguVaso Microsoft Dot NET Framework Forms 5 7th Jan 2004 09:09 PM
DataGrid Cell: Custom Font/Backcolor/Format cell by cell (VB.NET) DraguVaso Microsoft VB .NET 2 19th Dec 2003 10:03 PM
Links in web datagrid - letting a user click on a datagrid cell VM Microsoft C# .NET 1 18th Aug 2003 02:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:09 AM.