DevExpress ASPxGridView Fitlers - devexpress

I have DevExpress grid in the page.
For one column I enable filter in header of the table.
But by default Grid select the first filter expression.
What can I do to select another filter from C#?
With The Best Regards,
Alexander.

Here's an example:
ASPxGridView1.AutoFilterByColumn(ASPxGridView1.Columns["Department"], "%development");
http://www.devexpress.com/Help/?document=aspxgridview/customdocument3756.htm
For other task-based help, see here: http://www.devexpress.com/Help/?document=aspxgridview/CustomDocument3768.htm

Related

Is there a way to get a list of hidden column

I want to save the list of hidden columns so that next time when the table is loaded I show the table with the same set of column which the user chose to see in the past. Is there a way to get a list of all hidden columns in bootstrap-table library.
You can use the cookie extension to solve your problem, here is an example: http://issues.wenzhixin.net.cn/bootstrap-table/#extensions/cookie.html.
The plugin saves:
Sort order
Page number
Page number from the list
Visible columns
Search text
Docs here: http://bootstrap-table.wenzhixin.net.cn/extensions/#table-cookie
you can use the jquery datatables plugin to easily handle this problem, this plugin auto generate the table columns and show that.
you will get more information from link below,
https://www.datatables.net/
hope it helps.
try this below
var tab = $('#table').bootstrapTable('getHiddenColumns');
$.each(tab, function(index, value) {
alert(value.title);
})

how to have Drop down filter at header in aspx gridview

How can i have drop down on header filter option for one column in my aspx grid ?
Can i use "GridViewDataComboBoxColumn" for header filter drop down ? Or there is some other way of doing it ?
I am using the older version of devExpress (version 8.2) and i can not find option of following in settings
showHeaderFilterButton
I can show drop down in filter header using GridViewDataComboBoxColumn but i think it is used for updating/editing any particular row that matches value from drop down.
Any help would be highly appreciated !!
Thanks..
Anjum

How do layout how items are shown in asp gridview?

I'd like to change the way gridview shows its items according to the format below.
<img1> <img2> <img3> <img4>
<caption1> <caption1> <caption1> <caption1>
<img5> <img6> <img7> <img8>
<caption5> <caption6> <caption7> <caption8>
and so on...
You can use custom formatting options with the DataList or Repeater controls instead of a GridView. Check these examples for help :
http://csharpdotnetfreak.blogspot.com/2009/05/aspnet-creating-shopping-cart-example.html.
http://www.asp.net/web-forms/tutorials/data-access/displaying-data-with-the-datalist-and-repeater/formatting-the-datalist-and-repeater-based-upon-data-vb
Set AutoGenerateColumn property of gridview to false and then use <asp:TemplateField><ItemTemplate> under <Columns> section to add controls the way you like.

Dynamic data population like stackoverflow comments?

I'm trying to create a comment system just like SO has, but first, I'd like to show first 5 comments for a post and show rest if "display all comments" is clicked for the desired reply.
What is the best way of doing this? I really couldn't found a good way for doing what I want. I must be missing something.
For info, comments datasource is a nested repeater in my page. The outer repeater is replies and inner repeater is comments. Currently I'm binding all comments for all results (even if it has 10000 replies.). Also, I don't want to do paging for comments. I just want it to work the same way as SO.
Any ideas?
EDIT: Now I'm thinking of having 2 tables for comments which are:
A table which only has 5 rows of data and will be visible by default. I need filtering to do this. Linq filtering code would be great!
A table which has all the results. No filtering. I have no problems with this one.
So here is what I have for the data:
DataRowView dv = e.Item.DataItem as DataRowView;
if (dv != null)
{
Repeater commentRepeater = e.Item.FindControl("childRepeater") as Repeater;
if (commentRepeater != null)
{
commentRepeater.DataSource = dv.CreateChildView("myrelation");
commentRepeater.DataBind();
}
}
As you can see, I have created a relation between tables in my dataset and I'm binding that datarow to my repeater. I need to do top 5 filtering on the datarow.
Thank you
I suggest to use JSON returned from ASP.NET Web Services with jQuery.
http://www.mikesdotnetting.com/Article/96/Handling-JSON-Arrays-returned-from-ASP.NET-Web-Services-with-jQuery
http://www.electrictoolbox.com/json-data-jquery-php-mysql/
If you want to append the left over items to the current repeater item you could have a button at the end of the coments that is attached to a jquery function that will fetch the rest of the comments for you. Then once the data is recieved your function would just append the comments to the list of other comments mimicing what the repeater was doing and replacing the 'show all' button.
If you don't want to use any ajax to do this then you will probably need to rebind the comments Repeater with a new set of data that is not limited to just the first 5 results.
EDIT: Based on your comment and changes you have editted, I would go with one table with all comments and in the DataBinding of each comment set the row style to visible with a global counter. Once your have more than 5 set the style to a hidden style for each item. When they click the show all button, just switch the style from hidden to visible for the rest comments that are hidden. This will save you duplicating the data for the first 5 items which could turn into a lot of extra rows if there are a lot of answers with comments.

Flex : Displaying the Advanced DataGrid data in Pages

I have a flex application where Im displaying login data using an advanced datagrid. Is it possible to show the data in this advanced datagrid, by a page wise way? if so do you have any sample coding to do this. thanks
Here's an example I think might help you: http://gurufaction.blogspot.com/2007/02/flex-datagrid-paging-example-with.html
SWF: http://develop.gurufaction.com/App.swf
MXML: http://develop.gurufaction.com/src/App.mxml
You can use the "filterFunction".
Write a custom function to filter data according on which "page" you are browsing.
Another solution is to split the original array to get several array which will be assigned according to the current page.

Resources