I've customized one of my pages not to use the templates. I've removed the FilterRepeater and just have one Dynamic Filter on the page. My question is, is there a way to order the contents of the drop down list that the Dynamic Filter creates? Do I need
to create a partial class for that table and do something on the OnLoaded event? Thanks in advance.
There currently is no way to customize this. For future releases, we are thinking of having an extra metadata attribute that would let you declare the column to sort on (plus asc/desc). Is there any extra functionality you would like to see in this area?
Well, I started customizing the dynamic filter because I needed a human readable label next to the drop down list, not just the table name. It would be nice to have an attribute for every column and table name so that you could provide your own custom string
that would be displayed in the grid column headers and the filter labels etc.
Although it may not be practical for your solution, one workaround would be to rename the tables in the LinqToSql class. You can click do it directly in the designer.
For some reason, after you rename the tables in your LINQ to SQL diagram, you have to close the diagram and reload it in order for the new names to take effect. The names change in the diagram in real time, however they are not seen programmatically untill
you reload the diagram. The same thing happened to me. I'm afraid it may be similar to the cashing issue in another topic on this forum which we are currently waiting on a work around for.
We already have plans to add extra metadata attributes to let you provide friendlier names for columns and filters, as well as better customization for sorting. They will come in particularily handy if you have an externally created data model that you can't
edit yourself.
So I was wondering if this issue has been resolved yet.
I am trying to sort a automatically generated dropdown in an DynamicGridView, and would love to know if there is a metadata attribute I can use to do that.
Right now it is sorting by the column's ID field rather than its Name field.
Marcin in the third post in this thread just said there is no way to do this currently (and I suspect in the verion that will RTM) to do the sort. However Marcing is also doing some samples see
here one sample is Extending the FilterRepeater which may give us insite as to how we could do it our selves.
Dynamic DataFilterRepeater
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
BigTuna99
0 Points
3 Posts
Dynamic filter order by
Dec 19, 2007 04:19 PM|LINK
I've customized one of my pages not to use the templates. I've removed the FilterRepeater and just have one Dynamic Filter on the page. My question is, is there a way to order the contents of the drop down list that the Dynamic Filter creates? Do I need to create a partial class for that table and do something on the OnLoaded event? Thanks in advance.
stevekain
Member
20 Points
16 Posts
Re: Dynamic filter order by
Dec 19, 2007 06:43 PM|LINK
That's a great question. I was just about to post that one myself . . .
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Dynamic filter order by
Dec 20, 2007 01:05 AM|LINK
There currently is no way to customize this. For future releases, we are thinking of having an extra metadata attribute that would let you declare the column to sort on (plus asc/desc). Is there any extra functionality you would like to see in this area?
Thanks
ASP.NET Team
@marcind
Blog
BigTuna99
0 Points
3 Posts
Re: Dynamic filter order by
Dec 20, 2007 01:55 PM|LINK
Well, I started customizing the dynamic filter because I needed a human readable label next to the drop down list, not just the table name. It would be nice to have an attribute for every column and table name so that you could provide your own custom string that would be displayed in the grid column headers and the filter labels etc.
Jason.Franse...
Member
6 Points
9 Posts
Re: Dynamic filter order by
Dec 20, 2007 02:03 PM|LINK
Although it may not be practical for your solution, one workaround would be to rename the tables in the LinqToSql class. You can click do it directly in the designer.
BigTuna99
0 Points
3 Posts
Re: Dynamic filter order by
Dec 20, 2007 02:13 PM|LINK
ron.westbroo...
Member
45 Points
19 Posts
Re: Dynamic filter order by
Dec 20, 2007 02:24 PM|LINK
For some reason, after you rename the tables in your LINQ to SQL diagram, you have to close the diagram and reload it in order for the new names to take effect. The names change in the diagram in real time, however they are not seen programmatically untill you reload the diagram. The same thing happened to me. I'm afraid it may be similar to the cashing issue in another topic on this forum which we are currently waiting on a work around for.
Software Engineer
Avanade, Inc.
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Dynamic filter order by
Dec 20, 2007 07:16 PM|LINK
Thanks for the input everyone,
We already have plans to add extra metadata attributes to let you provide friendlier names for columns and filters, as well as better customization for sorting. They will come in particularily handy if you have an externally created data model that you can't edit yourself.
ASP.NET Team
@marcind
Blog
caseywills
Member
2 Points
1 Post
Re: Dynamic filter order by
May 23, 2008 02:54 PM|LINK
So I was wondering if this issue has been resolved yet.
I am trying to sort a automatically generated dropdown in an DynamicGridView, and would love to know if there is a metadata attribute I can use to do that.
Right now it is sorting by the column's ID field rather than its Name field.
thanks,
case
sjnaughton
All-Star
27330 Points
5459 Posts
MVP
Re: Dynamic filter order by
May 23, 2008 03:05 PM|LINK
Marcin in the third post in this thread just said there is no way to do this currently (and I suspect in the verion that will RTM) to do the sort. However Marcing is also doing some samples see here one sample is Extending the FilterRepeater which may give us insite as to how we could do it our selves.
Dynamic Data FilterRepeater
Always seeking an elegant solution.