473,396 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Datagrid Sorting

I have created a datagrid in my aspx with the 'AllowSorting' property to true.

When clicking on the column header, the page refreshes. However the sorting
is not done. Am I missing anything?

I populate the data if !postback.

Nov 19 '05 #1
11 2112
Hi there,

Do you implement sorting codes in DataGrid_SortCommand
event?

Elton Wang
el********@hotmail.com
-----Original Message-----
I have created a datagrid in my aspx with the 'AllowSorting' property to true.
When clicking on the column header, the page refreshes. However the sortingis not done. Am I missing anything?

I populate the data if !postback.

.

Nov 19 '05 #2
Yes. In fact, I made the sort through the sort event. However when I changed
the column label via the column create event, the columns were become
non-sortable.

"Elton Wang" wrote:
Hi there,

Do you implement sorting codes in DataGrid_SortCommand
event?

Elton Wang
el********@hotmail.com
-----Original Message-----
I have created a datagrid in my aspx with

the 'AllowSorting' property to true.

When clicking on the column header, the page refreshes.

However the sorting
is not done. Am I missing anything?

I populate the data if !postback.

.

Nov 19 '05 #3
What do you mean the columns become non-sortable,
DataGrid_SortCommand can't be fired or other? Could you
give more detailed in?

Elton Wang
el********@hotmail.com

-----Original Message-----
Yes. In fact, I made the sort through the sort event. However when I changedthe column label via the column create event, the columns were becomenon-sortable.

"Elton Wang" wrote:
Hi there,

Do you implement sorting codes in DataGrid_SortCommand
event?

Elton Wang
el********@hotmail.com
>-----Original Message-----
>I have created a datagrid in my aspx with

the 'AllowSorting' property to true.
>
>When clicking on the column header, the page
refreshes. However the sorting
>is not done. Am I missing anything?
>
>I populate the data if !postback.
>
>.
>

.

Nov 19 '05 #4
Yes.

The Data is populated in the ground (databound) on the page_load event.
Sorting is done in the SortCommand event. The custom labels are defined in
the ItemCreated event. In fact there were 5 colums to be displayed. Out of
which, I made 2 columns custom headers. These 2 columns display the text in a
non-underlined fashion so that I cannot click on it for sorting at runtime.

How can make these 2 columns again be sortable?

"Elton Wang" wrote:
What do you mean the columns become non-sortable,
DataGrid_SortCommand can't be fired or other? Could you
give more detailed in?

Elton Wang
el********@hotmail.com

-----Original Message-----
Yes. In fact, I made the sort through the sort event.

However when I changed
the column label via the column create event, the columns

were become
non-sortable.

"Elton Wang" wrote:
Hi there,

Do you implement sorting codes in DataGrid_SortCommand
event?

Elton Wang
el********@hotmail.com

>-----Original Message-----
>I have created a datagrid in my aspx with
the 'AllowSorting' property to true.
>
>When clicking on the column header, the page refreshes. However the sorting
>is not done. Am I missing anything?
>
>I populate the data if !postback.
>
>.
>

.

Nov 19 '05 #5
Do you assign SortExpression for these two columns?

Elton Wang
-----Original Message-----
Yes.

The Data is populated in the ground (databound) on the page_load event.Sorting is done in the SortCommand event. The custom labels are defined inthe ItemCreated event. In fact there were 5 colums to be displayed. Out ofwhich, I made 2 columns custom headers. These 2 columns display the text in anon-underlined fashion so that I cannot click on it for sorting at runtime.
How can make these 2 columns again be sortable?

"Elton Wang" wrote:
What do you mean the columns become non-sortable,
DataGrid_SortCommand can't be fired or other? Could you
give more detailed in?

Elton Wang
el********@hotmail.com

>-----Original Message-----
>Yes. In fact, I made the sort through the sort event.

However when I changed
>the column label via the column create event, the columns
were become
>non-sortable.
>
>"Elton Wang" wrote:
>
>> Hi there,
>>
>> Do you implement sorting codes in

