I have a ListBox control in my ASP.NET page. After I binding data to this
control, I would like to be able to change this display order of items in
this control. Just like change layout function of my.yahoo.com.
I tried client side approach, yes I can change display order by JavaScript,
but after clicking one of the button the display order will reverse back to
its original status. Because after PostBack, the page will try to render
this control by viewstate again.
I tried server side approach, but looks there is no way to switch two
ListItems programmatically.
Is there anybody who has some good idea?
Thanks!
--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours HardyI already solved this problem.
"Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
news:upQn0K$KEHA.628@.TK2MSFTNGP11.phx.gbl...
> Hi
> I have a ListBox control in my ASP.NET page. After I binding data to this
> control, I would like to be able to change this display order of items in
> this control. Just like change layout function of my.yahoo.com.
> I tried client side approach, yes I can change display order by
JavaScript,
> but after clicking one of the button the display order will reverse back
to
> its original status. Because after PostBack, the page will try to render
> this control by viewstate again.
> I tried server side approach, but looks there is no way to switch two
> ListItems programmatically.
>
> Is there anybody who has some good idea?
> Thanks!
> --
>
> WWW: http://hardywang.1accesshost.com
> ICQ: 3359839
> yours Hardy
How?
--
Joe Fallon
"Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
news:O7ZTxp$KEHA.2244@.tk2msftngp13.phx.gbl...
> I already solved this problem.
>
> "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> news:upQn0K$KEHA.628@.TK2MSFTNGP11.phx.gbl...
> > Hi
> > I have a ListBox control in my ASP.NET page. After I binding data to
this
> > control, I would like to be able to change this display order of items
in
> > this control. Just like change layout function of my.yahoo.com.
> > I tried client side approach, yes I can change display order by
> JavaScript,
> > but after clicking one of the button the display order will reverse back
> to
> > its original status. Because after PostBack, the page will try to render
> > this control by viewstate again.
> > I tried server side approach, but looks there is no way to switch two
> > ListItems programmatically.
> > Is there anybody who has some good idea?
> > Thanks!
> > --
> > WWW: http://hardywang.1accesshost.com
> > ICQ: 3359839
> > yours Hardy
Dump content of listbox to array, sort array in memory, then clear this
listbox and add listitem from array one by one.
--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
"Joe Fallon" <jfallon1@.nospamtwcny.rr.com> wrote in message
news:%23nd3uPALEHA.3052@.TK2MSFTNGP12.phx.gbl...
> How?
> --
> Joe Fallon
>
> "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> news:O7ZTxp$KEHA.2244@.tk2msftngp13.phx.gbl...
> > I already solved this problem.
> > "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> > news:upQn0K$KEHA.628@.TK2MSFTNGP11.phx.gbl...
> > > Hi
> > > I have a ListBox control in my ASP.NET page. After I binding data to
> this
> > > control, I would like to be able to change this display order of items
> in
> > > this control. Just like change layout function of my.yahoo.com.
> > > I tried client side approach, yes I can change display order by
> > JavaScript,
> > > but after clicking one of the button the display order will reverse
back
> > to
> > > its original status. Because after PostBack, the page will try to
render
> > > this control by viewstate again.
> > > > I tried server side approach, but looks there is no way to switch two
> > > ListItems programmatically.
> > > > > Is there anybody who has some good idea?
> > > > Thanks!
> > > > --
> > > > > > WWW: http://hardywang.1accesshost.com
> > > ICQ: 3359839
> > > yours Hardy
> >
Yep.
That is what my listbox sort routine does.
Just wondering if you came up with something different.
--
Joe Fallon
"Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
news:uVlWuSFLEHA.3808@.TK2MSFTNGP12.phx.gbl...
> Dump content of listbox to array, sort array in memory, then clear this
> listbox and add listitem from array one by one.
> --
> WWW: http://hardywang.1accesshost.com
> ICQ: 3359839
> yours Hardy
> "Joe Fallon" <jfallon1@.nospamtwcny.rr.com> wrote in message
> news:%23nd3uPALEHA.3052@.TK2MSFTNGP12.phx.gbl...
> > How?
> > --
> > Joe Fallon
> > "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> > news:O7ZTxp$KEHA.2244@.tk2msftngp13.phx.gbl...
> > > I already solved this problem.
> > > > > "Hardy Wang" <hardy_wang@.marketrend.com> wrote in message
> > > news:upQn0K$KEHA.628@.TK2MSFTNGP11.phx.gbl...
> > > > Hi
> > > > I have a ListBox control in my ASP.NET page. After I binding data to
> > this
> > > > control, I would like to be able to change this display order of
items
> > in
> > > > this control. Just like change layout function of my.yahoo.com.
> > > > I tried client side approach, yes I can change display order by
> > > JavaScript,
> > > > but after clicking one of the button the display order will reverse
> back
> > > to
> > > > its original status. Because after PostBack, the page will try to
> render
> > > > this control by viewstate again.
> > > > > > I tried server side approach, but looks there is no way to switch
two
> > > > ListItems programmatically.
> > > > > > > > Is there anybody who has some good idea?
> > > > > > Thanks!
> > > > > > --
> > > > > > > > > > WWW: http://hardywang.1accesshost.com
> > > > ICQ: 3359839
> > > > yours Hardy
> > > > > >
0 comments:
Post a Comment