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

Row Reset during batch update.

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Veteran
Greg asked on 03 Oct 2020, 02:46 PM

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?

1 Answer, 1 is accepted

Sort by
0
Greg
Top achievements
Rank 1
Veteran
answered on 03 Oct 2020, 03:15 PM
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.
Tags
Grid
Asked by
Greg
Top achievements
Rank 1
Veteran
Answers by
Greg
Top achievements
Rank 1
Veteran
Share this question
or