Cannot view programmatically added RadListBoxItems (RadListbox is not refreshed)

4 posts, 0 answers
  1. Bahadır
    Bahadır avatar
    2 posts
    Member since:
    May 2013

    Posted 09 May 2013 Link to this post

    Hi everybody,

    I have a RadGrid which has checkbox as GridTemplateColumn. When the checkbox is clicked, I want to add a new item to a RadListbox.
    I use the click event and add RadListBoxItems to my RadListbox, but the new item is not rendered in browser. I can also add a new item using a button's click event. After button click event, I can see both newly added items. So the problem is, a new item cannot be seen after checkbox click event.

    Am I doing something wrong or it this a bug?
    (Telerik assembly version: v4.0.30319)

    Below is the related code:

    <telerik:RadGrid ID="rgStudentList" runat="server" AllowFilteringByColumn="True"
                                    AllowSorting="True" CellSpacing="0" Enabled="false" GridLines="None" GroupingSettings-CaseSensitive="false"
                                    OnItemCommand="rgOgrenciListesi_ItemCommand" OnNeedDataSource="rgOgrenciListesi_NeedDataSource"
                                    SortingSettings-SortToolTip="">
                                    <GroupingSettings CaseSensitive="False" />
                                    <SortingSettings SortToolTip="" />
                                    <MasterTableView AllowPaging="true" AutoGenerateColumns="False" DataKeyNames="No"
                                        PageSize="10">
                                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                            <HeaderStyle Width="20px" />
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                            <HeaderStyle Width="20px" />
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridBoundColumn AllowFiltering="true" AllowSorting="true" AutoPostBackOnFilter="true"
                                                CurrentFilterFunction="StartsWith" DataField="TCKimlikNo" FilterControlAltText="Filter column1 column"                                  
                                                >
                                            </telerik:GridBoundColumn>
     
    <telerik:GridTemplateColumn HeaderText="Seç" AllowFiltering="false">
                                                    <ItemTemplate>                                                   
                                                        <asp:CheckBox ID="chkI" runat="server" AutoPostBack="true"  OnCheckedChanged="chkI_CheckedChanged" />
                                                    </ItemTemplate>
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="chkH" runat="server" AutoPostBack="true"
                                                            OnCheckedChanged="chkH_CheckedChanged" />
                                                    </HeaderTemplate>
                                                </telerik:GridTemplateColumn>
                                        </Columns>
                                        <EditFormSettings>
                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                            </EditColumn>
                                        </EditFormSettings>
                                        <NoRecordsTemplate>
                                            <center>
                                                blah blah</center>
                                        </NoRecordsTemplate>
                                    </MasterTableView>
                                    <FilterMenu EnableImageSprites="true">
                                    </FilterMenu>
                                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                                    </HeaderContextMenu>
                                </telerik:RadGrid>

    protected void chkI_CheckedChanged(object sender, EventArgs e)
            {
     
                CheckBox chkI = sender as CheckBox;
     
                String student= ((GridDataItem)chkI.Parent.Parent).Cells[3].Text;
                
                rlbOgrNo.Items.Add(new RadListBoxItem(student, student));           
     
            }

    After the checkbox checked changed event, I cannot see the new item added. (Not rendered.)

    I tried many things but no hope. Any help is appreciated.
    Thanks.
    Bahadır


  2. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 14 May 2013 Link to this post

    Hi Bahadır,

    I was not able to reproduce the issue in our latest release which is Q1 2013 SP2. I prepared a small sample and attached it to this thread. Please give it a try and let me know how it differs from your real setup.

    Kind regards,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bahadır
    Bahadır avatar
    2 posts
    Member since:
    May 2013

    Posted 15 May 2013 Link to this post

    Hi Kostadin,

    We maintain legacy code and Telerik version is 2012.2.912.40
    Sorry about not giving this info in my original question.

    Updating to the latest telerik version is out of question because there is no budget for this.
    If this is a bug, it would be ok to update to a backward compatible bug-fix version.
    Can you reproduce the issue for version: 2012.2.912.40 ?

    Thanks a lot for the feedback.
    Bahadır

     
  5. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 20 May 2013 Link to this post

    Hello Bahadır,

    I was not able to reproduce the issue. You could try my sample with 2012.2.912.40 version and you will see that items are added in the ListBox as expected. Could you please provide the problematic code declaration and the related code behind in order to investigate the issue further?

    Regards,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top