DataGrid_SortCommand >> event?
>>
>> Elton Wang
>> el********@hotmail.com
>>
>> >-----Original Message-----
>> >I have created a datagrid in my aspx with
>> the 'AllowSorting' property to true.
>> >
>> >When clicking on the column header, the page

refreshes.
>> However the sorting
>> >is not done. Am I missing anything?
>> >
>> >I populate the data if !postback.
>> >
>> >.
>> >
>>
>.
>

.

Nov 19 '05 #6
Yes I did. In fact the following are the event code I use.

private void DataGrid_Inspection_SortCommand(object source,
System.Web.UI.WebControls.DataGridSortCommandEvent Args e)
{
DataView dvInspection = new DataView();
dvInspection.Table = (DataTable)Cache["Inspection"];
dvInspection.Sort = e.SortExpression;
DataGrid_Inspection.DataSource = dvInspection;
DataGrid_Inspection.DataBind();
}

private void DataGrid_Inspection_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Header )
{
e.Item.Cells[0].Text = "Structure";
e.Item.Cells[1].Text = "Area";
}
}
"Elton Wang" wrote:
Do you assign SortExpression for these two columns?

Elton Wang
-----Original Message-----
Yes.

The Data is populated in the ground (databound) on the

page_load event.
Sorting is done in the SortCommand event. The custom

labels are defined in
the ItemCreated event. In fact there were 5 colums to be

displayed. Out of
which, I made 2 columns custom headers. These 2 columns

display the text in a
non-underlined fashion so that I cannot click on it for

sorting at runtime.

How can make these 2 columns again be sortable?

"Elton Wang" wrote:
What do you mean the columns become non-sortable,
DataGrid_SortCommand can't be fired or other? Could you
give more detailed in?

Elton Wang
el********@hotmail.com
>-----Original Message-----
>Yes. In fact, I made the sort through the sort event.
However when I changed
>the column label via the column create event, the columns were become
>non-sortable.
>
>"Elton Wang" wrote:
>
>> Hi there,
>>
>> Do you implement sorting codes in DataGrid_SortCommand >> event?
>>
>> Elton Wang
>> el********@hotmail.com
>>
>> >-----Original Message-----
>> >I have created a datagrid in my aspx with
>> the 'AllowSorting' property to true.
>> >
>> >When clicking on the column header, the page
refreshes.
>> However the sorting
>> >is not done. Am I missing anything?
>> >
>> >I populate the data if !postback.
>> >
>> >.
>> >
>>
>.
>

.

Nov 19 '05 #7
If you really have some special reason to change Column
header, Instead of using
if (e.Item.ItemType == ListItemType.Header )
{
e.Item.Cells[0].Text = "Structure";
e.Item.Cells[1].Text = "Area";
}

to use
DataGrid_Inspection.Columns[0].HeaderText = "Structure";
DataGrid_Inspection.Columns[1].HeaderText = "Area";

Elton Wang
el********@hotmail.com

-----Original Message-----
Yes I did. In fact the following are the event code I use.

private void DataGrid_Inspection_SortCommand(object source,System.Web.UI.WebControls.DataGridSortCommandEven tArgs e)
{
DataView dvInspection = new DataView();
dvInspection.Table = (DataTable)Cache["Inspection"];
dvInspection.Sort = e.SortExpression;
DataGrid_Inspection.DataSource = dvInspection;
DataGrid_Inspection.DataBind();
}

private void DataGrid_Inspection_ItemCreated(object sender,System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Header )
{
e.Item.Cells[0].Text = "Structure";
e.Item.Cells[1].Text = "Area";
}
}
"Elton Wang" wrote:
Do you assign SortExpression for these two columns?

Elton Wang
>-----Original Message-----
>Yes.
>
>The Data is populated in the ground (databound) on the

page_load event.
>Sorting is done in the SortCommand event. The custom

labels are defined in
>the ItemCreated event. In fact there were 5 colums to be
displayed. Out of
>which, I made 2 columns custom headers. These 2
columns display the text in a
>non-underlined fashion so that I cannot click on it
for sorting at runtime.
>
>How can make these 2 columns again be sortable?
>
>
>
>"Elton Wang" wrote:
>
>> What do you mean the columns become non-sortable,
>> DataGrid_SortCommand can't be fired or other? Could

