Ask a questionAsk a question
 

Proposed Answerdisplay member of a datagrid combocolumn need help

  • Thursday, February 12, 2009 5:10 AMmaruthi siva krishna Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
     
     
    Hi friends
    i am very new to  vb.net .please help me....

    i have datagrid which contains a combocolumn.i am populating the items from the table(database).
    the items are coming to the combobox .but problem is
    im am populating the grid (including combocolumn)
    how to populate the data to combocolumn .
    populating the combobox

    mObjclsUserList.mPrGetComboDetails(mObjDtTable)

    For RowIdx = 0 To mObjDtTable.Rows.Count - 1

    Dim Index As Integer = 0

    mStrRole = mObjDtTable.Rows(RowIdx)(0).ToString

    clnRole.Items.Add(mStrRole)

    Next
    code for populating datagrid is

    For RowIdx = 0 To mObjDtTable.Rows.Count - 1

    Dim Index As Integer

     

    Index = dgrUserList.Rows.Add()



     

    mStrUserId = mObjDtTable.Rows(RowIdx)(0).ToString

    dgrUserList.Rows(Index).Cells(0).Value = mStrUserId

    mStrUserRole = mObjDtTable.Rows(RowIdx)(1).ToString

    dgrUserList.Rows(Index).Cells(1).Value = mObjDtTable.Rows(RowIdx)(1).ToString
    next

    dgrUserList.Rows(Index).Cells(1).Value is the combocolumn .
    but i am not getting same value in all rows
    please help me
    its needed

All Replies

  • Tuesday, April 14, 2009 11:40 AMmeghanalohit Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    I think u can do this by setting it in properties of grid which will easily get u the data

    datagridview tasks
    edit columns
    choose ur combo box column
    set datasource:
    then set ur display member


    Inload event write this

    yourdatasource.DataSource = getdetails();

    bsBillingMaster.ResumeBinding();

     


     

    getdetails shd contain all details from table



    Meghana Lohit

    • Proposed As Answer bymeghanalohit Monday, April 27, 2009 10:27 AM
    •