H
Henri
Hi,
I'm designing a control that inherits ListControl
I was surprised to see that SelectedIndexChanged is part of ListControl. So
why doesn't it implement IPostBackDataHandler?
I added this to my control:
Function LoadPostData(postDataKey As String, postCollection As
NameValueCollection) As Boolean Implements IPostBackDataHandler.LoadPostData
Dim changed As Boolean
For i As Integer = 0 To Items.Count - 1
Dim item As ListItem = Items(i)
Dim selected As Boolean
selected = Not postCollection(UniqueID & "_" & item.Value) Is
Nothing
If selected <> item.Selected Then
changed = True
End If
item.Selected = selected
Next
Return changed
End Function
but now I can't raise any SelectedIndexChanged from
RaisePostDataChangedEvent() as this event belongs to the base class
ListControl and I get a compile error if I try to.
I really don't understand the logic of ListControl: must I check if values
have changed between posts myself or does ListControl do it by itself? So if
ListControl do it itself, what is a class that inherits ListControl supposed
to do when implementing IPostBackDataHandler?
Can you help me?
Thanks
Henri
I'm designing a control that inherits ListControl
I was surprised to see that SelectedIndexChanged is part of ListControl. So
why doesn't it implement IPostBackDataHandler?
I added this to my control:
Function LoadPostData(postDataKey As String, postCollection As
NameValueCollection) As Boolean Implements IPostBackDataHandler.LoadPostData
Dim changed As Boolean
For i As Integer = 0 To Items.Count - 1
Dim item As ListItem = Items(i)
Dim selected As Boolean
selected = Not postCollection(UniqueID & "_" & item.Value) Is
Nothing
If selected <> item.Selected Then
changed = True
End If
item.Selected = selected
Next
Return changed
End Function
but now I can't raise any SelectedIndexChanged from
RaisePostDataChangedEvent() as this event belongs to the base class
ListControl and I get a compile error if I try to.
I really don't understand the logic of ListControl: must I check if values
have changed between posts myself or does ListControl do it by itself? So if
ListControl do it itself, what is a class that inherits ListControl supposed
to do when implementing IPostBackDataHandler?
Can you help me?
Thanks
Henri