Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > set selected index of gridview on load

Reply
Thread Tools

set selected index of gridview on load

 
 
WebBuilder451
Guest
Posts: n/a
 
      05-02-2008
I have the datakey for the gridview passed to the page using cross postback.
How can i set the selected index of the page using this value, but only on
load where a previous page (cross post back) exists?
--
(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)

kes
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      05-03-2008
Hi,

you can check for cross-page postback on the target page by checking
PreviousPage property for null reference. I've blogged about that at:
http://aspadvice.com/blogs/joteke/ar...ePostBack.aspx

So basically in Page_Load of your target page, check with previous technique
if you're in cross-page post and if you are then just set the property .

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"WebBuilder451" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have the datakey for the gridview passed to the page using cross
>postback.
> How can i set the selected index of the page using this value, but only
> on
> load where a previous page (cross post back) exists?
> --
> (i''ll be asking a lot of these, but I find C# totally way cooler than vb
> and there''s no go''n back!!!)
> thanks (as always)
>
> kes



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
need help to fill textboxes from a selected item in datagrid-selected index changed. mldardy ASP .Net 0 09-28-2010 02:59 PM
Calling Javascript function on Gridview selected index change Sobin Thomas ASP .Net 1 08-12-2008 09:58 AM
sorting index-15, index-9, index-110 "the human way"? Tomasz Chmielewski Perl Misc 4 03-04-2008 05:01 PM
Help needed with getting selected-column-index of GridView VisualStudio2005VBASPX Software 0 09-26-2007 07:04 AM
GridView Selected Index! Child X ASP .Net 0 10-28-2006 06:13 PM



Advertisments