locked
Scrollbar and ScrollViewer is not working properly in my dynamic grid RRS feed

  • Question

  • Hi , 

    I am developing one dynamic grid in which i am taking Number of columns and rows Dynamically . so the size can be differ according to the specified columns and rows . i want my grid to be as fixed size and that should have ScrollBar Functionality if needed . i want to mention that i am using <grid> control and cant use other's like listview and gridView etc . Thanx in advance .


    Wednesday, September 4, 2013 12:20 PM

Answers

  • Hello Shivam,

    You start with something like this :

    	    Grid GdRoot = new Grid();
                GdRoot.Width = 300;
                GdRoot.RowDefinitions.Add(new RowDefinition() {Height = GridLength.Auto });
                GdRoot.ColumnDefinitions.Add(new ColumnDefinition(){Width = GridLength.Auto});
    
                ScrollViewer.SetHorizontalScrollBarVisibility(GdRoot, ScrollBarVisibility.Auto);
    

    -Sagar

    Wednesday, September 4, 2013 1:24 PM