How to populate C1GridView from C# codebehind

Posted by: jhgarniss on 10 September 2017, 11:36 am EST

  • Posted 10 September 2017, 11:36 am EST

    Hi all,


    I have a good idea of how to work with the C1GridView when it is bound to a specific table in a DB, no problem.


     


    However, I'd like to be able to populate a gridview based upon a DB View instead. Is it simply a matter of using the select from a view instead of the DB? Logic says yes. I tried to add columns to an unbound gridview, but the grouping functionality wouldn't show up when I tried it.


    Also, is there a way to populate the gridview ONLY when an action is taken? I have 6 tabs, each with a gridview. I'd like to populate the 5 that are not defaulted to ONLY when the user clicks on the tab. Is there a way to keep those 5 from populating on page load, then populate them when the user clicks the tab?


     


    Thanks, in advance!


    Jon

  • Replied 10 September 2017, 11:36 am EST

    Grouping doesn't work if the grid has row autogeneration turned on. Make sure that AutogenerateColumns property is off.


    >>Also, is there a way to populate the gridview ONLY when an action is taken?


    protected void OnTabChanged()


    {


     C1GridView.DataSource = GetDataSource();


     C1GridView.DataBind();


    }

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels