Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Fri, 3 Jul 2009 14:05:47 -0400,    group: microsoft.public.dotnet.framework.aspnet        back       


Accessing GridViewRow.DataItem outside of GridView databinding events   
How do you access GridViewRow.DataItem without having to get to it inside 
GridView events? I have a particular thing I am trying to do and forcing it 
to be done inside gridviews events wont work.
date: Fri, 3 Jul 2009 14:05:47 -0400   author:   Andy B.

Re: Accessing GridViewRow.DataItem outside of GridView databinding events   
use the GridView.DataSource, this is how it accesses it.


-- bruce (sqlwork.com)

Andy B. wrote:
> How do you access GridViewRow.DataItem without having to get to it inside 
> GridView events? I have a particular thing I am trying to do and forcing it 
> to be done inside gridviews events wont work. 
> 
>
date: Fri, 03 Jul 2009 13:56:48 -0700   author:   bruce barker

Re: Accessing GridViewRow.DataItem outside of GridView databinding events   
Can you give me a simple example? This is what I have going on. There is a 
Wizard on a WebUser control. It has a GridView on step 1 that uses a List(Of 
HeadlinesInfo) as its DataSource. The object HeadlinesInfo is a custom 
business object. In the GridView, I have a column of CheckBoxes for 
selecting the GridView rows. When I press next button, I want to loop 
through the rows and put the datasource objects related to the checked 
GridViewRows in another List(Of HeadlinesInfo) list. Would there be any way 
of doing something like this? I have tried just about all day and can't 
figure it out yet. Thanks for the help.
"bruce barker"  wrote in message 
news:eUyNJDC$JHA.1608@TK2MSFTNGP02.phx.gbl...
> use the GridView.DataSource, this is how it accesses it.
>
>
> -- bruce (sqlwork.com)
>
> Andy B. wrote:
>> How do you access GridViewRow.DataItem without having to get to it inside 
>> GridView events? I have a particular thing I am trying to do and forcing 
>> it to be done inside gridviews events wont work.
date: Fri, 3 Jul 2009 17:38:53 -0400   author:   Andy B.

Re: Accessing GridViewRow.DataItem outside of GridView databinding events   
I think this article contains enough information to show you process
the rows with the checked boxes:

http://www.4guysfromrolla.com/articles/053106-1.aspx

I used this article to help me work out how to do exactly the sort of
thing you are trying to do in the app my team develops.

Cheers,
Mark

On Fri, 3 Jul 2009 17:38:53 -0400, "Andy B." 
wrote:

>
>Can you give me a simple example? This is what I have going on. There is a 
>Wizard on a WebUser control. It has a GridView on step 1 that uses a List(Of 
>HeadlinesInfo) as its DataSource. The object HeadlinesInfo is a custom 
>business object. In the GridView, I have a column of CheckBoxes for 
>selecting the GridView rows. When I press next button, I want to loop 
>through the rows and put the datasource objects related to the checked 
>GridViewRows in another List(Of HeadlinesInfo) list. Would there be any way 
>of doing something like this? I have tried just about all day and can't 
>figure it out yet. Thanks for the help.
>"bruce barker"  wrote in message 
>news:eUyNJDC$JHA.1608@TK2MSFTNGP02.phx.gbl...
>> use the GridView.DataSource, this is how it accesses it.
>>
>>
>> -- bruce (sqlwork.com)
>>
>> Andy B. wrote:
>>> How do you access GridViewRow.DataItem without having to get to it inside 
>>> GridView events? I have a particular thing I am trying to do and forcing 
>>> it to be done inside gridviews events wont work. 
>
-- 
       |\      _,,,---,,_          A picture used to be worth a
