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

HELP - Radgrid adding dynamic columns and Edit/Insert Form closed on any inner postback

2 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vincenzo
Top achievements
Rank 1
Vincenzo asked on 04 Apr 2012, 10:55 AM
Hi all

Helpme pls.

I've a page
which contains a tabstrip
which contains usercontrols for each tab
one of these contains a radgrid with
*** EditMode="EditForms"
*** autogeneratecolumns="false" and binded on a list of objects via needdatasource
which displays an insert form with just this: <asp:Button ID="btnTemp" runat="server" Text="Hallo" />
(no events handler in this form and no javascript scripts are in)

The radgrid has 3 columns defined in ascx. The others columns must be added at runtime by the user with his preferences

Columns are added through a button at runtime. User select a combovalue and press "ADD" to add the new column.
ADD button just add the new columns in a session variable with the list of current columns added and create the column.

Starts the Page_Init event where I (re)add the columns added by the user.

All works. Viewstate is consistent. I like it.

I click on InsertItemCommand on the grid and my forms appears with just its sad "Hallo" button.
This button has no onclick event handler.
If I click it... no exceptions are thrown but the postback starts and the form gets closed.

And I'm being just crazy to understand WHY :)

I've tried

EnableColumnsViewState="false"/"true"
EnableViewState="true/false"


Using the form in popup mode the same happens! The ADD button doesn't fire any ItemCommand. Just Page_Init and Page_load of the usercontrol contained.

PLS HELP

2 Answers, 1 is accepted

Sort by
0
Vincenzo
Top achievements
Rank 1
answered on 05 Apr 2012, 05:35 PM
Ok

adding columns doesn't effect.

I don't know what's wrong.
0
Vincenzo
Top achievements
Rank 1
answered on 06 Apr 2012, 10:04 AM
OK FOUND

never call a FindControl in a page_init!
Tags
Grid
Asked by
Vincenzo
Top achievements
Rank 1
Answers by
Vincenzo
Top achievements
Rank 1
Share this question
or