iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Is there a simple way to bind an IList to a webgrid? I tried this and it's not working
<ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="300px" UseDefaultStyle="True" Width="100%"></ISWebGrid:WebGrid>
protected void btnGo_Click(object sender, EventArgs e) { WebGrid1.DataSource = ObjectMgr.GetList(); // Returns IList<MyCustomObj> WebGrid1.DataBind(); }
but nothing happens to the grid. Anything I'm missing?
Thanks
Hello,
It depends on how you define your WebGridColumn structure. In PrepareDataBinding, normally we use RetrieveStructure(). This method will automatically add all columns automatically based your database column. If you want to define the order, I suggest you to add you own column manually.
Regards,Handy
That's not the proper way to do databinding. Please see my attachment sample.
that worked for me. thanks! is there any simple way that we can control the order of the columns displayed?
Thanks Handy. You rock! :)
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname