ListView (asp.net 3.5) читать выбор пользователя - PullRequest
1 голос
/ 02 августа 2009

Я заполняю ascx control (в webpart) набором вопросов. Каждый вопрос имеет 2 группы с 4 вариантами ответа. Я использую элемент управления ListView для отображения этого набора.

var itemsToShow = from ...
                  select new
                  {
                     MfKey = item[MVListsManager.MF_KEY],
                     Order = item[MVListsManager.MF_ORDER],
                     MotivationFactor = item[MVListsManager.MF_MOTIVATION_FACTOR]
                  };
QuestionaryListView.DataSource = itemsToShow;
QuestionaryListView.DataBind();
//QuestionaryListView.ItemCommand += ...
//QuestionaryListView.ItemUpdated += ...  i tried this events but they don't fire

У меня есть шаблон

<LayoutTemplate>
    <table width="100%" border="1px" cellspacing="0">
    <tr>
        <th>Motivation factor</th>
        <th>Importance</th>
        <th>Satisfaction</th>
    </tr>
    <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
    </table>
</LayoutTemplate>
<ItemTemplate>
    <tr>
        <td><span><%#Eval("MotivationFactor")%></span></td>
        <td><asp:RadioButtonList runat="server" ID="RBLSignificance" CommandName="Significance" CommandArgument='<%#Eval("MfKey")%>'>
            <asp:ListItem Selected="True">No answer</asp:ListItem>
            <asp:ListItem>Not important</asp:ListItem>
            <asp:ListItem>A little bit</asp:ListItem>
            <asp:ListItem>Important</asp:ListItem>
            <asp:ListItem>Very impoprtant</asp:ListItem>
        </asp:RadioButtonList></td>
        <td><asp:RadioButtonList runat="server" ID="RBLSatisfaction" CommandName="Satisfaction" CommandArgument='<%#Eval("MfKey")%>'>
            <asp:ListItem Selected="True">No answer</asp:ListItem>
            <asp:ListItem>Bad</asp:ListItem>
            <asp:ListItem>So-so</asp:ListItem>
            <asp:ListItem>Good</asp:ListItem>
            <asp:ListItem>Very good</asp:ListItem>
        </asp:RadioButtonList></td>
    </tr>
</ItemTemplate>

Так это выглядит

--------------------------------------------
               | option1  | option1  
1. Question    | option2  | option2  
               | ...      | ...
--------------------------------------------

И я не знаю (я много пробовал), как читать вводимые пользователем данные, после (или во время) заполнения анкеты.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...