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

[Solved] Force a Rebind before ItemCommand when Viewstate is Enabled

1 Answer 150 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 20 May 2009, 09:31 PM
Hi, does anybody know how to force a rebind before the ItemCommand event is processed on a postback?

I cannot do the bind in the PageLoad as it breaks the functionality of the Edit/Insert custom form, also I cannot disable the Grid's Viewstate as it alos breaks the functioning of the custom edit form.

All the columns are created programatically as the number and name of the columns is not known until runtime.

The senario is basically this:

I have a Grid which is wrapped in an AJAX Panel which shows a list of Charges which is to be split between an arbitary number of groups. The method of splitting the charge is configurable which requires a compex Edit Form  to set the parameters for the split. Everything works fine up to here, the users can happily create and edit charges and change the parameters. BUT there is a requirement to amend the total charge in-place in the grid and to split this charge using the already configured parameters.

There appears to be a mutually exclusivity between the in-line edit without going into edit mode and the enabling of the Viewstate. If the Viewstate is disabled then the in-line portion works a treat but the Edit form fails miserably.

The issue bolis down to the unavailability of a bound GridDataItem in the ItemCommand event and I can't for the life of me get theforce the grid to bind before this event is fired.

Any help would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Nick
Top achievements
Rank 1
answered on 22 May 2009, 04:27 PM
No worries, I have used a work around.

Instead of using a User control for the edit form I have implemented a RADWindow to house the advanced editing and switched off the Viewstate to allow the in-place editting to work.

Basically implemented a version of the demo :
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

Tags
Grid
Asked by
Nick
Top achievements
Rank 1
Answers by
Nick
Top achievements
Rank 1
Share this question
or