Click here to Skip to main content
15,919,931 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: imp Pin
Guffa7-Nov-07 0:08
Guffa7-Nov-07 0:08 
GeneralRe: imp Pin
niki_nilu7-Nov-07 0:38
niki_nilu7-Nov-07 0:38 
AnswerRe: imp Pin
Guffa7-Nov-07 2:06
Guffa7-Nov-07 2:06 
QuestionGo to Top of the Page? Pin
Kasi Viswanathan6-Nov-07 23:43
Kasi Viswanathan6-Nov-07 23:43 
AnswerRe: Go to Top of the Page? Pin
N a v a n e e t h6-Nov-07 23:47
N a v a n e e t h6-Nov-07 23:47 
QuestionDropdown list selected index changed event problem Pin
Thanigaimani836-Nov-07 23:05
Thanigaimani836-Nov-07 23:05 
QuestionRe: Dropdown list selected index changed event problem Pin
Imran Khan Pathan7-Nov-07 0:34
Imran Khan Pathan7-Nov-07 0:34 
AnswerRe: Dropdown list selected index changed event problem Pin
Thanigaimani837-Nov-07 2:24
Thanigaimani837-Nov-07 2:24 
Hi
i checked checkbox values of dropdown list selected index changed event,values are coming from viewstate,so we want viewstate values add plus new checked checkbox values ,but if i click display button control that viewstate values are removing then new checked checkbox values are only diaplay .

see my code behind..

i can bold where i used viewstate and i can underlined the code of viewstate values are removing( i mean previous page checked checkbox values).

<br />
<br />
<br />
Protected Sub gridview1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gridview1.PageIndexChanging <br />
<br />
gridview1.PageIndex = e.NewPageIndex<br />
<br />
getselected()<br />
<br />
databind1("First_name", "asc") <br />
<br />
setSelected()<br />
<br />
<br />
End Sub<br />
<br />
------------------<br />
<br />
Public Sub getselected() <br />
<br />
 <br />
<br />
Dim arrayListContactGroup As New ArrayList <br />
 <br />
<br />
 If ViewState("ArrayList") IsNot Nothing Then<br />
<br />
arrayListContactGroup = CType(ViewState("ArrayList"), ArrayList) <br />
<br />
ViewState.Remove("ArrayList") <br />
<br />
 <br />
<br />
End If<br />
<br />
For Each row As GridViewRow In gridview1.Rows <br />
<br />
 <br />
<br />
Dim chkselectcontacts As CheckBox = CType(row.FindControl("chksel"), CheckBox)Dim arraylistlabel As Label = CType(row.FindControl("contid"), Label) <br />
<br />
 <br />
<br />
If chkselectcontacts.Checked Then <br />
<br />
 <br />
<br />
If Not arrayListContactGroup.Contains(arraylistlabel.Text) Then <br />
<br />
arrayListContactGroup.Add(arraylistlabel.Text)<br />
<br />
 <br />
<br />
End If <br />
<br />
 <br />
<br />
Else <br />
<br />
 <br />
<br />
If arrayListContactGroup.Contains(arraylistlabel.Text) Then <br />
<br />
arrayListContactGroup.Remove(arraylistlabel.Text)<br />
 <br />
<br />
End If <br />
<br />
 <br />
<br />
End If <br />
<br />
 <br />
<br />
Next <br />
<br />
ViewState("ArrayList") = arrayListContactGroup <br />
<br />
-------------------<br />
<br />
Public Sub setSelected() <br />
<br />
 <br />
<br />
Dim arrayListContactGroup As New ArrayList <br />
<br />
 <br />
<br />
If ViewState("ArrayList") IsNot Nothing Then<br />
<br />
arrayListContactGroup = CType(ViewState("ArrayList"), ArrayList) <br />
<br />
<br />
End If<br />
<br />
For Each row As GridViewRow In gridview1.Rows <br />
<br />
 <br />
