This is a migrated thread and some comments may be shown as answers.

Preserving selected row status after postback

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Megan
Top achievements
Rank 1
Megan asked on 04 Jul 2008, 09:45 AM

When a user selects a row on my grid and clicks the button, it is meant to update the value of one of the columns by inserting a string to the database based on the selection.

However, the button causes a postback so the state of the grid's selected row value is lost.

My parameter comes back with an out of bounds error despite the grid looking checked on the running form:

ClientId.Value = grdClient.SelectedItems(0).OwnerTableView.DataKeyValues(grdClient.SelectedItems(0).ItemIndex)("iClientId")

How can I preserve the selected state of the grid so the client id selected value can be passed to the parameter after the button's postback? 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Jul 2008, 06:01 AM
Hi Megan,

Go through the following help document link.
Persisting the selected rows on sorting/paging/filtering/grouping

Shinu.
Tags
Grid
Asked by
Megan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or