i need a solution like this:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultcs.aspx
however, i need the user to be able to add entries in here.
does such a control already exist?
it can be either jquery or asp.net
it also does not have to be a combobox, it can be a listbox. i need to have every item have a checkbox next to it and be able to add a comment for each entry.
Take a look at the ASPxGridLookup control from the DevExpress component vendor.
The ASPxGridLookup component allows the implementation of the multi-select DropDown functionality:
http://demos.devexpress.com/ASPxGridViewDemos/ASPxGridLookup/MultiSelect.aspx
http://www.devexpress.com/example=E3467
http://codecentral.devexpress.com/E3467/
with editing capabilities via the embedded ASPxGridView object:
http://demos.devexpress.com/ASPxGridViewDemos/GridEditing/EditModes.aspx
Ref : DropdownList with Multi select option?
Multiple dropdownlist with checkbox....checkout below link...
checkout demo page here...
http://download.ysatech.com/ASP-NET-Multiple-Selection-DropDownList/ASP-NET-Multiple-Selection-DropDownList.aspx
Blog page here....
http://blog.ysatech.com/post/2009/09/09/ASP-NET-Multiple-Selection-DropDownList-with-AJAX-HoverMenuExtender.aspx
http://www.codeproject.com/KB/user-controls/MultiSelectDropdownList.aspx
To me it sounds like it might be better for you to run with a ListBox. Telerik offers the RadListBox, which allows you to have checkboxes as seen here.
Additionally, you could allow for edits upon, for example, double-click as is displayed in the source code attached to this forum post.
Finally, if you want to also display the comments then you could use an ItemTemplate to define a custom layout for each RadListBoxItem and allow the user to edit both the main and comment fields.
That should cover everything that you need.
Related
Can anyone tell me if what is detailed in this example is possible with GridView using TemplateColumns. http://www.codeproject.com/KB/webforms/CustomDataGridColumn.aspx
I need to dynamically generate a GridView that may need not have one datatype in a column. Say Column 1 could have Checkbox or TextBox control (based on a logic, of course)
I tried implementing ITemplate and adding custom controls in InstantiateIn(), but as far as I understand - the binding here on on a per column level and not on per Item level.
How can I acheive this?
Thanks in advance. I can stub out the code I have if the question needs more clarification.
Yes, Telerik's RadGrid supports this.
The same code will work with only minor changes. For example, ListItemType becomes GridItemType. DataGridItem becomes GridDataItem, etc. Also, the way Telerik creates the controls means some of the indices need to change. For example, their ItemDataBound event has this code:
string dataType = e.Item.Cells[0].Text;
but with a Telerik RadGrid, that needs to be:
string dataType = e.Item.Cells[2].Text;
Other than those kinds of minor changes, it all works with RadGrid.
Note: When I see code samples from Telerik, they generally go a different route. The way I've seen them provide custom content for a cell is to put your customization logic in the ItemCreated event. That will be called for each row. So you can have the column's template contain all the possible controls and then in ItemCreating event, modify the instance of that template by setting the correct control to Visible based on your logic (this is the approach used in the article you linked to). Or you could create only a single specific control in that event for the correct type of control. Here is the documentation for the ItemCreated event and also a code sample from Telerik that modifies a LinkButton for each row but the same approach can be used.
How to add controls(like image,button etc) to a GridControl in devexpress?
Those controls are called Repository Items. You can add them via GridControl Designer
And assign particular Repository Item to column you want.
If you mean ASP.NET ASPxGridView, there are two different solutions:
1) you can use different ASPxGridView columns kinds as it is explained in the Data Columns topic. However, generally, this only affects data representation when a certain data row is being edited. In this case, different editors are used for different columns.
2) since this is an ASP.NET grid, it allows a developer to use Templates. This is a very powerful approach which allows you to change the grid's lookandfeel significantly. Please take a look at the ASPxGridView demos and click the "Templates" command in the navigation panel. You will see some examples of how templates can be used in the ASPxGridView.
If you install devexpress you can also see Demo-Center for example. (also online demo)
look for Grid-Columns
In Asp you got these:
I would like to change the listview template on a button click event. for example if your in edittemplate i would like to switch to ItemTemplate.
i am trying to do this because im writing my own custom update function for the list view. so after i successfully update the row, it doesn't switch back to the default view.
Rgds
Adrian
Adrian,
As you have tagged this as an asp.net question I would direct your attention to jquery (jquery.com). If you use a vanilla template (wrapping your elements in simple "div" tags) and use the jquery tools to do addClass/removeClass and toggleClass and apply various css styles to achieve the visual effect you desire you should be able to land just were you wish.
Using page methods you can leverage your custom update on a partial postback from jquery and reduce the server impact.
If you would rather do this server side you are probable looking to leverage the item databound event to set your template.
A more complete answer would require more information about what you are trying to accomplish.
Cheers,
CEC
I'm making an aspx page that can edit books. A book is an complex class with lots of properties.
I've made an edit page for most of them, however I'm having trouble with showing edit options for my Sellers Proprety. It is an list<Seller> object.
Seller is as follows:
public class Seller
{
private string sellerName;
private double price;
}
How can I print a list to the screen, and let the clinet edit it, then load it back to the object?
Thank you very much.
ASP.Net has a number of controls that are used specifically for binding to list data and displaying and/or editing it.
Repeater, DataList and DataGrid are a few that you could use for easy display of your items, although the Repeater doesn't support editing as well. Essentially you would databind your list to the control, and provide an <ItemTemplate> ... your html here ... </ItemTemplate> that would define how each item displayed.
Depending on how you want your editing to work would probably dictate which control you picked. If you want inline, table-row style editing, you would use a DataGrid, which has built in support for this. If you want to edit items individually, you might use linkbuttons that pop up an edit form or link to an edit page, or use an EditItemTemplate to change the display of your DataList.
Use GridView and Turn on editing for it
I would like to move items from one list to another on a page, and I'm pretty flexible about what type of a list it is. What's the best way to do that? ASP.NET Ajax? jQuery? Anything else?
There's a nice tutorial on CodeProject that covers dragging with ASP.NET and jQuery:
http://www.codeproject.com/KB/webforms/JQueryPersistantDragDrop.aspx
if you want to do this and PostBack instead of using AJAX to update your data based on from fields you'll need to get creative about what types of controls you use. Page validation will complain about ASP controls like dropdownlists, listboxes, etc. if they contain selected items that weren't in the list when it was rendered.
Better to use AJAX to send back your updates or use HTML controls like unordered lists or select added via javascript and stuff the selected data in another control that doesn't complain (hiddenfield) on PostBack. The alternative is turning off page validation and I don't think that's a good idea.
You can also might look at YUI Library, I'd say it implements Drag & Drop in a very simple and flexible way:
http://yuilibrary.com/yui/docs/dd/
There are a lot of examples etc...