How to select particular row in datagrid

Posted by: jagdeeshk on 18 November 2019, 8:10 pm EST

    • Post Options:
    • Link

    Posted 18 November 2019, 8:10 pm EST

    In my Datagrid I want to select first row default when the data is loaded into the datagrid. Is there any way to select ?

  • Posted 19 November 2019, 5:38 pm EST

    Hi,

    You can simply set the C1DataGrid.SelectedIndex once the data grid is having data as follows:

    dataGrid.SelectedIndex = 0;
    

    Alternatively, you can bind the SelectedItem to the desired index item as follows:

    <c1:C1DataGrid x:Name="dataGrid" ItemsSource="{Binding Products}" SelectedItem="{Binding Products[0]}"/>
    

    Thanks,

    Basant

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels