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

OnColumnCreating event

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 10 Nov 2008, 07:12 PM
Anyone using this event?

I saw it from an example at
http://www.telerik.com/community/code-library/aspnet-ajax/grid/adding-custom-column-dynamically.aspx
For adding columns dynamically.

I need to provide editing for a PivotTable-like data structure.
I will have varying columns and rows, and I wanted to provide a grid full of textboxes for the user to do mass edit.
I'll iterate through the rows and columns to do a save on a button click.

The problem is, in my grid, the debugger never hits on the ColumnCreating event.
It will only hit on the ColumnCreated event.

here is the grid definition.
                                        <telerik:RadGrid ID="gridEvil" runat="server" GridLines="None" OnColumnCreating="gridEvil_ColumnCreating">  
                                            <MasterTableView> 
                                                <RowIndicatorColumn> 
                                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                                </RowIndicatorColumn> 
                                                <ExpandCollapseColumn> 
                                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                                </ExpandCollapseColumn> 
                                            </MasterTableView> 
                                            <FilterMenu EnableTheming="True">  
                                                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                                            </FilterMenu> 
                                        </telerik:RadGrid> 
 
It's pretty basic.  Please note that I get the same result with or without the OnColumnCreating="gridEvil_ColumnCreating" in the declaration

It also does not matter if I define the signature of the sub with or without  Handles gridEvil.ColumnCreating

Do I have to do something special to get this event to fire?

1 Answer, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 11 Nov 2008, 07:35 AM
Hello Bob,

Generally ColumnCreating event will be fired if the grid does not know the column type (as in our example). To put all items in edit mode you can use the technique from this code library: Excel-like RadGrid


Sincerely yours,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or