I wish to create a Telerik grid which can be grouped by different fields in the table, but I'm running into quite a problem - Telerik only allows me to designate a property to group by, and then that's it.
What I want to do is to partly be able to designate the title of the group. Instead of "Current Index: 9" I might want to remove the property name (Current Index) and replace the number by getting the value for it in a dictionary.
Also, say I want to sort by a date - Then I'll be wanting to sort only by year, month and day, and not by the full extent of the datetime down to the very last millisecond (results in separate groups for every object).
Is there any way to achieve something like this at all?
Thanks.
I solved my conumdrum by using ClientTemplates (Ajax binding) and custom properties in my viewmodel.
Related
I have a simple report which is to be sorted by date.
If I sort by date without grouping, everything is fine. As soon as I add my group, the data is no longer sorted by date.
I have tried added interactive sorting for "Date" on every column and still no luck.
Is there something I am missing? This must be possible!
PS: My data is sorted by date with the SQL.
I did not notice the group automatically added sorting. I fixed this right-clicking the Group, and under sorting I deleted the sort field.
Even I spent a day trying to fix the same issue. The trick is edit the 'Group Properties'
Right click on the cell you are grouping by. Go to Row Group > Group Properties
Click the Tab called Sorting and then add the expression or column you would like to sort on.
What I want to do is make a DropDownList with a LOT of items from a Database.
In that DropDownList I want to be able to type in a part of the value of the element, and that way limit the elements of the DropDownList to only those that contain what I filled in.
For example:
When I have a list of products with a name of 10000 to 20000, that's 10.000 items.
To prevents having to pick from all of those, I want to type in a value of let's say the items 10000 to 10010. That takes it down to 10 items.
For example, only those 10 items contain "Box" in their value.
All the other elements don't have "Box" in their value, so they stop showing in the DropDownList until I remove the text.
When it's filtered down to 10 items, I can pick the right one out and select it.
When I do that it needs to automatically fill the whole value of that element into a textarea.
Does anyone know how to go about doing that?
Thanks in advance.
Milan.
You may want to look at the ASP.Net AJAX Control Toolkit. The autocomplete extender is just what you are looking for.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
And as suggested by Chris Hardie, you may have a look at the jQuery UI autocomplete as well: http://jqueryui.com/autocomplete/
Use whatever you are comfortable with.
What we're doing - we have some DataGrids bound to some DataViews and when the user hits a 'submit' button we want to pass all the changed rows to a SPROC. There are some complexities here I can't go into detail about but...
what we need - a list of the modified rows ordered by the time they were modified. Is this possible? I doubt it is possible with the current DataView class so I was wondering what other options I have?
Using .NET 4.0
Kind regards,
Fugu
One way could be to manually add a column "ModifiedTime" that will hold the modified date and time. Every time a row is modified, modify the "ModifiedTime" column by updating its value to current date and time. Now you can simply sort by "ModifiedTime" to get required results.
I've got kind of a conceptual question. I am in the process of wrapping some statistics classes I wrote into WPF.
For that I have two DataGrid(-Views, currently in WinForms). In one DataGrid each row represents a column in the other. There I can set-up different variables (as in mathematical/statistical variables) with fields like "Header", "DataType", "ValidationBehaviour", "DisplayType". There I can also set-up how it should be displayed. Some Columns can automatically be set to ComboBoxColumns, some TextBoxColumns, and so on and so forth.
So, now once I've set-up these Columns I can go to the other grid and enter my data. I may, for instance, have generated (in grid 1) one Column called "Annual Gross Salary" with input of numerical values. Another Column called "Education" with "0=NoEducation", "1=College Level", "3=Universitary" etc. These labels are displayed as text in the combobox and my statistics engine behind then selects the respective value (0-3) for calculations (i.e. ordinal, nominal variables).
Sooo. In WinForms I could basically generate all the columns by hand in code and then add my data in the respective cells/rows. Now in WPF I thought that must be easy to realise. However, yesterday I got started with ICustomPropertyDescriptor which (maybe I was too thick) didn't give me the results I was looking for.
Basically, I just need to be able to dynamically generate columns (and rows) with different Layout, Controls (ComboBox, simple Input, DateTimes) based on the data that I have. But I don't really know how to go about it?
So here in summary:
DataGrid 1
Purpose is to display columns that have been specified in DataGrid 2
In rows, the user can add any kind of data in the rows below the columns that is allowed as to the columns specifications
DataGrid 2
Each row in this grid represents a column in DataGrid 1
Contains fields like Name/Header, DataType, Validation Behaviour, Default Value, Data Formatting, etc.
Also contains a function to be able to set-up how it should be displayed. The user can select from, for instance, ComboBoxColumn (and also add the available options), DateTime, normal TextBox, CheckBox etc.
After finishing adding a row it will automatically appear as a new column in DataGrid 1
I'd appreciate any kind of pointer into the right direction. Thanks very, very much in advance! :)
Look up DataTemplates. They do exactly this. The UI is determined by the related type.
Here is an MSDN article...
i have a list of products that are being displayed in particular order. store admin can reassign the display order, by moving the "hot" items to the top of the list. what's the best way of implementing the admin functionality UI [asp.net C#]? Products table has a [displayOrder(int)] filed which determines the display order.
i'm looking for something intuitive and simple.
thank you.
p.s. i guess i didn't make myself clear, i'm looking for UI advice more than anything.
SOLUTION: ReorderList worked out great, this article helped too. Also, make sure OldValuesParameterFormatString="{0}" in your DataSource.
using AJAX you could implement a Reoder list control you can find more information here http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ReorderList/ReorderList.aspx
Mauro
http://www.brantas.co.uk
You need a Rank field for each product (which could also be the DisplayOrder field).
When the administrator ups or downs a product, update the rank value.
When you need to list the products, do a select query which sorts in DESC order of rank.
i'm implementing that using the 'Order' column/property where people input numbers like 10, 20, 30 (i have ascending ordering). i have a list of items with text boxes to input order, and an 'apply order' button that saves new values to the database and reorders/reloads items on the page with the new ordering applied.
i don't forbid inputting the same value for two items, i sort them by name as a second sort parameter, or leave it to the database to sort it at will if it doesn't matter much. i believe it's understandable enough to put it that way, it seems like an ordered list which everybody understand easily.
If you can modify the database, add an IsHot column. Then sort by IsHot and DisplayOrder (in that order). This will keep the products in the correct order and the "hot" products will bubble up to the top.