you >> give more detailed in?
>>
>> Elton Wang
>> el********@hotmail.com
>>
>>
>> >-----Original Message-----
>> >Yes. In fact, I made the sort through the sort event. >> However when I changed
>> >the column label via the column create event, the

columns
>> were become
>> >non-sortable.
>> >
>> >"Elton Wang" wrote:
>> >
>> >> Hi there,
>> >>
>> >> Do you implement sorting codes in

DataGrid_SortCommand
>> >> event?
>> >>
>> >> Elton Wang
>> >> el********@hotmail.com
>> >>
>> >> >-----Original Message-----
>> >> >I have created a datagrid in my aspx with
>> >> the 'AllowSorting' property to true.
>> >> >
>> >> >When clicking on the column header, the page
>> refreshes.
>> >> However the sorting
>> >> >is not done. Am I missing anything?
>> >> >
>> >> >I populate the data if !postback.
>> >> >
>> >> >.
>> >> >
>> >>
>> >.
>> >
>>
>.
>

.

Nov 19 '05 #8
Yes, I have a reason for doing so.

At design-time, I cannot create columns because when the data is populated,
that column appears in the page with no data, and the new fields are added to
the right side of it.

However, when I remove the columns at design time, I cannot use:
DataGrid_Inspection.Columns[0].HeaderText = "Structure"
because the compiler says that the index is out or range (because no columns
exist).

In fact, I use:
DataGrid_Inspection.Columns[0].HeaderText = "Structure"
after binding the data. Still it is giving an error saying that the column
is undefined.
"Elton Wang" wrote:
If you really have some special reason to change Column
header, Instead of using
if (e.Item.ItemType == ListItemType.Header )
{
e.Item.Cells[0].Text = "Structure";
e.Item.Cells[1].Text = "Area";
}

to use
DataGrid_Inspection.Columns[0].HeaderText = "Structure";
DataGrid_Inspection.Columns[1].HeaderText = "Area";

Elton Wang
el********@hotmail.com

-----Original Message-----
Yes I did. In fact the following are the event code I use.

private void DataGrid_Inspection_SortCommand(object

source,
System.Web.UI.WebControls.DataGridSortCommandEven tArgs e)
{
DataView dvInspection = new DataView();
dvInspection.Table = (DataTable)Cache["Inspection"];
dvInspection.Sort = e.SortExpression;
DataGrid_Inspection.DataSource = dvInspection;
DataGrid_Inspection.DataBind();
}

private void DataGrid_Inspection_ItemCreated(object

sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Header )
{
e.Item.Cells[0].Text = "Structure";
e.Item.Cells[1].Text = "Area";
}
}
"Elton Wang" wrote:
Do you assign SortExpression for these two columns?

Elton Wang
>-----Original Message-----
>Yes.
>
>The Data is populated in the ground (databound) on the
page_load event.
>Sorting is done in the SortCommand event. The custom
labels are defined in
>the ItemCreated event. In fact there were 5 colums to be displayed. Out of
>which, I made 2 columns custom headers. These 2 columns display the text in a
>non-underlined fashion so that I cannot click on it for sorting at runtime.
>
>How can make these 2 columns again be sortable?
>
>
>
>"Elton Wang" wrote:
>
>> What do you mean the columns become non-sortable,
>> DataGrid_SortCommand can't be fired or other? Could you >> give more detailed in?
>>
>> Elton Wang
>> el********@hotmail.com
>>
>>
>> >-----Original Message-----
>> >Yes. In fact, I made the sort through the sort event. >> However when I changed
>> >the column label via the column create event, the
columns
>> were become
>> >non-sortable.
>> >
>> >"Elton Wang" wrote:
>> >
>> >> Hi there,
>> >>
>> >> Do you implement sorting codes in
DataGrid_SortCommand
>> >> event?
>> >>
>> >> Elton Wang
>> >> el********@hotmail.com
>> >>
>> >> >-----Original Message-----
>> >> >I have created a datagrid in my aspx with
>> >> the 'AllowSorting' property to true.
>> >> >
>> >> >When clicking on the column header, the page
>> refreshes.
>> >> However the sorting
>> >> >is not done. Am I missing anything?
>> >> >
>> >> >I populate the data if !postback.
>> >> >
>> >> >.
>> >> >
>> >>
>> >.
>> >
>>
>.
>