<br />
Dim chkselectcontacts As CheckBox = CType(row.FindControl("chksel"), CheckBox)Dim arraylistlabel As Label = CType(row.FindControl("contid"), Label) <br />
<br />
 <br />
<br />
If arrayListContactGroup.Contains(arraylistlabel.Text) Then <br />
<br />
chkselectcontacts.Checked = True <br />
<br />
 <br />
<br />
Else <br />
<br />
chkselectcontacts.Checked = False <br />
<br />
 <br />
<br />
End If <br />
<br />
 <br />
<br />
Next <br />
<br />
 <br />
<br />
 End Sub <br />
<br />
-------------------------- <br />
 <br />
<br />
Protected Sub Selcon_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Selcon.SelectedIndexChanged <br />
<br />
getselected()<br />
<br />
databind1(ViewState("sort"), ViewState("ascdesc"))<br />
<br />
setSelected()<br />
<br />
 <br />
<br />
End Sub <br />
<br />
My problem is,arraylist values(checkbox values) stored in viewstate,viewstate get the values no problem,but whenever i go to dropdown list select index change at that time we want add viewstate values and  current checked checkbox values,but its doing opposite side operation i mean removing the view state value.see i can underlined that line.<br />
<br />
Plz urgent hepl me <br />
<br />
<div class="ForumSig">Thanigaimani.thirumalai</div>

QuestionRe: Dropdown list selected index changed event problem [modified] Pin
Thanigaimani837-Nov-07 5:07
Thanigaimani837-Nov-07 5:07 
QuestionVisual Studio .NET cannot open or create Pin
kuwl_mark6-Nov-07 23:02
kuwl_mark6-Nov-07 23:02 
AnswerRe: Visual Studio .NET cannot open or create Pin
Colin Angus Mackay6-Nov-07 23:17
Colin Angus Mackay6-Nov-07 23:17 
AnswerRe: Visual Studio .NET cannot open or create [modified] Pin
Sherin Iranimose6-Nov-07 23:18
Sherin Iranimose6-Nov-07 23:18 
QuestionPlease Help(Very Urgent) Pin
SreejithAchutan6-Nov-07 23:01
SreejithAchutan6-Nov-07 23:01 
AnswerRe: Please Help(Very Urgent) Pin
John-ph6-Nov-07 23:15
John-ph6-Nov-07 23:15 
AnswerRe: Please Help(Very Urgent) Pin
John-ph6-Nov-07 23:59
John-ph6-Nov-07 23:59 
QuestionHow to filter file's type in Openfile dialog? Pin
sakgumjorn6-Nov-07 23:01
sakgumjorn6-Nov-07 23:01 
AnswerRe: How to filter file's type in Openfile dialog? Pin
Michael Sync7-Nov-07 4:46
Michael Sync7-Nov-07 4:46 
GeneralRe: How to filter file's type in Openfile dialog? Pin
sakgumjorn7-Nov-07 14:44
sakgumjorn7-Nov-07 14:44 
Questionhyperlink control utility [modified] Pin
Sonia Gupta6-Nov-07 22:23
Sonia Gupta6-Nov-07 22:23 
AnswerRe: hyperlink control utility Pin
Christian Graus6-Nov-07 22:33
protectorChristian Graus6-Nov-07 22:33 
GeneralRe: hyperlink control utility Pin
Sonia Gupta6-Nov-07 22:52
Sonia Gupta6-Nov-07 22:52 
AnswerRe: hyperlink control utility [modified] Pin
Nitin19816-Nov-07 22:35
Nitin19816-Nov-07 22:35 
AnswerRe: hyperlink control utility Pin
Imran Khan Pathan6-Nov-07 22:37
Imran Khan Pathan6-Nov-07 22:37 
Questionrepeating template? Pin
dyonsos6-Nov-07 22:21
dyonsos6-Nov-07 22:21 
GeneralExpand and Collapse Detail Editing Pin
Brady Kelly6-Nov-07 22:14
Brady Kelly6-Nov-07 22:14 

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.