This is a migrated thread and some comments may be shown as answers.

combobox resets to un-selected when focus moves to new item in grid row

0 Answers 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 24 Mar 2009, 09:47 PM
****
This is a problem with the combobox. The problem only occurs with a combobox bound to an objectdatasource.
I am re-posting in the combobox forum.
***
I have a grid that is created with 4 rows for editing, so the user can enter up to 4 items at once. I defined the grid and then bind it to an objectdatasourse in code behind to create a 4 row grid of 4 columns, checkbox, maskededit,combo and textbox. When I select from the combo it is fine, but as soon as I move to the next field the combo resets to un-selected. On submit I can see all the values of all the other rows/controls. Here is the aspx:

<telerik:RadGrid ID="grdNewEntity" runat="server" GridLines="None"
    AutoGenerateColumns="False" visible="false">
<HeaderContextMenu>
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</HeaderContextMenu>

<MasterTableView>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridTemplateColumn UniqueName="IsPrimary" HeaderText="Is Primary">
            <ItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" />
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="PhoneNumber" HeaderText="Number">
            <ItemTemplate>
                <telerik:RadMaskedTextBox ID="PhoneNumber" Runat="server"
                    Mask="(###) ###-####">
                </telerik:RadMaskedTextBox>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="PhoneType" HeaderText="Type">
            <ItemTemplate>
                <telerik:RadComboBox ID="PhoneType" Runat="server" DataSourceID="ODSLookup"
                    DataTextField="LookupDescription" DataValueField="ID">
                    <collapseanimation duration="200" type="OutQuint" />
                </telerik:RadComboBox>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="Comment" HeaderText="Comment">
            <ItemTemplate>
                <telerik:RadTextBox ID="RadTextBox1" Runat="server">
                </telerik:RadTextBox>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
    </Columns>
</MasterTableView>

<FilterMenu>
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
</telerik:RadGrid>


The code behind to generate the grid:

Dim oColl As New LearningDepotAPI.Phones

For x = 1 To 4

Dim oPhone As New LearningDepotAPI.Phone

oColl.Add(oPhone, 0)

grdNewEntity.DataSource = oColl

grdNewEntity.DataBind()

Next

Any Ideas on why the combobox would behave this way?
Mike

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Share this question
or