﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Problem Export DataSource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Problem-Export-DataSource/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Problem Export DataSource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Problem-Export-DataSource/</link><pubDate>Fri, 13 Apr 2012 02:35:34 GMT</pubDate><dc:creator>pujatolon@gmail.com</dc:creator><category>DataSource</category><category>export</category><description>&lt;p&gt;It Works!!!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thank You very much.&lt;/p&gt;</description></item><item><title>Problem Export DataSource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Problem-Export-DataSource/</link><pubDate>Thu, 12 Apr 2012 23:27:33 GMT</pubDate><dc:creator>yudi</dc:creator><category>DataSource</category><category>export</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;All codes related to the assignment of data source to the WebGrid component should be place in InitializeDataSource server side event of WebGrid. Avoid assigning the DataSource property to the Grid object such as WebGrid2.DataSource = tabla2, since in the InitializeDataSource event, developers could obtain an object of DataSourceEventArgs here using e.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;Please replace WebGrid2.DataSource = tabla2 with e.DataSource = tabla2. The code listing should looks like below.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;Protected Sub Samplegrid_InitializeDataSource(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid1.InitializeDataSource
    ...
    Funciones.AddColPromedio(tabla2, 1, 2, Total)
    e.DataSource = tabla2
    WebGrid2.DataBind()
End Sub&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;This should helps. Please let us know if the problem still persists.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Problem Export DataSource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Problem-Export-DataSource/</link><pubDate>Thu, 12 Apr 2012 04:49:40 GMT</pubDate><dc:creator>pujatolon@gmail.com</dc:creator><category>DataSource</category><category>export</category><description>&lt;p&gt;Thank you for the reply.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I was doing the data binding process in de Page_Load event. I change this to the InitializeDataSource event and the error screen change. Now is the attachment file.&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt; Protected Sub WebGrid2_InitializeDataSource(sender As Object, e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid2.InitializeDataSource
        Dim Consultas As New Consultas
        Dim Acceso As New AccesoDatos
        Dim Funciones As New Funciones
        Dim tabla As New DataTable
        'tabla = Consultas.ConsultaCategorias()
        'Dim Total As Int32 = Funciones.SumarGrid(tabla, "Clientes")
        'Funciones.AddColPromedio(tabla, 1, 2, Total)
        'Funciones.AddColCodigo(tabla)
        'WebGrid1.DataSource = tabla
        'WebGrid1.DataBind()
        Dim tabla2 As New DataTable
        tabla2 = Consultas.ConsultaDuraciones()
        Dim Total As Int32 = Funciones.SumarGrid(tabla2, "Clientes")
        Funciones.AddColPromedio(tabla2, 1, 2, Total)
        WebGrid2.DataSource = tabla2
        WebGrid2.DataBind()
    End Sub&lt;/pre&gt;
&lt;p&gt; This is the code behind.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Problem Export DataSource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Problem-Export-DataSource/</link><pubDate>Wed, 11 Apr 2012 22:22:09 GMT</pubDate><dc:creator>yudi</dc:creator><category>DataSource</category><category>export</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;Could you please inform me about how did you bind the DataTable (as the data source of WebGrid) in code behind? Currently I suspect that the data binding process might be located in Page_Load event instead of the InitializeDataSource event of WebGrid.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;Look forward to hearing back from you so that we can assist you further.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Problem Export DataSource</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Problem-Export-DataSource/</link><pubDate>Wed, 11 Apr 2012 07:34:04 GMT</pubDate><dc:creator>pujatolon@gmail.com</dc:creator><category>DataSource</category><category>export</category><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;When I try to export data from a WebGrid that it's datasource is a datatable in code behind, it appears the screen that is in atachment.&lt;/p&gt;
&lt;p&gt;If I try to export data from a WebGrid whith an aspdatasource (like in demo example), it works.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Can you please, say to me how can I fixed this problem?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;</description></item></channel></rss>