.

Nov 19 '05 #9
It looks like very complicated case.

Since you can't assign column's HeaderText, how do you
assign column's SortExpression? Without SortExpression,
the column is non-sortable.

I was just wondering before data was pulled out, you don't
know its structure, do you? Or it changes from time to
time.
-----Original Message-----
Yes, I have a reason for doing so.

At design-time, I cannot create columns because when the data is populated,that column appears in the page with no data, and the new fields are added tothe right side of it.

However, when I remove the columns at design time, I cannot use:DataGrid_Inspection.Columns[0].HeaderText = "Structure"
because the compiler says that the index is out or range (because no columnsexist).

In fact, I use:
DataGrid_Inspection.Columns[0].HeaderText = "Structure"
after binding the data. Still it is giving an error saying that the columnis undefined.
"Elton Wang" wrote:
If you really have some special reason to change Column
header, Instead of using
if (e.Item.ItemType == ListItemType.Header )
{
e.Item.Cells[0].Text = "Structure";
e.Item.Cells[1].Text = "Area";
}

to use
DataGrid_Inspection.Columns[0].HeaderText = "Structure";
DataGrid_Inspection.Columns[1].HeaderText = "Area";

Elton Wang
el********@hotmail.com

>-----Original Message-----
>Yes I did. In fact the following are the event code I use. >
>private void DataGrid_Inspection_SortCommand(object

source,
>System.Web.UI.WebControls.DataGridSortCommandEven tArgs e) >{
>DataView dvInspection = new DataView();
>dvInspection.Table = (DataTable)Cache["Inspection"];
>dvInspection.Sort = e.SortExpression;
>DataGrid_Inspection.DataSource = dvInspection;
>DataGrid_Inspection.DataBind();
>}
>
>
>
>private void DataGrid_Inspection_ItemCreated(object

sender,
>System.Web.UI.WebControls.DataGridItemEventArgs e)
>{
> if (e.Item.ItemType == ListItemType.Header )
> {
> e.Item.Cells[0].Text = "Structure";
> e.Item.Cells[1].Text = "Area";
> }
>}
>
>
>"Elton Wang" wrote:
>
>> Do you assign SortExpression for these two columns?
>>
>> Elton Wang
>> >-----Original Message-----
>> >Yes.
>> >
>> >The Data is populated in the ground (databound) on the >> page_load event.
>> >Sorting is done in the SortCommand event. The custom >> labels are defined in
>> >the ItemCreated event. In fact there were 5 colums to
be
>> displayed. Out of
>> >which, I made 2 columns custom headers. These 2

columns
>> display the text in a
>> >non-underlined fashion so that I cannot click on it

for
>> sorting at runtime.
>> >
>> >How can make these 2 columns again be sortable?
>> >
>> >
>> >
>> >"Elton Wang" wrote:
>> >
>> >> What do you mean the columns become non-sortable,
>> >> DataGrid_SortCommand can't be fired or other?
Could you
>> >> give more detailed in?
>> >>
>> >> Elton Wang
>> >> el********@hotmail.com
>> >>
>> >>
>> >> >-----Original Message-----
>> >> >Yes. In fact, I made the sort through the sort

event.
>> >> However when I changed
>> >> >the column label via the column create event,

