ASP.NET's new ListView Control: Custom Grouping?

  • Thread starter Thread starter benji
  • Start date Start date
B

benji

Hi,

I'm investigating the new listview control. The grouping functionality is
very cool, but I don't want to simply group every x elements; i'd like to do
custom grouping (I want to say, start a new group if this record contains a
new value for field y as compared to the previous record). What I envision is
handling an event and issuing a command to the control after doing my own
check, saying "ok, start a new group." Is this possible? If not by handling
an event, perhaps via a derrived control? Any thoughts?

Best

-Ben
 
Ben,

Unfortunately, no, it doesn't seem like there is a way to do this.
Which is a shame, really, as I would think it would have been easy to expose
an interface which would be queried as to when a group changes.
 
Hi Nicholas,

Thanks for the reply. That is disapointing. I'd imagine that the code for
the control has something like:

if (currentrow % GroupItemCount == 0)
MarkNewGroup();

I hope someone is able to write a derrived class that modifies this. I tried
to open the assembly system.web.extensions.dll in ildasm but was having
difficulty opening GAC assemblies in the tool.

Thanks for the prompt answer, Nicholas.

-Ben


Nicholas Paldino said:
Ben,

Unfortunately, no, it doesn't seem like there is a way to do this.
Which is a shame, really, as I would think it would have been easy to expose
an interface which would be queried as to when a group changes.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

benji said:
Hi,

I'm investigating the new listview control. The grouping functionality is
very cool, but I don't want to simply group every x elements; i'd like to
do
custom grouping (I want to say, start a new group if this record contains
a
new value for field y as compared to the previous record). What I envision
is
handling an event and issuing a command to the control after doing my own
check, saying "ok, start a new group." Is this possible? If not by
handling
an event, perhaps via a derrived control? Any thoughts?

Best

-Ben
 
Back
Top