How to avoid Grid AutoDataBind

3 posts, 0 answers
  1. Mike
    Mike avatar
    1 posts
    Member since:
    Feb 2008

    Posted 27 Jun 2008 Link to this post

    Hello

    I am using RadGrid  5.1.3.0
    I am setting Grid datasource at Page.Load and call Grid's DataBind method; after filling grid's items I explicitly set SelectedItem in a grid. But right after that grid's OnLoad is called which rebinds the grid and calls AutoDataBind method, which kills my row selection. I definitely can set Selection on GridDataBound even, but that makes my code not so well structured. Is there any way to disable AutoDataBind method call?

    Thanks in advance.
  2. Esk
    Esk avatar
    11 posts
    Member since:
    Sep 2007

    Posted 27 Jun 2008 Link to this post

    try setting  AutoGenerateColumns="False"  inside the MasterTableView tag

    for example <MasterTableView  AutoGenerateColumns="False">
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 30 Jun 2008 Link to this post

    Hi guys,

    You may also consider switching to NeedDataSource binding as shown in this online demo:

    http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/NeedDataSource/DefaultCS.aspx

    Thus operations like sorting/paging/editing/etc. will not require any additional coding as opposed to simple binding with DataBind() calls.

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top