Home All Groups Group Topic Archive Search About
Author
7 Feb 2006 11:40 AM
ruf
I'm trying to create an Excel-type filter option on the gridview control, so
need to be able to identify which row/column combination the user clicked.
I can only get a full row at a time, not the individual column ref within
the row.  Anybody know whether this is possible in the gridview, or whether
there's a better control to do this?

Author
8 Feb 2006 2:57 AM
Yuan Ren[MSFT]
Hi,

Thanks for posting!

Based on my understanding, the current issue is that you want to get a
single column¡¯s information when user is clicking the column header. If I
have misunderstood anything, please let me know.

As far as I know, some functions like sorting in the GridView control is
implemented in the data layer not the control layer. In another word, when
you click the header of the column, the sorting function can not get the
current rows for the column information in the control layer. It uses the
index of column with SqlDataSource to sort the data and rebind the data
again. So, if you want to implement the filter function, I suggest you
customize the GridView control. For example when user clicks the header,
the DropDownList control can bind the data of the current column. This
should be implemented in the data layer.

In addition, I think the SqlDataSource.FilterExpression property is
appropriate for the current issue:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldataso
urce.filterexpression.aspx

By the way, I suggest you use the OWC control with the current scenario.
The OWC control supplies more complex functions for presenting the data and
performing some manipulations.

I hope the above information will be helpful, if you have any questions or
concerns, please do not hesitate to let me know. I am standing by to help
you.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
Author
8 Feb 2006 7:23 AM
ruf
Thanks, Yuan, for that info.

I actually wanted to filter a column based on the actual cell the user
clicked within the body of the grid rather than on the column header (am
already using the sort on the column header).  Is it possible to get the
row/column reference?  In the meantime, I'll have a look at using the whole
column instead of the cell, and also look at the OWC control as an
alternative.

Have just jumped straight from VB6/rich client applications into ASP.NET 2
and I must confess my brain is having some trouble getting around the
limitations of web forms!

Regards, Ruf.
Author
9 Feb 2006 6:49 AM
Yuan Ren[MSFT]
Hi Ruf,

Thanks for your reply!

At the current stage, I think you can use the GridView control with the
JavaScript to approach. We can capture the click event of the cell and post
back the data to the ASP.NET server. In the server side, we get the current
data and perform manipulation. I mean we can add the attributes for the
cell in the RowDataBound event for the GridView control. However, the
implementation seems a little complex.

That¡¯s why I recommend you to use the OWC tool to instead of. The OWC tool
supplies more flexible functions for presenting data in the web
application. There is only one thing need to notice is that the client need
to be installed the Office when access the web which uses the OWC tool.

Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
Author
9 Feb 2006 11:43 AM
ruf
Thanks again Yuan.  Unfortunately I don't have any control over client side
installations for this particular app but will keep OWC in mind for future.
In the meantime I've changed the way I'm doing the filters to use the whole
column instead of the individual cell.

Regards, Ruf.
Author
10 Feb 2006 6:43 AM
Yuan Ren[MSFT]
Hi Ruf,

You are welcome:)
If you have any further information related to this problem, please feel
free to post in the ASP.NET newsgroup. Thanks very much and looking forward
to hearing from you.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support