I would like to order contents in a column when user clicks column header on the Syncfusion GridList control. Does anyone have any idea on how I might achieve this using C#?
I don't have them installed right now but it should be something like this:
GridControl.TableDescriptor.AllowSort = true;
This should make the columns sortable, thus when clicking on the column header it will order them.
Related
I have a ListView in my Asp.net application which has ItemTemplates. And data is bound to the listview. I want to give user flexibility to chose columns that they want to see in the ListView i.e. Show/Hide particular columns in the ListView. How can I achieve that? I tried
ListView1.FindControl("columnName").Visible = false;
But this only hides the column header and data in the ListView becomes out of order. What's the best way to achieve this?
I have a datagridview bound to a datasource, and in each row in the grid there is a category, product, and quantity. I want to filter the products in each row according to the selected category.
I'm using C# and DevExpress. How can I do this?
Please refer to the How to filter a second LookUp column based on a first LookUp column's value article which explains how to implement this feature.
Depending on how You want to filter you can set
gridView1.OptionsCustomization.AllowFilter = true;
This will display an additional filter row in your grid that will allow you to filter all columns by any text you want;
Or you can make sure that gridView1.OptionsCustomization.AllowFilter is set to true. Then there should be little icon on your column header (visible in right top corner when you move cursor over the column header) that will display filter after you click it.
I need to display the records in a view on more than one column for better visibility so i switched from using GridView to DataList.
How can I make the DataList repeat the header on each column? Currently it only sets header on first column.
Result should look something like this:
I would prefer a solution using DataList, but might switch to Repeater if it is done easier that way.
Thanks for replies!
In the search form by display button records are displayed from database. but i wnt to
change the header text of data grid column like member_id as memberID.
how can i do it?
as i m trying datagridview.column[1].headerText="memberID" it shows error of indexes of collection so what code i will use to change the header text?
try grid.Columns[0].HeaderText = "memberID". Your column indices may be running out of bound.
I have a gridview that I wish to display gridlines only on certain rows.
I want them to be on each column, but only after every 4 rows. Is this possible?
Thanks.
You can use the DataGridView.CellPainting event.
You can always user javascript (JQuery) to select wanted columns on table generated by gridview asp.net. After selecting this columns, set their right-border to wanted value or color.
If you don't want to use javascript, you can use RowDataBound eventHandler. If your columns are template fields, you can find wanted control ( e.Row.FindControl("ControlName")) and it's parent ( e.Row.FindControl("ControlName").Parent ). I am not sure, but I think that parent should be wanted cell and then you can set borders. You can try something like this, I haven't tried this.