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

RadGrid features set

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 28 Mar 2012, 12:57 PM
Dear Sir or Madam,

We are currently looking for asp.net/asp.net ajax DataGrid control with a set of functionality we need for our product. It looks like your RadGrid could be the one we need though I'd like to check if some features supported.
1. Is it possible to edit the headers (for unbound scenario or for object bound scenario).
2. Is it possible to turn off headers?
3. Is it possible to make editable particular rows and columns only?
4. Is it possible to change the background colour for the cells/row/columns depending on the column/row content after editing of a cell is done (especially in the server batch mode).
5. Is it possible to create, fill with data, and setup for support all the features above dynamically and then add control to the page in .cs file or anything must be set up in .aspx as well?
Regards,
Alex 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 Apr 2012, 12:41 PM
Hi Alex,

Thank you for contacting us.

RadGrid provides fully customizable interface, including adding custom filtering expressions, controls, templates, paging, sorting and much more.

You can try these methods to achieve the desired behaviour of your grid:
  • to edit the headers 
You can customize the look of  RadGrid entirely, including the headers:
<style>
        th.rgHeader
        {
            font-style: italic !important;
            border-width: thick !important;
            font-size: 20px !important;
            height: 50px !important;
        }
</style>
For more information about applying custom skin please refer to this article.
You can also create a more complex form for your headers and columns described here.
  • to turn off headers
To disable the header item try adding this to your mark-up:
<style> 
    #GridName table thead 
    
        display: none
    }
</style>

  • to make editable particular rows and columns only
You can achieve this simply by adding ReadOnly="True" to tags of the columns you want to "lock up"
  •  to change the background colour for the cells/row/columns
This is easily achievable either declaratively and dynamically. For example take a look at this demo.
Additional information about accessing rows and cells is provided in this help topic.
  • to create, fill with data, and setup for support all the features above dynamically
You can access the header item using RadGrid ItemDataBound event:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridHeaderItem)
       {
           GridHeaderItem header = (GridHeaderItem)e.Item;
           header.Enabled = true;
           header.Font.Italic = true;
           header.Font.Size = 12;
           header.Height = 50;
       }
   }
Given that you are using Auto-generated columns, you can customize them in ColumnCreated event showed below:
protected void RadGrid1_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e) 
    
        if (e.Column.HeaderText == "Category Id"
        
            GridBoundColumn boundColumn = e.Column as GridBoundColumn; 
            boundColumn.HeaderStyle.Width = 80; 
            boundColumn.FilterControlWidth = 30; 
                  boundColumn.DataField="CustomerID";
         } 
    }

  • to add control to the page programmatically
It is possible to create all of your controls dynamically in the code-behind. For example please refer to  RadGrid Programmatic Creation

Additionally, to get a practical idea about our RadGrid capabilities please look at our RadGrid demos
I hope this helps you take an easier decision. If you have further questions please free to turn to us.

Regards,
Eyup
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.
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or