HeaderStyle, ItemStyle, and FooterStyle are not applied to new rows added while on batch mode

8 posts, 1 answers
  1. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 11 Dec 2013 Link to this post

    Greetings,

    If I have a column setup as follows:
    <telerik:GridTemplateColumn UniqueName="Store_Code" DataField="Store_Code" DataType="System.Int32">
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <%# Eval("Store_Code") %>
                                </ItemTemplate>
                                <HeaderStyle CssClass="serial-column" />
                                <ItemStyle CssClass="serial-column" />
                                <FooterStyle CssClass="serial-column" />
                            </telerik:GridTemplateColumn>

    When I add rows to the grid while on batch mode, I don't find the serial-column CSS class applied to the cells.
  2. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 16 Dec 2013 Link to this post

    Hello,

    The experienced behavior is expected. The RadGrid BatchEditing functionality uses RadGrid Client-Side binding mechanism which creates rows on the client which does not take server-side properties specific for each column.

    In such cases you will need to manually set the className to the desired cells in the RadGrid RowCreated client-side event.

    Regards,
    Antonio Stoilkov
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 17 Dec 2013 Link to this post

    My intuitive thinking (and I think many developers are like me) is that batch mode grid will have the same functionalities of the other modes done client side. Of course there are some fancy features that are hard to implement client side and others are meaningless to be done client side, but the basics like styling should be available.

    You already render things like for example, the edit and insert templates of the columns, why not render a whole TR element with all the style properties applied to it, and use it client side as a template for new rows using cloneNode or whatever solution you like?
  5. Answer
    Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 19 Dec 2013 Link to this post

    Hello Ashraf,

    You are correct in your observations. However, these limitations come from the RadGrid client-side implementation that the BatchEditing uses. Note that we have planned to improve our client-side binding mechanism in 2014 in order to cope better with common scenarios that we have pinpointed. Thank you for the suggestions they help us better understand on what we should concentrate.

    Regards,
    Antonio Stoilkov
    Telerik
    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 the blog feed now.
  6. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 19 Dec 2013 Link to this post

    Hmmm…May I be nosy and ask whether you will solve this issue in the near future (the next release for example)?
    We're at the start of creating a product that is expected to take at least a year of work, so if you think that you will solve this issue in the next coming months, I won't bother myself and my managers with creating a fix for it because we already won't release our product so soon.

    Is there a place where you publish the planned additions and modifications for all the RadControls? If there's such a place, it will be beneficial for me, because I won't work on creating any additions that you already plan to create.
  7. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 21 Dec 2013 Link to this post

    Hi Ashraf,

    We have plans for improving the RadGrid BatchEditing in our next quarter. Note that we could not ensure that these issue will be fixed. We are aware of this particular issue and will do our best to find a solution for it in the next release. Additionally, you could take a look at our Feedback portal where you could log your items and let people vote for them.

    Regards,
    Antonio Stoilkov
    Telerik
    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 the blog feed now.
  8. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 23 Dec 2013 Link to this post

    I've done it. I render two TD elements for each column, one with the FooterStyle applied on it, and the other with the ItemStyle. They are kept in a hidden TABLE element.

    When a new row is created, I apply the attributes and style attributes of the style cells on its cells, and when the row is closed, I apply the attributes of the ItemStyle TDs on it.

    What if I contributed this code? I read in the FAQ here that contributing code may credit me with points.

    In the course of creating this addition, I struggled because of the lack of a "row closed" event. The batchEditClosing and batchEditClosed events are called for each cell, but I wanted an event that's called when the whole row is closed so that I apply the attributes on it, specially that I use the full row edit mode.
  9. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 25 Dec 2013 Link to this post

    Hi Ashraf,

    I'm glad that you've managed to achieve the desired functionality.
    If you have sample projects or ideas for improving Telerik Web UI controls, you can share them by creating a code-library:
    http://www.telerik.com/community/code-library/aspnet-ajax.aspx

    Or by logging your ideas as a feature requests so our developers will consider implementing them:
    http://feedback.telerik.com/Project/108

    Regards,
    Eyup
    Telerik
    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 the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017