Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
WebGrid not binding data when dynamically defining columns at runtime.
posted

Hi,

I'm having a problem binding a DataTable to a WebGrid.  This is the setup:

 There's a button on the page that causes a postback.  And during the postback in the event method, I dynamically define each UltraWebColumn and then add each column to the WebGrid.  Then after each column is defined, I assign the datasource to the DataTable and then execute the WebGrid.DataBind() method to bind.

 So, this is the issue.  When I click the button for the first time, no data is rendered to the page.  But, the WebGrid will render data when the button is clicked a second time and any other time after.  But when I clear the webgrid at runtime then click the button to render the grid, no data is rendered again until I click the the button a second time.

 Does anyone have an idea why this might be happening?  Thanks.

Parents
No Data
Reply
  • 100
    posted

    An 'Infragistics Developer Support Engineer' by the name of Vikas has helped me out with this issue.  I thought I would post the resolution in case anybody else had came across this issue.  Well, it turns out that I was doing everything correctly except for 1 property.  Apparently the 'IsBound' property is only required to be set to true when creating custom columns while auto generating columns.  I was setting the 'IsBound' property on the 'UltraGridColumn' object to true while setting the 'AutoGenerateColumns' to false. 

     Thanks Vikas.

Children
No Data