Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with clearing rows already selected in C1TreuDBGrid

Hi,

I am using one grid (C1Grid) to load multiple xml files depending on which button I press, problem is when I load the Grid with ItemA and select the first two rows, than load the Grid with ItemB, the data for ItemB loads with the first two rows selected. I tried C1Grid.selectedRows.Clear() before loading each item but it's not working.

Thnaks,

Victor
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

>C1Grid.selectedRows.Clear() before loading each item but it's not working.

Try that AFTER loading the items.
Avatar of Victor  Charles

ASKER

It still does not work.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

It may have to do with the way I'm loading the grid, below is the code used for each xml file, any ideas why it is still not working?

Dim dtset1 As New DataSet
        Dim fs1 As System.IO.FileStream
        fs1 = New System.IO.FileStream(Application.StartupPath + "\NASC.xml", IO.FileMode.Open)
        dtset1.ReadXml(fs1)
        fs1.Close()
        Me.C1SelectCombo.DataSource = dtset1.Tables(0)
        C1SelectCombo.Caption = "NASC"
        C1SelectCombo.SelectedRows.Clear()


Thanks,

V.
You are setting the datasource which is the expected way. Is it a combobox or a grid?
It is a Grid.
I must be doing something else wrong, will keep testing.

Thanks.