the >> columns
>> >> were become
>> >> >non-sortable.
>> >> >
>> >> >"Elton Wang" wrote:
>> >> >
>> >> >> Hi there,
>> >> >>
>> >> >> Do you implement sorting codes in
>> DataGrid_SortCommand
>> >> >> event?
>> >> >>
>> >> >> Elton Wang
>> >> >> el********@hotmail.com
>> >> >>
>> >> >> >-----Original Message-----
>> >> >> >I have created a datagrid in my aspx with
>> >> >> the 'AllowSorting' property to true.
>> >> >> >
>> >> >> >When clicking on the column header, the page
>> >> refreshes.
>> >> >> However the sorting
>> >> >> >is not done. Am I missing anything?
>> >> >> >
>> >> >> >I populate the data if !postback.
>> >> >> >
>> >> >> >.
>> >> >> >
>> >> >>
>> >> >.
>> >> >
>> >>
>> >.
>> >
>>
>.
>

.

Nov 19 '05 #10
I cannot hardcode the statements.

My sql string will be different; my columns will be different.

All what I'm looking is that I want some data displayed from a table with
custom headers and being able to sort on all of those columns.

"Elton Wang" wrote:
It looks like very complicated case.

Since you can't assign column's HeaderText, how do you
assign column's SortExpression? Without SortExpression,
the column is non-sortable.

I was just wondering before data was pulled out, you don't
know its structure, do you? Or it changes from time to
time.
-----Original Message-----
Yes, I have a reason for doing so.

At design-time, I cannot create columns because when the

data is populated,
that column appears in the page with no data, and the new

fields are added to
the right side of it.

However, when I remove the columns at design time, I

cannot use:
DataGrid_Inspection.Columns[0].HeaderText = "Structure"
because the compiler says that the index is out or range

(because no columns
exist).

In fact, I use:
DataGrid_Inspection.Columns[0].HeaderText = "Structure"
after binding the data. Still it is giving an error

saying that the column
is undefined.
"Elton Wang" wrote:
If you really have some special reason to change Column
header, Instead of using
if (e.Item.ItemType == ListItemType.Header )
{
e.Item.Cells[0].Text = "Structure";
e.Item.Cells[1].Text = "Area";
}

to use
DataGrid_Inspection.Columns[0].HeaderText = "Structure";
DataGrid_Inspection.Columns[1].HeaderText = "Area";

Elton Wang
el********@hotmail.com
>-----Original Message-----
>Yes I did. In fact the following are the event code I use. >
>private void DataGrid_Inspection_SortCommand(object
source,
>System.Web.UI.WebControls.DataGridSortCommandEven tArgs e) >{
>DataView dvInspection = new DataView();
>dvInspection.Table = (DataTable)Cache["Inspection"];
>dvInspection.Sort = e.SortExpression;
>DataGrid_Inspection.DataSource = dvInspection;
>DataGrid_Inspection.DataBind();
>}
>
>
>
>private void DataGrid_Inspection_ItemCreated(object
sender,
>System.Web.UI.WebControls.DataGridItemEventArgs e)
>{
> if (e.Item.ItemType == ListItemType.Header )
> {
> e.Item.Cells[0].Text = "Structure";
> e.Item.Cells[1].Text = "Area";
> }
>}
>
>
>"Elton Wang" wrote:
>
>> Do you assign SortExpression for these two columns?
>>
>> Elton Wang
>> >-----Original Message-----
>> >Yes.
>> >
>> >The Data is populated in the ground (databound) on the >> page_load event.
>> >Sorting is done in the SortCommand event. The custom >> labels are defined in
>> >the ItemCreated event. In fact there were 5 colums to be
>> displayed. Out of
>> >which, I made 2 columns custom headers. These 2
columns
>> display the text in a
>> >non-underlined fashion so that I cannot click on it
for
>> sorting at runtime.
>> >
>> >How can make these 2 columns again be sortable?
>> >
>> >
>> >
>> >"Elton Wang" wrote:
>> >
>> >> What do you mean the columns become non-sortable,
>> >> DataGrid_SortCommand can't be fired or other? Could you
>> >> give more detailed in?
>> >>
>> >> Elton Wang
>> >> el********@hotmail.com
>> >>
>> >>
>> >> >-----Original Message-----
>> >> >Yes. In fact, I made the sort through the sort
event.
>> >> However when I changed
>> >> >the column label via the column create event, the >> columns
>> >> were become
>> >> >non-sortable.
>> >> >
>> >> >"Elton Wang" wrote:
>> >> >
>> >> >> Hi there,
>> >> >>
>> >> >> Do you implement sorting codes in
>> DataGrid_SortCommand
>> >> >> event?
>> >> >>
>> >> >> Elton Wang
>> >> >> el********@hotmail.com
>> >> >>
>> >> >> >-----Original Message-----
>> >> >> >I have created a datagrid in my aspx with
>> >> >> the 'AllowSorting' property to true.
>> >> >> >
>> >> >> >When clicking on the column header, the page
>> >> refreshes.
>> >> >> However the sorting
>> >> >> >is not done. Am I missing anything?
>> >> >> >
>> >> >> >I populate the data if !postback.
>> >> >> >
>> >> >> >.
>> >> >> >
>> >> >>
>> >> >.
>> >> >
>> >>
>> >.
>> >
>>
>.
>

