This is a migrated thread and some comments may be shown as answers.

gridview and comboboxcolumn problem

1 Answer 77 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ersin
Top achievements
Rank 1
Ersin asked on 24 Sep 2012, 06:07 AM
Dear All,

please check for belows...

Creating the scenes:
1- setting the sources for grid and combocolumn...

Dim Mycon As New SqlConnection
Mycon.ConnectionString = "Data Source=YAGESRV\SQLSRV2008;Initial Catalog=TEST;User ID=sa;Password=1234sax."
        Mycon.Open()
        Dim Mycmd As New SqlCommand("", Mycon)
        Mycmd.CommandText = "select ID, BEDEN from tbl_Beden "

        For Each table In MyDset.Tables
            If table.ToString = "BEDEN" Then MyDset.Tables("BEDEN").Clear()
        Next

        Dim MyDAdp As New SqlDataAdapter(Mycmd)
        MyDAdp.Fill(MyDset, "BEDEN")

        RadGridView1.DataSource = MyDset.Tables("BEDEN")
        RadGridView1.Refresh()

        Mycmd.CommandText = "select ID, MUSTERITANIM, SENARYOTANIM, BEDENID from tbl_Musteri "

        For Each table In MyDset.Tables
            If table.ToString = "MUSTERI" Then MyDset.Tables("MUSTERI").Clear()
        Next

        MyDAdp.Fill(MyDset, "MUSTERI")

        RadGridView2.DataSource = MyDset.Tables("MUSTERI")
        RadGridView2.Refresh()

        Dim ComboBox2 As New GridViewComboBoxColumn()

        ComboBox2.DataSource = MyDset.Tables("BEDEN")
        ComboBox2.ValueMember = "ID"
        ComboBox2.DisplayMember = "BEDEN"
        ComboBox2.FieldName = "BEDENID"

        RadGridView2.Columns.Add(ComboBox2)

        MyDAdp.Dispose()

        Mycmd.Dispose()
        Mycon.Dispose()
        Mycon.Close()

2- actions:

a. at the first grid left top of the picture, we are defining the items which will be used in the 2nd grid's combo column datas.

b. then we add a row to the second grid, no problem when adding.

c. then i delete all rows from 2nd grid. no problem when deleting.

d. then i delete all rows from first grid.no problem when deleting.

e. then i add new row to first grid, no problem when adding

f. then we choice the second grid and start to ad a new row... but at the begining of key press these is an item is coming to column BEDENID1 but i havent choiced anything yet !!! please look at the picture attached.


finally i realised that when i delete first main grid's all rows, there is a problem comes up about the realtions between 2nd grids comboboxcolumn...

Question: plese read the (2) and inform us if there are ant way to fix it up ?

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 26 Sep 2012, 03:09 PM
Hello Ersin,

Please see our answer in your "gridview and comboboxcolumn problem" support ticked (ID: 610054).

Kind regards,
Julian Benkov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Ersin
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or