allowresize=false for allo lines and columns in c# code ?

Hi

Set that in order to forbid user to resize column width and line height

How is that possible in the grid definition parameter, when the grid is created on-the-fly programatically ? (so not in XAML and not by catching an interuption)


Related to that, it would be good to have a list of all possible grid setup parameters( .Model.RowCount .Model.ColumnCount .AllowDragColumns .Model.TableStyle.IsThreeState .Model.HeaderColumns .Model.FrozenColumns .Model.HeaderRows .Model..Model.TableStyle.Borders.All .Model.TableStyle.Background = Brushes.Transparent .Model.HeaderStyle.Background = Brushes.Transparent .Model.ColumnWidths[0] = ....)

.... and not to find them one by one spreaded in all code examples or forum threads


Thanks,

Fabrice


3 Replies

GA Gobinath A Syncfusion Team November 22, 2013 11:31 AM UTC

Hi Fabrice,

 

Thanks for using Syncfusion products.

 

We have analyzed your query and you can disable the resizing of Column/Row by setting the following highlighted API in your application.

 

Code snippet[XAML]

<syncfusion:GridDataControl Name="syncgrid"

                                    UpdateMode="PropertyChanged"

                                    AllowResizeColumns="False"

                                    AllowResizeRows="False"

                                    NotifyPropertyChanges="True"

                                    ItemsSource="{Binding GDCSource}" >

 

 

 

Please refer the below link for know about the Major Control Classes setup.

 

Link: http://help.syncfusion.com/ug/wpf/grid/documents/42griddatacontrol1.htm

 

Please let us know if you have any queries.

 

Regards,
Gobinath A.

 



FF fff November 23, 2013 09:42 AM UTC

Hi Gobinath,

none of these properties are available for GridControl (note: not DataGrid)

So how to do it ?

Thanks,

Fabrice



KG Kasthuriraja G Syncfusion Team November 27, 2013 05:46 AM UTC

Hi Fabrice,

We have analyzed your query and you can disable the resizing of Column/Row by using ResizingColumns and ResizingRows Events in GridContol. You can achieve your requirement by using the following code snippet.

Code snippet[C#]

grid.ResizingColumns += new GridResizingColumnsEventHandler(grid_ResizingColumns);

 grid.ResizingRows+=new GridResizingRowsEventHandler(grid_ResizingRows);

 private void grid_ResizingColumns(object sender, GridResizingColumnsEventArgs args)

        {

             args.AllowResize = false;

           

 }

 private void grid_ResizingRows(object sender, GridResizingRowsEventArgs args)

        {

         args.AllowResize = false;

        }

 

 

Please refer the solution given below:

Solution: AllowResize.zip

Please let us know if you have any queries.

Regards,

Kasthuriraja.G


Loader.
Up arrow icon