Deselect first row on gridview onload

I had situation to deselect the first gridview row on load and came to know IsSynchronizedWithCurrentItem on Gridview should able to that but some how i missed on gridview.

Mean while below one should work

        void gvMain_RowLoaded(object sender, RowLoadedEventArgs e)
        {
            try
            {
                GridViewRow row = e.Row as GridViewRow;
                if (row != null && !firstItemExpanded)
                {
                    row.DetailsVisibility = Visibility.Collapsed;
                    firstItemExpanded = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Thanks,

Suresh Behera

Technorati Tags: ,

No Comments