CommandItemSettings AddNewRecordButton and CSS

3 posts, 1 answers
  1. Dimitrios
    Dimitrios avatar
    45 posts
    Member since:
    Jun 2014

    Posted 17 Jul 2014 Link to this post

    There are only two settings I can set from the aspx file for the AddNewRecord Button of a radgrid (when it's visible).

    CommandItemSettings-AddNewRecordText
    CommandItemSettings-AddNewRecordImageUrl

    ...but this is not enough.


    Is there a way to control the appearance of the add button with css?



    I can do this for the edit button (for example) of each row by:

          Dim ImgBtn As ImageButton = DirectCast(e.Item.FindControl("EditCommandColumn"), ImageButton)
          ImgBtn.CssClass = "editbutton"

    ...in the itemCreated event.

    Thanks
  2. Answer
    Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 17 Jul 2014 in reply to Dimitrios Link to this post

    Hi,

    Please try with the below code snippet.

    As per my knowledge there is not such type of property is there but you can assign CSS property by using below code snippet.
    because for add button there are two DOM elements created.

    <style type="text/css">
            .RadGrid .rgAdd + a
            {
                //Add button text related css
            }
            .RadGrid .rgAdd
            {
                //Add button image related css
            }
        </style>

    Do not forgot to add "!important" in CSS property.

    Let me know if any concern.

    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dimitrios
    Dimitrios avatar
    45 posts
    Member since:
    Jun 2014

    Posted 21 Jul 2014 in reply to Jayesh Goyani Link to this post

    Thanks Jayesh,

    That's exactly what I wanted!
Back to Top