Hi,
I have a Page with a WebGrid and an ObjectDataSource. The WebGrid has AutoGenerateColumns set to false. I have defined 2 columns which are both bound (IsBound=true). When the page is shown, the select method of the ObjectDataSource is triggered. It returns a DataView with 4 rows.
1. When I set a breakpoint on the InitializeLayout event handler, the e.Layout.Bands[0].Columns.Count is zero. Is this because I didn't autogenerate the columns? I would expect a value of 2.2. The WebGrid is not bound to the 4 rows in the Dataview. But when I force a postback by a simple button click the WebGrid gets bound and now in the InitializeLayout event handler the e.Layout.Bands[0].Columns.Count is 2. Why didn't it bind on the first page load?
thanks,Jeroen
Hi Jeroen,
I was having the same problem as you until I changed the value of IsBound to false.
Hope this helps
Aidan
Hi Aidan,
I tried your suggestion and it worked. But now I do not understand wat the IsBound property is used for... A side effect of setting the IsBound property to false, is that the Update method of the ObjectDataSource does not contain the changed values of my WebGrid. This is not really what I want. I want the data to be bound to the WebGrid on the first load and the Update method to contain the changed values of the data. Is this even possible?