开发者

How to edit values in a c# listbox

This is more of a UI Design approach on how to let the user edit values in a list box.

I am interested in the Usability issue.

  1. First approach is having a textBox near the list. When user selects an el开发者_开发百科ement in the list, the text goes to the textbox.

    How to edit values in a c# listbox

  2. My second though is having an input box coming up (a modal) and edit the value there.

  3. Another option is to use a list view and let the user edit inline. This might be tricky if the user doesn't know this is editable (not all user do)

What would you prefer? Any suggestions on a different approach?


I have used data binding to bind text boxes and numeric controls to a listbox. As the list box selection is changed then the relevant data appears in the controls.

Another way is a property grid linked to the current selected item in the list box. That works well for users who may be relatively savvy for the property grid.


As far as I think I would go for your second approach. I would like an edit button. When I select any item in the list box, edit button should be enabled. When I click edit a small modal dialog saying ok or cancel and in textbox displaying the current value which I can edit.


I think a list view looks a lot cleaner, and people are getting more used to this kind of thing as more web pages use client-side script, Ajax, etc.

I don't like the idea of a modal popup - very clunky.


I did this recently using a hidden text box that I would show positioned over the list box item populated with the selected item text when the user double clicked or pressed F2. When the user pressed enter or the text box lost focus, the text box was hidden and the list box item text was replaced with the edit box text. If the user pressed escape, the text box was hidden and the list item text remained unchanged (i.e cancel).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