Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > datagrid won't sort

Reply
Thread Tools

datagrid won't sort

 
 
DC Gringo
Guest
Posts: n/a
 
      02-29-2004
I have a datagrid that won't sort. The event handler is firing and return
label text, just not the sort.

Here's my Sub Page_Load and Sub DataGrid1_SortCommand:

--------------------

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
SqlDataAdapter1.Fill(DsAdvanced1)

If Not IsPostBack Then
DataGrid1.DataBind()
Provinces.DataBind()
Districts.DataBind()
SubDistricts.DataBind()
Communities.DataBind()
End If

End Sub

--------------------


Public Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridSortCommandEvent Args) Handles
DataGrid1.SortCommand

lblWhatClicked.Text = "You clicked: " & e.SortExpression

Dim dv As New DataView(DsAdvanced1.Tables(0))
dv.Sort = e.SortExpression
DataGrid1.DataSource = dv
DataGrid1.DataBind()

End Sub

--
_____
DC G


 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      03-02-2004
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"DC Gringo" <(E-Mail Removed)> wrote in message
news:OaAMDdu$(E-Mail Removed)...
> I have a datagrid that won't sort. The event handler is firing and return
> label text, just not the sort.
>
> Here's my Sub Page_Load and Sub DataGrid1_SortCommand:
>
> --------------------
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> SqlDataAdapter1.Fill(DsAdvanced1)
>
> If Not IsPostBack Then
> DataGrid1.DataBind()
> Provinces.DataBind()
> Districts.DataBind()
> SubDistricts.DataBind()
> Communities.DataBind()
> End If
>
> End Sub
>
> --------------------
>
>
> Public Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As
> System.Web.UI.WebControls.DataGridSortCommandEvent Args) Handles
> DataGrid1.SortCommand
>
> lblWhatClicked.Text = "You clicked: " & e.SortExpression
>
> Dim dv As New DataView(DsAdvanced1.Tables(0))
> dv.Sort = e.SortExpression
> DataGrid1.DataSource = dv
> DataGrid1.DataBind()
>
> End Sub
>
> --
> _____
> DC G
>
>



 
Reply With Quote
 
 
 
 
DC Gringo
Guest
Posts: n/a
 
      03-02-2004
Sort of...thankfully I'm only in beta and I got it to work without using
code-behind...I must have issues relating to the sharing of variables
between the separate pages...



-____-
DG


"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:(E-Mail Removed)...
> Your post went unanswered. Have you resolved this issue?
>
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
> http://tinyurl.com/3he3b
> "DC Gringo" <(E-Mail Removed)> wrote in message
> news:OaAMDdu$(E-Mail Removed)...
> > I have a datagrid that won't sort. The event handler is firing and

return
> > label text, just not the sort.
> >
> > Here's my Sub Page_Load and Sub DataGrid1_SortCommand:
> >
> > --------------------
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > SqlDataAdapter1.Fill(DsAdvanced1)
> >
> > If Not IsPostBack Then
> > DataGrid1.DataBind()
> > Provinces.DataBind()
> > Districts.DataBind()
> > SubDistricts.DataBind()
> > Communities.DataBind()
> > End If
> >
> > End Sub
> >
> > --------------------
> >
> >
> > Public Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As
> > System.Web.UI.WebControls.DataGridSortCommandEvent Args) Handles
> > DataGrid1.SortCommand
> >
> > lblWhatClicked.Text = "You clicked: " & e.SortExpression
> >
> > Dim dv As New DataView(DsAdvanced1.Tables(0))
> > dv.Sort = e.SortExpression
> > DataGrid1.DataSource = dv
> > DataGrid1.DataBind()
> >
> > End Sub
> >
> > --
> > _____
> > DC G
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: When will Thunderbird support sort in place (in context sort)? Ron Natalie Firefox 0 02-02-2006 04:38 AM
The Colourised Bewitched -- sort of OK....... sort of! anthony DVD Video 26 06-28-2005 04:39 AM
DataGrid. How to keep the right keyfield value when Sort the DataGrid? Eugene ASP .Net 0 09-28-2004 05:15 PM
xsl:sort lang="es" modern vs. tradidional Spanish sort order nobody XML 0 06-01-2004 06:25 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments