﻿<?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 - DataBind</title><link>http://www.intersoftsolutions.com/Community/Tags/DataBind/</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>Webgrid databinding causing blank screen</title><link>http://www.intersoftsolutions.com/Community/Tags/DataBind/</link><pubDate>Tue, 16 Feb 2016 20:14:29 GMT</pubDate><dc:creator>zeeshaamir13</dc:creator><category>WebGrid</category><category>Exception</category><category>DataBind</category><category>Data</category><category>screen</category><category>blank</category><category>bind</category><description>&lt;p&gt;Hey,&lt;/p&gt;&lt;p&gt;I have a page where there is only 1 webgrid. When the page loads I get a blank white screen. This only happens sometimes, but when it happens the logs show the following exception:&lt;/p&gt;&lt;p&gt;DATETIME: (hidden)&lt;/p&gt;&lt;p&gt;USERNAME: (hidden)&lt;/p&gt;&lt;p&gt;CLIENTID: (hidden)&lt;/p&gt;&lt;p&gt;TARGETNAME: APPLICATION_ERROR: ProcessRequest&lt;/p&gt;&lt;p&gt;METHODNAME: Application_Error&lt;/p&gt;&lt;p&gt;MESSAGE: Exception of type 'System.Web.HttpUnhandledException' was thrown.Object reference not set to an instance of an object.&amp;nbsp;&lt;/p&gt;&lt;p&gt;STACKTRACE FROM PARENT: &amp;nbsp; &amp;nbsp;at System.Web.UI.Page.HandleError(Exception e)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at System.Web.UI.Page.ProcessRequest()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;at System.Web.UI.Page.ProcessRequest(HttpContext context)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously)&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at &amp;nbsp;?. ?. ?(WebGridTable ? &amp;nbsp;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;at &amp;nbsp;?. ?.? (DataView &amp;nbsp; &amp;nbsp;, String ? &amp;nbsp;, String &amp;nbsp; &amp;nbsp;)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;at ISNet.WebUI.WebGrid.WebGrid.DataBind()&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at ISNet.WebUI.WebGrid.WebGrid.OnInitializeDataSource(Object dataSource)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;at ISNet.WebUI.WebGrid.WebGrid.OnLoad(EventArgs e)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at System.Web.UI.Control.LoadRecursive()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;at System.Web.UI.Control.LoadRecursive()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;at System.Web.UI.Control.LoadRecursive()&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at System.Web.UI.Control.LoadRecursive()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;at System.Web.UI.Control.LoadRecursive()&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;at System.Web.UI.Control.LoadRecursive()&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)&lt;/p&gt;&lt;p&gt;STACKTRACE: &amp;nbsp; &amp;nbsp;at tfSW.processcontrol.LogError(String Message, String Stacktrace, String Target, String Method, String clientid)&lt;/p&gt;&lt;p&gt;SOURCE: tfSW&lt;/p&gt;&lt;p&gt;INNER STACKTRACE:&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;I checked the data to make sure there might be something there but that looks fine. The weird thing is I only get this error sometimes. Any help would be greatly appreciated. Thanks.&lt;/p&gt;</description></item><item><title>Remove column defined in aspx markup, from server-side</title><link>http://www.intersoftsolutions.com/Community/Tags/DataBind/</link><pubDate>Tue, 16 Apr 2013 16:03:03 GMT</pubDate><dc:creator>sinan.biondic@gmail.com</dc:creator><category>WebGrid</category><category>DataSource</category><category>Server-side</category><category>serverside</category><category>dynamically</category><category>column</category><category>remove</category><category>Unbound</category><category>DataBind</category><category>collection</category><category>datatable</category><category>PrepareDataBinding</category><category>aspx</category><category>server</category><category>side</category><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am trying to implement webgrid but the problem exists when I'm binding it to datasource. I have a stored procedure that returns some data.However, I don't know how many columns will be returned in that procedure, but I know the names of all columns that can be returned. So what I wanted to do, is to define all possible columns in aspx page, and in server-side PrepareDataBinding method remove columns from webgrid's column collection that don't have their match in datasource datatable that I'm binding it to.&lt;/p&gt;
&lt;p&gt;This doesn't really work as I get an error stating that columne "XYZ" which is defined in aspx can't be found in datasource, although it was removed (I checked with debugger) in PrepareDataBinding event handler.&lt;/p&gt;
&lt;p&gt;I presume this then is not possible, or am I wrong? The reason I am not creating columns from codebehind is simply that I would have to check datasource for every column to see if it exists and then create that column dynamically and add it to the column collection of webgrid. We did that in old version of our application and that PrepareDataBinding method has over 1600 lines of code, so I am looking for a better way of doing this. Please help me for the love of god!&lt;/p&gt;
&lt;p&gt;This is my PrepareDataBinding method (column named "Check" is rowchecker column so i don't want it removed):&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;Dim dt As DataTable = CType(e.DataSource, DataTable)
 Dim grid As WebGrid = CType(sender, WebGrid)
 Dim colName As String
 For Each col As WebGridColumn In grid.RootTable.Columns
 colName = col.DataMember
 If Not colName = "Check" AndAlso Not dt.Columns.Contains(colName) Then
 grid.RootTable.Columns.Remove(col)
 End If
 Next&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;</description></item><item><title>WebCombo ClientSide databind </title><link>http://www.intersoftsolutions.com/Community/Tags/DataBind/</link><pubDate>Fri, 01 Mar 2013 04:47:44 GMT</pubDate><dc:creator>sinan.biondic@gmail.com</dc:creator><category>WebCombo</category><category>DataBind</category><category>client-side</category><description>&lt;p&gt;I have following code:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function success(msg) {
    var combo = ISGetObject('cmbGodina');
    var rows = combo.GetRows();
//    if(rows.length &amp;gt; 0){
//        for(var i = 0; i &amp;lt; rows.length; &amp;#43;&amp;#43;i){
//            rows.Remove(rows[i], true);
//        }
//    }&lt;/pre&gt;&lt;pre&gt;//    combo.UpdateUI();
    var dataTable = new ISDataTable();
    var idColumn = new ISDataColumn(dataTable);
    var naziv = new ISDataColumn(dataTable);
    var datumDo = new ISDataColumn(dataTable);
    var xsltFile = new ISDataColumn(dataTable);
    var procFile = new ISDataColumn(dataTable);
    dataTable.Name = dataTable.TableName = "Root";
    idColumn.Name = idColumn.ColumnName = "IdObrasca";
    naziv.Name = naziv.ColumnName = "Naziv";
    datumDo.Name = datumDo.ColumnName = "DatumDo";
    xsltFile.Name = xsltFile.ColumnName = "XsltFile";
    procFile.Name = procFile.ColumnName = "ProcFile";
    dataTable.Columns.Add(idColumn);
    dataTable.Columns.Add(naziv);
    dataTable.Columns.Add(datumDo);
    dataTable.Columns.Add(xsltFile);
    dataTable.Columns.Add(procFile);
    $(msg).find('Table').each(function (i, row) {
        $(row).find('Field').text();
        var dataRow = dataTable.NewRow();
        dataRow.Cells.GetNamedItem("IdObrasca").Value = $(row).find('IdObrasca').text();
        dataRow.Cells.GetNamedItem("Naziv").Value = $(row).find('Naziv').text();
        dataRow.Cells.GetNamedItem("DatumDo").Value = $(row).find('DatumDo').text();
        dataRow.Cells.GetNamedItem("XsltFile").Value = $(row).find('XsltFile').text();
        dataRow.Cells.GetNamedItem("ProcFile").Value = $(row).find('ProcFile').text();
        dataTable.Rows.Add(dataRow);
    });
    combo.SetDataSource(dataTable);    
    combo.DataBind();
    combo.Render();    
}&lt;/pre&gt;
&lt;p&gt; msg is xml returned by webmethod on serverside. Everything works well, but I can't clear webcombo data before i bind it to another source. the commented lines of code, when uncommented, produce error "Unable to get value of the property 'rowIndex': object is null or undefined"&lt;/p&gt;
&lt;p&gt;this is my combo:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&amp;lt;iswebcombo:WebCombo ID="cmbGodina" runat="server" AllowWildCardSearch="false" Width="200" 
                        Height="20" DataValueField="IdObrasca"
                        ViewStateStorage="None" BindingOperationMode="ClientBinding" DataTextField="Naziv"&amp;gt;
                        &amp;lt;LayoutSettings ComboMode="MultipleColumns" EnableAnimation="False" AlwaysShowAllRowsOnDropdown="true" 
                            EntryMode="AutoComplete" StatusBoxPosition="Top" StatusBoxVisible="false"&amp;gt;
                            &amp;lt;ClientSideEvents  OnAfterItemSelected="cmbGodina_OnAfterItemSelected" /&amp;gt;
                        &amp;lt;/LayoutSettings&amp;gt;
                        &amp;lt;Columns&amp;gt;
                            &amp;lt;iswebcombo:WebComboColumn Name="Naziv" HeaderText="&amp;lt;%$GetString:{%00_pub_Name%}%&amp;gt;" BaseFieldName="Naziv" Width="200" /&amp;gt;
                            &amp;lt;iswebcombo:WebComboColumn Name="DatumDo" Hidden="true" RenderOnHidden="true" BaseFieldName="DatumDo" /&amp;gt;
                            &amp;lt;iswebcombo:WebComboColumn Name="XsltFile" Hidden="true" RenderOnHidden="true" BaseFieldName="XsltFile" /&amp;gt;
                            &amp;lt;iswebcombo:WebComboColumn Name="ProcFile" Hidden="true" RenderOnHidden="true" BaseFieldName="ProcFile" /&amp;gt;
                        &amp;lt;/Columns&amp;gt;
                        &amp;lt;ClientBindingSettings DataSourceType="ClientDataSource" /&amp;gt;
                    &amp;lt;/iswebcombo:WebCombo&amp;gt;
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;</description></item><item><title>Webcombo databind to WebMethod </title><link>http://www.intersoftsolutions.com/Community/Tags/DataBind/</link><pubDate>Thu, 28 Feb 2013 08:43:15 GMT</pubDate><dc:creator>sinan.biondic@gmail.com</dc:creator><category>WebCombo</category><category>DataBind</category><category>webmethod</category><category>client-side</category><description>&lt;p&gt;I am trying to bind webcombo dynamically. In the page_load event on server side i don't have the information needed to load webcombo data, i have it on client-side. I saw that it was possible to bind combo to webmethod in webservice, but is it possible to bind it to webmethod on .aspx page on which the combo itself is contained.&lt;/p&gt;
&lt;p&gt;My problem is that i need to dynamically rebind webcombo on client depending on some input. So when users clicks on different menu options I have to load different data in combo. Is that even possible, and if yes, can someone please give me a working example. I am getting data from stored procedure in sql server. Is there a way, please help!&lt;/p&gt;</description></item><item><title>how to :binding data  dynamically   </title><link>http://www.intersoftsolutions.com/Community/Tags/DataBind/</link><pubDate>Thu, 26 Aug 2010 22:27:41 GMT</pubDate><dc:creator>qq397472251</dc:creator><category>WebGrid</category><category>DataBind</category><description>&lt;p&gt;The page have a webgrid~~&lt;/p&gt;
&lt;p&gt;but I have 3 Dataset,how to : bind these Dataset to webgrid dynamically   (with the way "WebGrid1.DataBind()" ,not the way "e.DataSource = dataset1.DefaultView")   &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;I bind by DataBind()&amp;nbsp; cause export excel wrong and can not use VirtualLoadMode.and&amp;nbsp; so many questions with the way("DataBind()&amp;nbsp;"&amp;nbsp; )...&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;but how can i bind many datasouce  dynamically ????&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;such as:&lt;/p&gt;
&lt;p&gt;     protected void Button9_Click(object sender, EventArgs e)&lt;br /&gt;        {       &lt;br /&gt;            webgrid2.DataSource = myds();//second dataset&lt;br /&gt;            webgrid2.DataBind();            &lt;br /&gt;            webgrid2.RebindDataSource();       &lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;  protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {     &lt;br /&gt;            if (!IsPostBack)&lt;br /&gt;            {   &lt;br /&gt;                webgrid2.DataSource = mytb();//first dataset&lt;br /&gt;                webgrid2.DataBind();&lt;br /&gt;                webgrid2.RebindDataSource();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;/p&gt;
&lt;p&gt; With this way cause wrong "Unable to communicate with server.",It seems that webgrid can not use &lt;/p&gt;
&lt;p&gt;" DataBind()"&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>