Client side databinding, predefined columns

4 posts, 0 answers
  1. Dheeraj
    Dheeraj avatar
    6 posts
    Member since:
    Apr 2009

    Posted 21 Jun 2009 Link to this post

    Hi,

    Am facing a very strange issue, where i am using client side data binding and using a page method to return a business object.

    When i use Autogenerate columns, the data is displayed fine. Where in, if i define the columns before hand and set AutoGenerateColumns to false, the data is not displayed.

    Please find a screenshot here which I have taken when the autogeneratecolumn was set to true with three predefined columns.

    Here is the aspx code:
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server"
        <title>Untitled Page</title> 
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">     
        <script type="text/javascript" language="javascript"
            function pageLoad() { 
                PageMethods.GetList(0, 5, updateGrid); 
            } 
     
            function updateGrid(result) { 
                var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); 
                tableView.set_dataSource(result); 
                tableView.dataBind(); 
            } 
        </script> 
        </telerik:RadCodeBlock> 
    </head> 
    <body> 
        <form id="form1" runat="server"
        <div> 
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="true"
            </telerik:RadScriptManager>    
            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="True"  
                GridLines="None"
                <MasterTableView PageSize="5"
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </ExpandCollapseColumn> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="ProjectName" HeaderText="Project Name" UniqueName="column"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ProjectID" HeaderText="Project ID" UniqueName="column1"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ClientID" HeaderText="Client" UniqueName="column2"
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
            </telerik:RadGrid> 
        </div> 
        </form> 
    </body> 
    </html> 

    Please let me know how to fix this, I am new to using client side databinding ...

    Edited: I was using telerik v:527 trial and then tried with 2009.1.617.35, but same issue.

    Regards,
    Dheeraj Juneja
  2. Dheeraj
    Dheeraj avatar
    6 posts
    Member since:
    Apr 2009

    Posted 22 Jun 2009 Link to this post

    Pls, anyone can look and let us know what is that can be wrong here ?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dheeraj
    Dheeraj avatar
    6 posts
    Member since:
    Apr 2009

    Posted 22 Jun 2009 Link to this post

    Its a show stopper for us ... anyone to bail us out of this issue ??
  5. Dheeraj
    Dheeraj avatar
    6 posts
    Member since:
    Apr 2009

    Posted 23 Jun 2009 Link to this post

    Thanks for your help guys, the trick lied in using "UniqueName" instead of "DataField" when using client side data binding. Hoping that the documentation will be updated to reflect this.

    Regards,
    Dheeraj Juneja
Back to Top