.

Nov 19 '05 #11

As I think there might be some way to do it.

You may try that after pulling data but before binding
data source to datagrid.

For example, you got data in a datatable, tbl.

BoundColumn boundCol;
foreach (DataColumn col in tbl.Columns){
boundCol = new BoundColumn();
boundCol.HeaderText = col.ColumnName
boundCol.SortExpression = col.ColumnName
DataGrid_Inspection.Columns.Add(boundCol);
}

Then you can bind data.

Hope it helps,

Elton Wang
el********@hotmail.com
-----Original Message-----
I cannot hardcode the statements.

My sql string will be different; my columns will be different.
All what I'm looking is that I want some data displayed from a table withcustom headers and being able to sort on all of those columns.
"Elton Wang" wrote:
It looks like very complicated case.

Since you can't assign column's HeaderText, how do you
assign column's SortExpression? Without SortExpression,
the column is non-sortable.

I was just wondering before data was pulled out, you don't know its structure, do you? Or it changes from time to
time.
>-----Original Message-----
>Yes, I have a reason for doing so.
>
>At design-time, I cannot create columns because when the
data is populated,
>that column appears in the page with no data, and the
new fields are added to
>the right side of it.
>
>However, when I remove the columns at design time, I

cannot use:
>DataGrid_Inspection.Columns[0].HeaderText = "Structure"
>because the compiler says that the index is out or
range (because no columns
>exist).
>
>In fact, I use:
>DataGrid_Inspection.Columns[0].HeaderText = "Structure"
>after binding the data. Still it is giving an error

saying that the column
>is undefined.
>
>
>"Elton Wang" wrote:
>
>> If you really have some special reason to change
Column >> header, Instead of using
>> if (e.Item.ItemType == ListItemType.Header )
>> {
>> e.Item.Cells[0].Text = "Structure";
>> e.Item.Cells[1].Text = "Area";
>> }
>>
>> to use
>> DataGrid_Inspection.Columns[0].HeaderText = "Structure"; >> DataGrid_Inspection.Columns[1].HeaderText = "Area";
>>
>> Elton Wang
>> el********@hotmail.com
>>
>>
>> >-----Original Message-----
>> >Yes I did. In fact the following are the event code I use.
>> >
>> >private void DataGrid_Inspection_SortCommand(object
>> source,
>>System.Web.UI.WebControls.DataGridSortCommandEven tArgs
e)
>> >{
>> >DataView dvInspection = new DataView();
>> >dvInspection.Table = (DataTable)Cache["Inspection"];
>> >dvInspection.Sort = e.SortExpression;
>> >DataGrid_Inspection.DataSource = dvInspection;
>> >DataGrid_Inspection.DataBind();
>> >}
>> >
>> >
>> >
>> >private void DataGrid_Inspection_ItemCreated(object
>> sender,
>> >System.Web.UI.WebControls.DataGridItemEventArgs e)
>> >{
>> > if (e.Item.ItemType == ListItemType.Header )
>> > {
>> > e.Item.Cells[0].Text = "Structure";
>> > e.Item.Cells[1].Text = "Area";
>> > }
>> >}
>> >
>> >
>> >"Elton Wang" wrote:
>> >
>> >> Do you assign SortExpression for these two

