Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Binding a DataGrid to an empty Dataset in vb.net

Posted on 2004-11-29
Medium Priority
Last Modified: 2012-06-22
I have a Dataset with x columns but no rows, I want to bind this to a Datagrid and so the user can start populating the dataset.

If i just set the datasource of the datagrid to the empty dataset, the colums dont show up and i cant add any rows.

Thanks in advance

Question by:mark_w_
  • 2
LVL 11

Accepted Solution

pratap_r earned 1200 total points
ID: 12695308
check the properties of the datagrid, do you see a + sign at the first column?, expand it and you will get the place to add the new row.

make sure you have set RowHeadersVisible property to true.

or simply bind the datatable to the datagrid instead of the dataset

Have Fun!

Author Comment

ID: 12695750
Yeah sorry the dataTable is bound to the datagrid using the following line

 Me.dgMeta.SetDataBinding(dsLocalData, "MCSTable")

I dont get a any of the column headers shown even though i have their visible properties to to true.

is it not showing them cos i dont have any data in the dataset??

all i get is the row column headings, the first row heading is the one that would be in the top left inline  with the column headings and the next one is where the new row would be if there were any columns.


Author Comment

ID: 12696070
All sorted,

Was due to a poor bit of coding on my part,

Thanks for your help though.


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Screencast - Getting to Know the Pipeline

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question