Click here to Skip to main content
15,900,646 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionPaging in a grid view troubles Pin
Senseicads2-May-07 2:27
Senseicads2-May-07 2:27 
AnswerRe: Paging in a grid view troubles Pin
kubben2-May-07 2:56
kubben2-May-07 2:56 
GeneralRe: Paging in a grid view troubles Pin
Senseicads2-May-07 3:18
Senseicads2-May-07 3:18 
QuestionAccess denied...... Pin
NetBot2-May-07 2:19
NetBot2-May-07 2:19 
AnswerRe: Access denied...... Pin
Christian Graus2-May-07 2:34
protectorChristian Graus2-May-07 2:34 
GeneralRe: Access denied...... Pin
NetBot2-May-07 2:54
NetBot2-May-07 2:54 
GeneralRe: Access denied...... Pin
Christian Graus2-May-07 10:29
protectorChristian Graus2-May-07 10:29 
QuestionGridview checkbox problems Pin
pauliehaha2-May-07 1:21
pauliehaha2-May-07 1:21 
Hi,

I have a gridview with a few bound fields and 2 checkboxes in template fields.

I have some filter fields which go in a placeholder on the page e.g. Disabled and Deleted checkboxes

When the user initially enters the stored procedure executes and returns the complete list.

When a user checks disabled in the filter and hits submit the page reloads executes the stored procedure and returns the items that are disabled.

My binding code is as follows:

<br />
    daUserList.Fill(dtUserList)<br />
    gvUserList.DataSource = dtUserList<br />
    gvUserList.DataBind()<br />
<br />
Protected Sub gvUserList_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvUserList.RowDataBound<br />
<br />
        Dim chkDisabled As CheckBox = CType(e.Row.FindControl("disabled"), CheckBox)<br />
        Dim chkDeleted As CheckBox = CType(e.Row.FindControl("deleted"), CheckBox)<br />
<br />
        Dim dataRow As DataRowView = e.Row.DataItem<br />
<br />
        If dataRow IsNot Nothing Then<br />
            chkDisabled.Checked = dataRow.Item("disabled")<br />
            chkDeleted.Checked = dataRow.Item("deleted")<br />
        End If<br />
<br />
    End Sub<br />



Now when the page first loads the checkboxes are populated correctly but when I submit filter options the page reloads with the new results but with checkbox values appearing as they did in the previous view.

I've set EnableViewState="false" on the form, the gridview and the checkboxes but no joy.

Also when I debug the checkboxes are being set correctly so it must be something that is happening after the RowDataBound event that is resetting the new checkboxes with values from the checkboxes in the previous full list.

This is so frustrating, it's the last issue in my project, I've already spent a day on it and it's starting to make my project overrun!

Please, can anyone shed any light on what is happening before I start going grey?

Many Thanks,

Paul

The Website Shop
AnswerRe: Gridview checkbox problems Pin
Senseicads2-May-07 2:37
Senseicads2-May-07 2:37 
GeneralRe: Gridview checkbox problems Pin
pauliehaha2-May-07 3:22
pauliehaha2-May-07 3:22 
AnswerRe: Gridview checkbox problems Pin
RSArockiam2-May-07 3:17
RSArockiam2-May-07 3:17 
GeneralRe: Gridview checkbox problems Pin
pauliehaha2-May-07 3:27
pauliehaha2-May-07 3:27 
Questionhow to show cursor on selected row of a grid in postback [modified] Pin
Sachin M Narangale2-May-07 1:10
Sachin M Narangale2-May-07 1:10 
AnswerRe: how to show cursor on selected row of a grid in postback Pin
N a v a n e e t h2-May-07 3:32
N a v a n e e t h2-May-07 3:32 
QuestionSession value is Reset in IE 7 Pin
Blumen2-May-07 0:23
Blumen2-May-07 0:23 
AnswerRe: Session value is Reset in IE 7 Pin
Guffa2-May-07 1:13
Guffa2-May-07 1:13 
QuestionRe: Session value is Reset in IE 7 Pin
Blumen2-May-07 1:56
Blumen2-May-07 1:56 
AnswerRe: Session value is Reset in IE 7 Pin
Psycho-*Coder*-Extreme2-May-07 2:10
Psycho-*Coder*-Extreme2-May-07 2:10 
GeneralRe: Session value is Reset in IE 7 Pin
Blumen2-May-07 2:33
Blumen2-May-07 2:33 
GeneralRe: Session value is Reset in IE 7 Pin
Colin Angus Mackay2-May-07 2:38
Colin Angus Mackay2-May-07 2:38 
GeneralRe: Session value is Reset in IE 7 Pin
Psycho-*Coder*-Extreme2-May-07 4:17
Psycho-*Coder*-Extreme2-May-07 4:17 
Questionwant to show usercontrol at the bottom of the page Pin
anujose2-May-07 0:02
anujose2-May-07 0:02 
AnswerRe: want to show usercontrol at the bottom of the page Pin
Sandeep Akhare2-May-07 0:15
Sandeep Akhare2-May-07 0:15 
AnswerRe: want to show usercontrol at the bottom of the page Pin
Sandeep Kumar2-May-07 0:20
Sandeep Kumar2-May-07 0:20 
AnswerRe: want to show usercontrol at the bottom of the page Pin
N a v a n e e t h2-May-07 3:36
N a v a n e e t h2-May-07 3:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.