columns? >> >>
>> >> Elton Wang
>> >> >-----Original Message-----
>> >> >Yes.
>> >> >
>> >> >The Data is populated in the ground (databound) on the
>> >> page_load event.
>> >> >Sorting is done in the SortCommand event. The

custom
>> >> labels are defined in
>> >> >the ItemCreated event. In fact there were 5
colums to
>> be
>> >> displayed. Out of
>> >> >which, I made 2 columns custom headers. These 2
>> columns
>> >> display the text in a
>> >> >non-underlined fashion so that I cannot click on

it >> for
>> >> sorting at runtime.
>> >> >
>> >> >How can make these 2 columns again be sortable?
>> >> >
>> >> >
>> >> >
>> >> >"Elton Wang" wrote:
>> >> >
>> >> >> What do you mean the columns become non- sortable, >> >> >> DataGrid_SortCommand can't be fired or other?

Could
>> you
>> >> >> give more detailed in?
>> >> >>
>> >> >> Elton Wang
>> >> >> el********@hotmail.com
>> >> >>
>> >> >>
>> >> >> >-----Original Message-----
>> >> >> >Yes. In fact, I made the sort through the sort >> event.
>> >> >> However when I changed
>> >> >> >the column label via the column create event,

the
>> >> columns
>> >> >> were become
>> >> >> >non-sortable.
>> >> >> >
>> >> >> >"Elton Wang" wrote:
>> >> >> >
>> >> >> >> Hi there,
>> >> >> >>
>> >> >> >> Do you implement sorting codes in
>> >> DataGrid_SortCommand
>> >> >> >> event?
>> >> >> >>
>> >> >> >> Elton Wang
>> >> >> >> el********@hotmail.com
>> >> >> >>
>> >> >> >> >-----Original Message-----
>> >> >> >> >I have created a datagrid in my aspx with
>> >> >> >> the 'AllowSorting' property to true.
>> >> >> >> >
>> >> >> >> >When clicking on the column header, the page >> >> >> refreshes.
>> >> >> >> However the sorting
>> >> >> >> >is not done. Am I missing anything?
>> >> >> >> >
>> >> >> >> >I populate the data if !postback.
>> >> >> >> >
>> >> >> >> >.
>> >> >> >> >
>> >> >> >>
>> >> >> >.
>> >> >> >
>> >> >>
>> >> >.
>> >> >
>> >>
>> >.
>> >
>>
>.
>

.

Nov 19 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris Mayers | last post by:
I have a Windows Forms DataGrid that has a DataView as a datasource. My problem is that I want the datagrid to exhibit some special sorting properties when the header rows are clicked on. From...
2
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child...
1
by: Sargas Atum | last post by:
Hi all, 1. I have a problem with cell selection in a table in a DataGrid. I dont want that anybody writes in the cells. That was not a problem I changed them to "read only", but if I am going...
3
by: melanieab | last post by:
Hi, I'm programatically sorting in a datagrid. When a column header is clicked, the sort happens twice for some reason, making it looks like it only sorts in descending order. I can tell it...
7
by: DC Gringo | last post by:
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...
1
by: Jeremy | last post by:
I want my gird to sort only the items on the current page when I click on a column header. I wrote a little test app, but when I sort it pulls in items from other pages and places them on the current...
4
by: Manny Chohan | last post by:
hi guys, my code is returning an array and i need to create datagrid so that i can have sorting and implement prev....next function on it to navigate. is there any way this can be done in...
5
by: DKC | last post by:
Hi, Using VB.NET. I have a datagrid having a strongly typed array of objects as its data source. The data from the array of objects is displayed by means of a table style, which is fine, but...
1
by: ECD | last post by:
Hello all, I can usually find solutions to my .NET problems by searching these groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0 framework). I want to disable sorting on...
0
by: rupalirane07 | last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error: NullReferenceException error Any...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.