Binding a DataGrid to an empty Dataset in

Posted on 2004-11-29
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_
    LVL 11

    Accepted Solution

    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

    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

    All sorted,

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

    Thanks for your help though.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A short article about a problem I had getting the GPS LocationListener working.
    This is about my first experience with programming Arduino.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now