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


    I am using RadGrid
    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. Sebastian
    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:

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

    Best regards,
    the Telerik team

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