ZZZzzz /,`.-'`'    -.  ;-;;,       thousand words - then along
      |,4-  ) )-,_. ,\ (  `'-'     came television!
     '---''(_/--'  `-'\_)          

Mark Stevens  (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
date: Sat, 04 Jul 2009 07:38:00 +0100   author:   Mark Stevens am

Re: Accessing GridViewRow.DataItem outside of GridView databinding events   
I can do the checkboxes without a problem. It's the  accessing the 
Row.DataItem or DataSource data related to the checked boxes that I have 
problems with.
"Mark Stevens" <nevyn@nospam.nospam> wrote in message 
news:pstt45dm4e4nb9fq577qlbv6dibatg0ttf@4ax.com...
>I think this article contains enough information to show you process
> the rows with the checked boxes:
>
> http://www.4guysfromrolla.com/articles/053106-1.aspx
>
> I used this article to help me work out how to do exactly the sort of
> thing you are trying to do in the app my team develops.
>
> Cheers,
> Mark
>
> On Fri, 3 Jul 2009 17:38:53 -0400, "Andy B." 
> wrote:
>
>>
>>Can you give me a simple example? This is what I have going on. There is a
>>Wizard on a WebUser control. It has a GridView on step 1 that uses a 
>>List(Of
>>HeadlinesInfo) as its DataSource. The object HeadlinesInfo is a custom
>>business object. In the GridView, I have a column of CheckBoxes for
>>selecting the GridView rows. When I press next button, I want to loop
>>through the rows and put the datasource objects related to the checked
>>GridViewRows in another List(Of HeadlinesInfo) list. Would there be any 
>>way
>>of doing something like this? I have tried just about all day and can't
>>figure it out yet. Thanks for the help.
>>"bruce barker"  wrote in message
>>news:eUyNJDC$JHA.1608@TK2MSFTNGP02.phx.gbl...
>>> use the GridView.DataSource, this is how it accesses it.
>>>
>>>
>>> -- bruce (sqlwork.com)
>>>
>>> Andy B. wrote:
>>>> How do you access GridViewRow.DataItem without having to get to it 
>>>> inside
>>>> GridView events? I have a particular thing I am trying to do and 
>>>> forcing
>>>> it to be done inside gridviews events wont work.
>>
> -- 
>       |\      _,,,---,,_          A picture used to be worth a
> ZZZzzz /,`.-'`'    -.  ;-;;,       thousand words - then along
>      |,4-  ) )-,_. ,\ (  `'-'     came television!
>     '---''(_/--'  `-'\_)
>
> Mark Stevens  (mark at thepcsite fullstop co fullstop uk)
>
> This message is provided "as is".
date: Sat, 4 Jul 2009 08:24:38 -0400   author:   Andy B.

Re: Accessing GridViewRow.DataItem outside of GridView databinding events   
Do you mean something like the following:

foreach (GridViewRow row in gridView)
{
	CheckBox cd;

	cb = (CheckBox) row.FindControl("CheckBoxName");
	if ((cb != null) && cb.Checked)
	{
		int id;
	
		id = row.Cells[0].Text;
	}
}

This assumes that the id field is in column 0 and that the column has
been made visible.

Cheers,
Mark


On Sat, 4 Jul 2009 08:24:38 -0400, "Andy B." 
wrote:

>I can do the checkboxes without a problem. It's the  accessing the 
>Row.DataItem or DataSource data related to the checked boxes that I have 
>problems with.
>"Mark Stevens" <nevyn@nospam.nospam> wrote in message 
>news:pstt45dm4e4nb9fq577qlbv6dibatg0ttf@4ax.com...
>>I think this article contains enough information to show you process
>> the rows with the checked boxes:
>>
>> http://www.4guysfromrolla.com/articles/053106-1.aspx
>>
>> I used this article to help me work out how to do exactly the sort of
>> thing you are trying to do in the app my team develops.
>>
>> Cheers,
>> Mark
>>
>> On Fri, 3 Jul 2009 17:38:53 -0400, "Andy B." 
>> wrote:
>>
>>>
>>>Can you give me a simple example? This is what I have going on. There is a
>>>Wizard on a WebUser control. It has a GridView on step 1 that uses a 
>>>List(Of
>>>HeadlinesInfo) as its DataSource. The object HeadlinesInfo is a custom
>>>business object. In the GridView, I have a column of CheckBoxes for
>>>selecting the GridView rows. When I press next button, I want to loop
>>>through the rows and put the datasource objects related to the checked
>>>GridViewRows in another List(Of HeadlinesInfo) list. Would there be any 
>>>way
>>>of doing something like this? I have tried just about all day and can't
>>>figure it out yet. Thanks for the help.
>>>"bruce barker"  wrote in message
>>>news:eUyNJDC$JHA.1608@TK2MSFTNGP02.phx.gbl...
>>>> use the GridView.DataSource, this is how it accesses it.
>>>>
>>>>
>>>> -- bruce (sqlwork.com)
>>>>
>>>> Andy B. wrote:
>>>>> How do you access GridViewRow.DataItem without having to get to it 
>>>>> inside
>>>>> GridView events? I have a particular thing I am trying to do and 
>>>>> forcing
>>>>> it to be done inside gridviews events wont work.
>>>
>> -- 
>>       |\      _,,,---,,_          A picture used to be worth a
>> ZZZzzz /,`.-'`'    -.  ;-;;,       thousand words - then along
>>      |,4-  ) )-,_. ,\ (  `'-'     came television!
>>     '---''(_/--'  `-'\_)
>>
>> Mark Stevens  (mark at thepcsite fullstop co fullstop uk)
>>
>> This message is provided "as is". 
>
-- 
       |\      _,,,---,,_          A picture used to be worth a
ZZZzzz /,`.-'`'    -.  ;-;;,       thousand words - then along
      |,4-  ) )-,_. ,\ (  `'-'     came television!
     '---''(_/--'  `-'\_)          

Mark Stevens  (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".
date: Sat, 04 Jul 2009 13:50:17 +0100   author:   Mark Stevens am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us