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

[Solved] RadGrid with AutoGenerateColumns makes no events fire at all

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jordan Earls
Top achievements
Rank 1
Jordan Earls asked on 02 Feb 2010, 09:43 PM
Hello, We have a project. Well, We have a Panel that is also an INamingContainer(a custom control derived from these). We then put inside of this Panel a RadGrid control and a Button control. Note, this is on an ASP.Net AJAX enabled page. As such, the buttons and such all post back async. Well, whenever I go `mygrid.AutoGenerateColumns=true` I suddenly no longer get the `mybutton.Click` event. It does postback and hits the ASP.Net server again, but it does not fire this event. Only whenever AutoGenerateColumns is enabled, that is.

The Grid is databound and is setup like this:
            _gridcontrol.Height = Unit.Pixel(200); 
            _gridcontrol.DataSource = _GridDataSet
            _gridcontrol.DataMember = "GRIDFORMDATA"
            _gridcontrol.Width = Unit.Percentage(100); 
            // _gridcontrol.AutoGenerateColumns = true
            _gridcontrol.AutoGenerateHierarchy = true
            _gridcontrol.Enabled = true
             
            _gridcontrol.ClientSettings.EnablePostBackOnRowClick = true
            _gridcontrol.ClientSettings.Selecting.AllowRowSelect = true
            _gridcontrol.SelectedIndexChanged += new EventHandler(_gridcontrol_SelectedIndexChanged); 

Note, I can use all of those lines for setup and it works, but when I uncomment AutoGenerateColumns, suddenly the events for everything inside of the Panel containing it cease to be fired.

The RadGrid control is the only Telerik control I am using also(no Telerik ajax or anything) and the Panel containing the RadGrid is contained inside of an UpdatePanel. Also, the RadGrid control is dynamically created at runtime.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 05 Feb 2010, 02:11 PM
Hi Jordan,

Could you please confirm that you created the RadGrid control programmatically, following the instructions from these online resources?
http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx(Section 'Programmatic creation')
http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html

Greetings,
Pavlina
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
Jordan Earls
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or