Row Reset during batch update.

2 posts, 0 answers
  1. Greg
    Greg avatar
    5 posts
    Member since:
    Jun 2020

    Posted 03 Oct Link to this post

    I was using a textbox inside a RadGrid, to enter data in a column. This field was a list of donors. I did have a (rather large) lookup list of current donors (from a table) and I decided to try replacing the TextBox with a RadComboBox. A RadDropDown box, given the size of the list, would be rather clumsy, so a RadCombo Box made sense.

     

    When I select a person from my dropdown, the batch edit block is closed. It looks like the postback wipes out the batch edit.

     

    I'm trying to include a RadComboBox inside a RadGrid. When I select a person from my dropdown, the batch window is closed and the batch edit is reset

     

            <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"
                AllowAutomaticInserts="True" PageSize="10" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"
                OnItemUpdated="RadGrid1_ItemUpdated" AllowAutomaticUpdates="True" AllowPaging="True"
                AutoGenerateColumns="False" OnBatchEditCommand="RadGrid1_BatchEditCommand" DataSourceID="SqlDataSourceDonations">

                <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="DonationID" DataSourceID="SqlDataSourceDonations" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
                    <BatchEditingSettings EditType="Cell" HighlightDeletedRows="true"/>


                        <telerik:GridTemplateColumn UniqueName="Donor" HeaderText="Donor" SortExpression="Donor" ItemStyle-Width="300px">
                            <FooterTemplate>Template footer</FooterTemplate>
                            <FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <%#DataBinder.Eval(Container.DataItem, "Donor")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadComboBox RenderMode="Lightweight" runat="server" ID="RadComboBox1" EnableLoadOnDemand="True" DataTextField="Donor"
                                    OnItemsRequested="RadComboBox1_ItemsRequested" DataValueField="DonorID" AutoPostBack="true"
                                    HighlightTemplatedItems="true" Height="140px" Width="300px" DropDownWidth="300px" >
                                    <HeaderTemplate>
                                        <ul>
                                            <li class="col1">Donor</li>
                                        </ul>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <ul>
                                            <li class="col1">
                                                <%# DataBinder.Eval(Container, "Text")%>
                                            </li>
                                        </ul>
                                    </ItemTemplate>
                                </telerik:RadComboBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>

     

    Am I going to have to scrap Batch Edit, or can I prevent the postback when an item is selected?

    What are my options?

  2. Greg
    Greg avatar
    5 posts
    Member since:
    Jun 2020

    Posted 03 Oct in reply to Greg Link to this post

    I didn't notice the Autopostback flag when I grabbed to code from the Telerik demo. When I set the autopostback to false, it looks like it solved the problem. So yes, the problem was with the autopostback flag and I think I have a fix.
Back to Top