We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can't use slash on headerText on Unbounded column

Thread ID:

Created:

Updated:

Platform:

Replies:

120733 Oct 8,2015 08:16 PM UTC Oct 12,2015 05:21 AM UTC ASP.NET Web Forms 3
loading
Tags: Grid
Constanza
Asked On October 8, 2015 08:16 PM UTC

I have a grid in my aspx file like this:

              <ej:Grid ID="dgManager" runat="server" AllowFiltering="false" AllowPaging="True" AllowGrouping="false" AllowSorting="true" AllowReordering="true"  >
                    <Columns>
                        <ej:Column Field="Agent1" HeaderText="Main Office"  Width="70" />
                        <ej:Column Field="Agent2" HeaderText="Sub Office"  Width="70" />
                        <ej:Column Field="Status" HeaderText="Status" Width="110"/>
                        <ej:Column Field="VIPP" HeaderText="VIP" Width="50"/>
                        <ej:Column HeaderText="View/Edit" IsUnbound="True" TextAlign="Center" Width="150">
                            <Commands>
                                <ej:Commands Type="detail">
                                    <ButtonOptions Text="View/Edit" Width="100" Click="View" ></ButtonOptions>
                                </ej:Commands>
                            </Commands>
                        </ej:Column>                      
                    </Columns>
                </ej:Grid>

When I use a slash in the column "View/Edit", the grid just doesn't populate. If I use a slash in any other of the columns headerText, it works. I think it is because it is an unbounded column.  
I want the HeaderText to be "View/Edit", with the slash. I have already tried escaping the character, but it doesn't work. Any ideas?

Balaji Marimuthu [Syncfusion]
Replied On October 9, 2015 08:46 AM UTC

Hi Constanza,

Thanks for using Syncfusion Products.

To achieve your requirement, we suggest you to use the HeaderTemplateID property in Grid columns. Refer to the sample and code example below.
Sample


<ej:Grid ID="FlatGrid" runat="server" AllowSorting="True" AllowPaging="True" ClientIDMode="Static" >

            <ClientSideEvents ActionComplete="complete" />

            <Columns>

                <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="True" TextAlign="Right" Width="75" />

                <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="80" />

                <ej:Column Field="EmployeeID" HeaderText="Employee ID" TextAlign="Right" Width="75" />

                <ej:Column Field="Freight" HeaderText="Freight" TextAlign="Right" Width="75" Format="{0:C}" />

                <ej:Column HeaderText="View Edit" HeaderTemplateID="#employeeTemplate"  IsUnbound="True" TextAlign="Center" Width="150">

                     <Command>

                             <ej:Commands Type="detail">

                                 <ButtonOptions Text="View/Edit" Width="100" Click="View" ></ButtonOptions>

                             </ej:Commands>

                      </Command>

                </ej:Column>   

            </Columns>

           
        </ej:Grid>


<script id="employeeTemplate" type="text/x-jsrender">

        View/Edit
    </script>


Refer to the Online Demo in following link: http://asp.syncfusion.com/demos/web/grid/headertemplate.aspx


Regards,
Balaji Marimuthu

Constanza
Replied On October 9, 2015 12:51 PM UTC

That worked perfectly!! Thank you very much!

Balaji Marimuthu [Syncfusion]
Replied On October 12, 2015 05:21 AM UTC

Hi Constanza,

We are happy that provided solution helped you.

Please get back to us if you need further assistance. we will be happy to assist you.

Regards,
Balaji Marimuthu

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;