Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Datagrid Hide Column
posted

 private void GetData()
        {
            var dt = new DataTable();

            dt.Columns.Add("Schedule Item", typeof (string));
            dt.Columns.Add("Job Section", typeof (string));
            dt.Columns.Add("Long Description", typeof (string));

         dt.Columns.Add("Short  Description", typeof (string));
             dt.Columns.Add("Base Rate", typeof (double));
            dt.Columns.Add("Unit", typeof (string));
            dt.Columns.Add("Quantity", typeof (int));
            dt.Columns.Add("Total Price", typeof (double), "[Base Rate] * [Quantity]");


            var items = new[]
                            {
                                "Whole Premises", "Hallway/Entrance", "Lounge", "Kitchen", "Bathroom", "Bedroom1",
                                "Bedroom2", "Bedroom3", "Additions", "Omissions" };

                     

                             
                          


            xamDataGrid.DataSource = dt.DefaultView;

            foreach (var record in xamDataGrid.Records)
            {
                record.IsExpanded = true;
            }
        }

 

I want to add a button and when i click on it  .. it will hide the long description Column and runtime ..

 

How can i do this ?

 

Thanks in advance